configurable mdns name
This commit is contained in:
parent
69aea6dcfd
commit
e64d699f6a
|
|
@ -464,6 +464,7 @@ struct st_configitems config_list[] = {
|
||||||
{"led_pout", "LED output port", 0, &sonde.config.led_pout},
|
{"led_pout", "LED output port", 0, &sonde.config.led_pout},
|
||||||
{"gps_rxd", "GPS RXD pin (-1 to disable)", 0, &sonde.config.gps_rxd},
|
{"gps_rxd", "GPS RXD pin (-1 to disable)", 0, &sonde.config.gps_rxd},
|
||||||
{"gps_txd", "GPS TXD pin (not really needed)", 0, &sonde.config.gps_txd},
|
{"gps_txd", "GPS TXD pin (not really needed)", 0, &sonde.config.gps_txd},
|
||||||
|
{"mdnsname", "mDNS name", 14, &sonde.config.mdnsname},
|
||||||
};
|
};
|
||||||
const static int N_CONFIG = (sizeof(config_list) / sizeof(struct st_configitems));
|
const static int N_CONFIG = (sizeof(config_list) / sizeof(struct st_configitems));
|
||||||
|
|
||||||
|
|
@ -1726,7 +1727,7 @@ String translateEncryptionType(wifi_auth_mode_t encryptionType) {
|
||||||
|
|
||||||
void enableNetwork(bool enable) {
|
void enableNetwork(bool enable) {
|
||||||
if (enable) {
|
if (enable) {
|
||||||
MDNS.begin("rdzsonde");
|
MDNS.begin(sonde.config.mdnsname);
|
||||||
SetupAsyncServer();
|
SetupAsyncServer();
|
||||||
udp.begin(WiFi.localIP(), LOCALUDPPORT);
|
udp.begin(WiFi.localIP(), LOCALUDPPORT);
|
||||||
MDNS.addService("http", "tcp", 80);
|
MDNS.addService("http", "tcp", 80);
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,7 @@ void Sonde::defaultConfig() {
|
||||||
config.noisefloor = -125;
|
config.noisefloor = -125;
|
||||||
strcpy(config.call,"NOCALL");
|
strcpy(config.call,"NOCALL");
|
||||||
strcpy(config.passcode, "---");
|
strcpy(config.passcode, "---");
|
||||||
|
strcpy(config.mdnsname, "rdzsonde");
|
||||||
config.maxsonde=15;
|
config.maxsonde=15;
|
||||||
config.debug=0;
|
config.debug=0;
|
||||||
config.wifi=1;
|
config.wifi=1;
|
||||||
|
|
@ -236,6 +237,8 @@ void Sonde::setConfig(const char *cfg) {
|
||||||
config.wifi = atoi(val);
|
config.wifi = atoi(val);
|
||||||
} else if(strcmp(cfg,"wifiap")==0) {
|
} else if(strcmp(cfg,"wifiap")==0) {
|
||||||
config.wifiap = atoi(val);
|
config.wifiap = atoi(val);
|
||||||
|
} else if(strcmp(cfg,"mdnsname")==0) {
|
||||||
|
strncpy(config.mdnsname, val, 14);
|
||||||
} else if(strcmp(cfg,"display")==0) {
|
} else if(strcmp(cfg,"display")==0) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,7 @@ typedef struct st_rdzconfig {
|
||||||
int maxsonde; // number of max sonde in scan (range=1-99)
|
int maxsonde; // number of max sonde in scan (range=1-99)
|
||||||
int norx_timeout; // Time after which rx mode switches to scan mode (without rx signal)
|
int norx_timeout; // Time after which rx mode switches to scan mode (without rx signal)
|
||||||
int noisefloor; // for spectrum display
|
int noisefloor; // for spectrum display
|
||||||
|
char mdnsname[15]; // mDNS-Name, defaults to rdzsonde
|
||||||
// receiver configuration
|
// receiver configuration
|
||||||
int showafc; // show afc value in rx screen
|
int showafc; // show afc value in rx screen
|
||||||
int freqofs; // frequency offset (tuner config = rx frequency + freqofs) in Hz
|
int freqofs; // frequency offset (tuner config = rx frequency + freqofs) in Hz
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue