Skip to content
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

LEAmDNS v2 (optional) from @LaborEtArs #7281

Closed
wants to merge 18 commits into from
Closed

Conversation

d-a-v
Copy link
Collaborator

@d-a-v d-a-v commented May 8, 2020

This is a work in progress provided by @LaborEtArs with some minor ajustments.

This PR contains two more mDNS implementations providing:

  • IPv6 support
  • support for multiple and independent interfaces
    (an example is provided in examples/LEAmDNS/TwoInterfaces)

To help description, here's the updated ESP8266mDNS.h:

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

#include "ESP8266mDNS_Legacy.h" // Legacy
#include "LEAmDNS.h"            // LEA
#include "LEAmDNS2_Legacy.h"    // LEAv2Compat - replacement for LEA using v2 API
#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 = esp8266::MDNSImplementation::clsLEAMDNSHost_Legacy; // LEAv2Compat
//using MDNSResponder = clsMDNSHost;                                        // LEAv2

extern MDNSResponder MDNS;
#endif

New implementations are:

  • clsMDNSHost (= esp8266::experimental::clsLEAMDNSHost)
    new but partially compatible API
  • esp8266::MDNSImplementation::clsLEAMDNSHost_Legacy
    Wrapper on top of new API to provide current API (to be tested)

The new partially compatible API (MDNSResponder = clsMDNSHost) works with most of the simple examples (including OTA - @LaborEtArs I added clsLEAMDNSHost::enableArduino()).
Also mDNS_clock example is provided for both versions.

In its current state, Legacy LEAmDNS API is kept as default.

What has been verified:

  • Former LEAmDNS is enabled by default
  • New API works on both interfaces with the TwoInterfaces example
  • Simple sketches using mDNS work with the new API
    (I can't see an IPv6 address but there's an IPv6 answer):
+ wlp2s0 IPv6 arduino                                       _arduino._tcp        local
+ wlp2s0 IPv4 arduino                                       _arduino._tcp        local
= wlp2s0 IPv6 arduino                                       _arduino._tcp        local
   hostname = [OTA-LEDS.local]
   address = [10.0.1.112]
   port = [8266]
   txt = ["auth_upload=no" "board="ESP8266_WEMOS_D1MINIPRO"" "ssh_upload=no" "tcp_check=no"]
= wlp2s0 IPv4 arduino                                       _arduino._tcp        local
   hostname = [OTA-LEDS.local]
   address = [10.0.1.112]
   port = [8266]
   txt = ["auth_upload=no" "board="ESP8266_WEMOS_D1MINIPRO"" "ssh_upload=no" "tcp_check=no"]

What has to be doubled checked:

  • using MDNSResponder = esp8266::MDNSImplementation::clsLEAMDNSHost_Legacy; // LEAv2Compat

Current exploration:

  • A single instance shared on all interfaces as an option

@d-a-v d-a-v changed the title (WIP) LEAmDNS v2 LEAmDNS v2 (optional) May 23, 2020
@d-a-v d-a-v changed the title LEAmDNS v2 (optional) LEAmDNS v2 (optional) from @LaborEtArs May 23, 2020
@d-a-v
Copy link
Collaborator Author

d-a-v commented May 28, 2020

Closing in favor of #7335

@d-a-v d-a-v closed this Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants