10000 LEAmDNS v2 (optional) from @LaborEtArs by d-a-v · Pull Request #7281 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

LEAmDNS v2 (optional) from @LaborEtArs #7281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
still using current LEA
  • Loading branch information
d-a-v committed May 8, 2020
commit 6d22b7073b879668ccdaf0213ec6bdc8252234d1
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@

*/

#ifndef APSSID
#define APSSID "your-apssid"
#define APPSK "your-password"
#endif

#ifndef STASSID
#define STASSID "your-ssid"
#define STASSID "your-sta"
#define STAPSK "your-password"
#endif

Expand All @@ -30,15 +35,15 @@
@brief mDNS and OTA Constants
@{
*/
#define HOSTNAME "ESP8266-OTA-" ///< Hostename. The setup function adds the Chip ID at the end.
#define HOSTNAME "ESP8266-OTA-" ///< Hostname. The setup function adds the Chip ID at the end.
/// @}

/**
@brief Default WiFi connection information.
@{
*/
const char* ap_default_ssid = STASSID; ///< Default SSID.
const char* ap_default_psk = STAPSK; ///< Default PSK.
const char* ap_default_ssid = APSSID; ///< Default SSID.
const char* ap_default_psk = APPSK; ///< Default PSK.
/// @}< 8000 /td>

/// Uncomment the next line for verbose output over UART.
Expand Down Expand Up @@ -166,8 +171,8 @@ void setup() {

// Load wifi connection information.
if (! loadConfig(&station_ssid, &station_psk)) {
station_ssid = "";
station_psk = "";
station_ssid = STASSID;
station_psk = STAPSK;

Serial.println("No WiFi connection information available.");
}
Expand Down
19 changes: 11 additions & 8 deletions libraries/ESP8266mDNS/src/ESP8266mDNS.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,22 @@

*/

enum class MDNSApiVersion { Legacy, LEA, LEAv2 };
enum class MDNSApiVersion { Legacy, LEA, LEAv2Compat, LEAv2 };

#include "ESP8266mDNS_Legacy.h"
#include "LEAmDNS.h"
#include "LEAmDNS2Host.h"
#include "ESP8266mDNS_Legacy.h" // Legacy
#include "LEAmDNS.h" // LEA
#include "LEAmDNS2_Legacy.h" // LEAv2Compat - replacement for LEA using v2
#include "LEAmDNS2Host.h" // LEAv2 - API updated

// clsMDNSHost replaces MDNSResponder in LEAv2
using clsMDNSHost = esp8266::experimental::clsLEAMDNSHost;

#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_MDNS)
// Maps the implementation to use to the global namespace type
//using MDNSResponder = Legacy_MDNSResponder::MDNSResponder; // Legacy
using MDNSResponder = esp8266::MDNSImplementation::MDNSResponder; // LEA
//using MDNSResponder = clsMDNSHost; // LEAv2
//using MDNSResponder = Legacy_MDNSResponder::MDNSResponder; // Legacy
using MDNSResponder = esp8266::MDNSImplementation::MDNSResponder; // LEA
//using MDNSResponder = esp8266::MDNSImplementation::clsLEAMDNSHost_Legacy; // LEAv2Compat
//using MDNSResponder = clsMDNSHost; // LEAv2

extern MDNSResponder MDNS;
#endif

3 changes: 3 additions & 0 deletions libraries/ESP8266mDNS/src/LEAmDNS2_Legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class clsLEAMDNSHost_Legacy
};

public:

static constexpr auto ApiVersion = MDNSApiVersion::LEAv2Compat;

/* INTERFACE */
clsLEAMDNSHost_Legacy(void);
virtual ~clsLEAMDNSHost_Legacy(void);
Expand Down
0