Add www option for MIC telemetry sequence.

pull/75/head
Matt 2021-09-18 16:51:51 -05:00
rodzic afa4121b51
commit eb25ea2cbf
4 zmienionych plików z 41 dodań i 6 usunięć

Wyświetl plik

@ -101,14 +101,26 @@
<label for="aprs_batt">Show Battery</label>
<input name="aprs_batt" id="aprs_batt" type="checkbox" value="1" title=" show battery voltage after personal comment">
</div>
</div>
<div class="grid-container full">
<h5 class="u-full-width">Telemetry Settings</h5>
</div>
<div class="grid-container quarters">
<div>
<label for="tnc_tel">Enable Self Telemetry</label>
<input name="tnc_tel" id="tnc_tel" type="checkbox" value="1" title=" send self telemetry data">
<input name="tnc_tel" id="tnc_tel" type="checkbox" value="1" title="send self telemetry data">
</div>
<div>
<label for="tnc_tel_int">Self Telemetry Interval [s]</label>
<input name="tnc_tel_int" id="tnc_tel_int" type="number" min="10" title="time between sending telemetry if Enable Self Telemetry option is selected ">
</div>
<div>
<label for="tnc_tel_mic">Self Telemetry Sequence</label>
<select id="tnc_tel_mic" name="tnc_tel_mic" title="self telemetry sequence type (numeric supported by aprs.fi and aprsdirect.com)">
<option value="0">Numeric</option>
<option value="1">MIC</option>
</select>
</div>
</div>
<div class="grid-container full">
<h5 class="u-full-width">Fixed Beaconing Settings</h5>

Wyświetl plik

@ -41,6 +41,8 @@ static const char *const PREF_TNC_SELF_TELEMETRY_INTERVAL = "tnc_tel_int";
static const char *const PREF_TNC_SELF_TELEMETRY_INTERVAL_INIT = "tnc_tel_int_i";
static const char *const PREF_TNC_SELF_TELEMETRY_SEQ = "tnc_tel_seq";
static const char *const PREF_TNC_SELF_TELEMETRY_SEQ_INIT = "tnc_tel_seq_i";
static const char *const PREF_TNC_SELF_TELEMETRY_MIC = "tnc_tel_mic";
static const char *const PREF_TNC_SELF_TELEMETRY_MIC_INIT = "tnc_tel_mic_i";
// SMART BEACONING
static const char *const PREF_APRS_SB_MIN_INTERVAL_PRESET = "sb_min_interv";
static const char *const PREF_APRS_SB_MIN_INTERVAL_PRESET_INIT = "sb_min_interv_i";

Wyświetl plik

@ -123,6 +123,11 @@ int tel_sequence;
#else
boolean enable_tel = false;
#endif
#ifdef TNC_SELF_TELEMETRY_MIC
int tel_mic = 1; // telemetry as "T#MIC"
#else
int tel_mic = 0; // telemetry as "T#001"
#endif
#ifdef ENABLE_BLUETOOTH
boolean enable_bluetooth = true;
#else
@ -519,11 +524,17 @@ String prepareCallsign(const String& callsign){
#endif
// Determine sequence number (or 'MIC')
tel_sequence = preferences.getUInt(PREF_TNC_SELF_TELEMETRY_SEQ, 0);
// Pad to 3 digits
char tel_sequence_char[3];
sprintf_P(tel_sequence_char, "%03u", tel_sequence);
String tel_sequence_str = String(tel_sequence_char);
String tel_sequence_str;
if(tel_mic == 1){
tel_sequence_str = "MIC";
}else{
// Get the current saved telemetry sequence
tel_sequence = preferences.getUInt(PREF_TNC_SELF_TELEMETRY_SEQ, 0);
// Pad to 3 digits
char tel_sequence_char[3];
sprintf_P(tel_sequence_char, "%03u", tel_sequence);
tel_sequence_str = String(tel_sequence_char);
}
String telemetryParamsNames = String(":") + Tcall_message + ":PARM.B Volt,B In,B Out,AC V,AC C";
String telemetryUnitNames = String(":") + Tcall_message + ":UNIT.mV,mA,mA,mV,mA";
@ -669,6 +680,12 @@ void setup(){
}
tel_sequence = preferences.getInt(PREF_TNC_SELF_TELEMETRY_SEQ);
if (!preferences.getBool(PREF_TNC_SELF_TELEMETRY_MIC_INIT)){
preferences.putBool(PREF_TNC_SELF_TELEMETRY_MIC_INIT, true);
preferences.putInt(PREF_TNC_SELF_TELEMETRY_MIC, tel_mic);
}
tel_mic = preferences.getInt(PREF_TNC_SELF_TELEMETRY_MIC);
if (!preferences.getBool(PREF_APRS_LATITUDE_PRESET_INIT)){
preferences.putBool(PREF_APRS_LATITUDE_PRESET_INIT, true);
preferences.putString(PREF_APRS_LATITUDE_PRESET, LATIDUDE_PRESET);

Wyświetl plik

@ -206,6 +206,7 @@ void handle_Cfg() {
jsonData += jsonLineFromPreferenceBool(PREF_APRS_GPS_EN);
jsonData += jsonLineFromPreferenceBool(PREF_ENABLE_TNC_SELF_TELEMETRY);
jsonData += jsonLineFromPreferenceInt(PREF_TNC_SELF_TELEMETRY_INTERVAL);
jsonData += jsonLineFromPreferenceInt(PREF_TNC_SELF_TELEMETRY_MIC);
jsonData += jsonLineFromPreferenceBool(PREF_DEV_OL_EN);
jsonData += jsonLineFromPreferenceBool(PREF_APRS_SHOW_CMT);
jsonData += jsonLineFromPreferenceBool(PREF_DEV_BT_EN);
@ -275,6 +276,9 @@ void handle_SaveAPRSCfg() {
if (server.hasArg(PREF_TNC_SELF_TELEMETRY_INTERVAL)){
preferences.putInt(PREF_TNC_SELF_TELEMETRY_INTERVAL, server.arg(PREF_TNC_SELF_TELEMETRY_INTERVAL).toInt());
}
if (server.hasArg(PREF_TNC_SELF_TELEMETRY_MIC)){
preferences.putInt(PREF_TNC_SELF_TELEMETRY_MIC, server.arg(PREF_TNC_SELF_TELEMETRY_MIC).toInt());
}
// Smart Beaconing settings
if (server.hasArg(PREF_APRS_FIXED_BEACON_INTERVAL_PRESET)){