Start terminal config
This commit is contained in:
parent
3c53f94c1b
commit
700d676d4c
@ -196,8 +196,14 @@ void loadMemory()
|
|||||||
|
|
||||||
void refreshConfig()
|
void refreshConfig()
|
||||||
{
|
{
|
||||||
|
float frequency = configuration.modem_frequency;
|
||||||
|
|
||||||
|
if (MODEM_FREQ_LOWER < value && value < MODEM_FREQ_UPPER)
|
||||||
radio.setFrequency(configuration.modem_frequency);
|
radio.setFrequency(configuration.modem_frequency);
|
||||||
|
|
||||||
|
else
|
||||||
|
radio.setFrequency(0);
|
||||||
|
|
||||||
// The default transmitter power is 13dBm, using PA_BOOST.
|
// The default transmitter power is 13dBm, using PA_BOOST.
|
||||||
// If you are using RFM95/96/97/98 modules which uses the PA_BOOST transmitter pin, then
|
// If you are using RFM95/96/97/98 modules which uses the PA_BOOST transmitter pin, then
|
||||||
// you can set transmitter powers from 2 to 20 dBm:
|
// you can set transmitter powers from 2 to 20 dBm:
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
|
|
||||||
#define MODEM_CONFIG RH_RF95::Bw125Cr45Sf128
|
#define MODEM_CONFIG RH_RF95::Bw125Cr45Sf128
|
||||||
#define MODEM_POWER 13
|
#define MODEM_POWER 13
|
||||||
#define MODEM_FREQ 868.0
|
#define MODEM_FREQ_LOWER 863
|
||||||
|
#define MODEM_FREQ_UPPER 870
|
||||||
#define HASH_LENGTH 8 // 8 bytes
|
#define HASH_LENGTH 8 // 8 bytes
|
||||||
|
|
||||||
#define RF_SS_PIN 1
|
#define RF_SS_PIN 1
|
||||||
|
@ -124,6 +124,43 @@ void loop()
|
|||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
saveMemory();
|
saveMemory();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'T':
|
||||||
|
case 't':
|
||||||
|
String in_str = "";
|
||||||
|
while (in_str != "END")
|
||||||
|
{
|
||||||
|
in_str = SerialUSB.readStringUntil('\n');
|
||||||
|
in_str.trim();
|
||||||
|
if (in_str[0] != '#')
|
||||||
|
{
|
||||||
|
in_str.toLowerCase();
|
||||||
|
in_str.replace("\t", " ");
|
||||||
|
|
||||||
|
while (in_str.indexOf(" ") != -1)
|
||||||
|
in_str.replace(" ", " ");
|
||||||
|
|
||||||
|
int space_index = in_str.indexOf(" ");
|
||||||
|
String option = in_str.substring(0, space_index);
|
||||||
|
|
||||||
|
if (option == "frequency")
|
||||||
|
{
|
||||||
|
float value = in_str.substring(space_index, in_str.indexOf(" ", space_index + 1)).toFloat();
|
||||||
|
if (MODEM_FREQ_LOWER < value && value < MODEM_FREQ_UPPER)
|
||||||
|
configuration.modem_frequency = value;
|
||||||
|
else
|
||||||
|
SerialUSB.print("Frequency out of range!")
|
||||||
|
}
|
||||||
|
else if (option == "power")
|
||||||
|
int value = in_str.substring(space_index, in_str.indexOf(" ", space_index + 1)).toInt();
|
||||||
|
if (2 < value && value < 20)
|
||||||
|
configuration.modem_power = value;
|
||||||
|
else
|
||||||
|
SerialUSB.print("Power out of range!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user