kopia lustrzana https://github.com/dl9rdz/rdz_ttgo_sonde
some code cleanup
rodzic
00899dba2a
commit
23fa620aa6
|
@ -62,6 +62,20 @@ const int daylightOffset_sec = 0; //UTC
|
||||||
boolean connected = false;
|
boolean connected = false;
|
||||||
WiFiUDP udp;
|
WiFiUDP udp;
|
||||||
WiFiClient client;
|
WiFiClient client;
|
||||||
|
|
||||||
|
/* Sonde.h: enum SondeType { STYPE_DFM,, STYPE_RS41, STYPE_RS92, STYPE_M10M20, STYPE_M10, STYPE_M20, STYPE_MP3H }; */
|
||||||
|
const char *sondeTypeStrSH[NSondeTypes] = { "DFM", "RS41", "RS92", "Mxx"/*never sent*/, "M10", "M20", "MRZ" };
|
||||||
|
const char *dfmSubtypeStrSH[16] = { NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
|
"DFM06", // 0x06
|
||||||
|
"PS15", // 0x07
|
||||||
|
NULL, NULL,
|
||||||
|
"DFM09", // 0x0A
|
||||||
|
"DFM17", // 0x0B
|
||||||
|
"DFM09P", // 0x0C
|
||||||
|
"DFM17", // 0x0D
|
||||||
|
NULL, NULL
|
||||||
|
};
|
||||||
|
|
||||||
#if FEATURE_SONDEHUB
|
#if FEATURE_SONDEHUB
|
||||||
#define SONDEHUB_STATION_UPDATE_TIME (60*60*1000) // 60 min
|
#define SONDEHUB_STATION_UPDATE_TIME (60*60*1000) // 60 min
|
||||||
#define SONDEHUB_MOBILE_STATION_UPDATE_TIME (30*1000) // 30 sec
|
#define SONDEHUB_MOBILE_STATION_UPDATE_TIME (30*1000) // 30 sec
|
||||||
|
@ -265,8 +279,7 @@ void setupChannelList() {
|
||||||
int active = space[3] == '+' ? 1 : 0;
|
int active = space[3] == '+' ? 1 : 0;
|
||||||
if (space[4] == ' ') {
|
if (space[4] == ' ') {
|
||||||
memset(launchsite, ' ', 16);
|
memset(launchsite, ' ', 16);
|
||||||
int str_len = strlen(space + 5);
|
strncpy(launchsite, space + 5, 16);
|
||||||
strncpy(launchsite, space + 5, str_len > 16 ? 16 : str_len);
|
|
||||||
if (sonde.config.debug == 1) {
|
if (sonde.config.debug == 1) {
|
||||||
Serial.printf("Add %f - sondetype: %d (on/off: %d) - site #%d - name: %s\n ", freq, type, active, i, launchsite);
|
Serial.printf("Add %f - sondetype: %d (on/off: %d) - site #%d - name: %s\n ", freq, type, active, i, launchsite);
|
||||||
}
|
}
|
||||||
|
@ -3214,7 +3227,7 @@ void execOTA() {
|
||||||
Serial.printf("Updating file %s (%d bytes)\n", fn, len);
|
Serial.printf("Updating file %s (%d bytes)\n", fn, len);
|
||||||
char fnstr[17];
|
char fnstr[17];
|
||||||
memset(fnstr, ' ', 16);
|
memset(fnstr, ' ', 16);
|
||||||
strncpy(fnstr, fn, strlen(fn));
|
strncpy(fnstr, fn, 16);
|
||||||
fnstr[16] = 0;
|
fnstr[16] = 0;
|
||||||
disp.rdis->drawString(0, 2 * dispys, fnstr);
|
disp.rdis->drawString(0, 2 * dispys, fnstr);
|
||||||
File f = SPIFFS.open(fn, FILE_WRITE);
|
File f = SPIFFS.open(fn, FILE_WRITE);
|
||||||
|
@ -3560,18 +3573,7 @@ enum SHState { SH_DISCONNECTED, SH_CONNECTING, SH_CONN_IDLE, SH_CONN_APPENDING,
|
||||||
SHState shState = SH_DISCONNECTED;
|
SHState shState = SH_DISCONNECTED;
|
||||||
time_t shStart = 0;
|
time_t shStart = 0;
|
||||||
|
|
||||||
/* Sonde.h: enum SondeType { STYPE_DFM,, STYPE_RS41, STYPE_RS92, STYPE_M10M20, STYPE_M10, STYPE_M20, STYPE_MP3H }; */
|
|
||||||
const char *sondeTypeStrSH[NSondeTypes] = { "DFM", "RS41", "RS92", "Mxx"/*never sent*/, "M10", "M20", "MRZ" };
|
|
||||||
const char *dfmSubtypeStrSH[16] = { NULL, NULL, NULL, NULL, NULL, NULL,
|
|
||||||
"DFM06", // 0x06
|
|
||||||
"PS15", // 0x07
|
|
||||||
NULL, NULL,
|
|
||||||
"DFM09", // 0x0A
|
|
||||||
"DFM17", // 0x0B
|
|
||||||
"DFM09P", // 0x0C
|
|
||||||
"DFM17", // 0x0D
|
|
||||||
NULL, NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
void sondehub_reply_handler(WiFiClient * client) {
|
void sondehub_reply_handler(WiFiClient * client) {
|
||||||
// sondehub handler for tasks to be done even if no data is to be sent:
|
// sondehub handler for tasks to be done even if no data is to be sent:
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "Sonde.h"
|
#include "Sonde.h"
|
||||||
//#include <WiFi.h>
|
//#include <WiFi.h>
|
||||||
#include <WiFiUdp.h>
|
#include <WiFiUdp.h>
|
||||||
|
#include <time.h>
|
||||||
class Chasemapper {
|
class Chasemapper {
|
||||||
public:
|
public:
|
||||||
static int send(WiFiUDP &udb, SondeInfo *si);
|
static int send(WiFiUDP &udb, SondeInfo *si);
|
||||||
|
|
Ładowanie…
Reference in New Issue