configurable mdns name

This commit is contained in:
Hansi, dl9rdz 2019-12-21 18:41:34 +01:00
parent 69aea6dcfd
commit e64d699f6a
3 changed files with 6 additions and 1 deletions

View File

@ -464,6 +464,7 @@ struct st_configitems config_list[] = {
{"led_pout", "LED output port", 0, &sonde.config.led_pout},
{"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},
{"mdnsname", "mDNS name", 14, &sonde.config.mdnsname},
};
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) {
if (enable) {
MDNS.begin("rdzsonde");
MDNS.begin(sonde.config.mdnsname);
SetupAsyncServer();
udp.begin(WiFi.localIP(), LOCALUDPPORT);
MDNS.addService("http", "tcp", 80);

View File

@ -147,6 +147,7 @@ void Sonde::defaultConfig() {
config.noisefloor = -125;
strcpy(config.call,"NOCALL");
strcpy(config.passcode, "---");
strcpy(config.mdnsname, "rdzsonde");
config.maxsonde=15;
config.debug=0;
config.wifi=1;
@ -236,6 +237,8 @@ void Sonde::setConfig(const char *cfg) {
config.wifi = atoi(val);
} else if(strcmp(cfg,"wifiap")==0) {
config.wifiap = atoi(val);
} else if(strcmp(cfg,"mdnsname")==0) {
strncpy(config.mdnsname, val, 14);
} else if(strcmp(cfg,"display")==0) {
int i = 0;
char *ptr;

View File

@ -173,6 +173,7 @@ typedef struct st_rdzconfig {
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 noisefloor; // for spectrum display
char mdnsname[15]; // mDNS-Name, defaults to rdzsonde
// receiver configuration
int showafc; // show afc value in rx screen
int freqofs; // frequency offset (tuner config = rx frequency + freqofs) in Hz