There are actually several instances where we pass in read-only
parameters as pass-by-value, where in the case of String() that
is inefficient as it involves copy-constructor/temp string creations.
We can avoid that, similarly to single character string concatenations
done via string literals instead of char literals.
* mDNS debug option + AP address is used by default when STA is also present
* mDNS: store network interface, checking it is up
* igmp: force on selected interface (avoid crash *sometimes*)
* fix for all lwip2 ipv4 ipv6 & lwip1
* mdns: IPAddress is not needed to reference associated interface
* mdns: debug: fix print warnings
* emulation: add ets_strncpy
* emulation: truly emulate AddrList (remove fake one)
Default interface is STA (or AP if available and STA is unavailable).
An interface can also be specified in ::begin() by its IP address.
MDNS will not cross interfaces (there is currently no notion of "bridged interfaces")
Multiple instances should be working, this is not tested in this commit.
* std::bind has issues with type inference, use lambdas whereever possible.
* Fix indentation.
* More descriptive placeholder name in lambda expression
* Use formal argument names for remaining currying placeholders
* polledTimeout: add option to use CPU count instead of millis()
* use more "using" alias
* more c++/clear code, using typename (thanks @devyte)
* rename class name to include unit, introduce timeMax() and check it with assert()
* remove useless defines
* improve api readability, add micro-second unit
* update example
* mock: emulate getCycleCount, add/fix polledTimeout CI test
* + nano-seconds, assert -> message, comments, host test
* allow 0 for timeout (enables immediate timeout, fix division by 0)
* typo, set member instead of local variable
* unify error message
* slight change on checkExpired() allows "never expired"
also removed printed message, add YieldAndDelay, simplify calculations
* remove traces of debug.h/cpp in this PR
* include missing <limits> header
* back to original expired test, introduce boolean _neverExpires, fix reset(), getTimeout() is invalid
* fix expiredOneShot with _timeout==0 check
* reenable getTimeout()
* expose checkExpired with unit conversion
* fix timing comments, move critical code to iram
* add member ::neverExpires and use it where relevant
* improve clarity
* remove exposed checkExpired(), adapt LEAmDNS with equivalent
* add API ::resetToNeverExpires(), use it in LEAmDNS
* remove offending constness from ::flagged() LEAmDNS (due do API fix in PolledTimeout)
* simplify "Fast" base classes
* minor variable rename
* Fix examples
* compliance with good c++ manners
* minor changes for consistency
* add missing const
* expired() and bool() moved to iram
* constexpr compensation computing
* add/update comments
* move neverExpires and alwaysExpired
OTA is broken in AP mode because ESP8266mDNS is checking whether the station is connected before processing. Change the logic to WiFi.isConnected() OR WiFi.softAPgetStationNum()>0 fixes the issue.
- Better separation of ESP wifi thread code from user thread code
- Added a flag for 'update()'-less use (disabled by default)
- The too fast updates for service queries are fixed
- Switched fully to PolledTimeout; LEATimeFlag not needed anymore (BTW: a const 'expired()' method would be helpful)
- The device should stay visible now even after the first TTL timeout
- Improved service querying (queries five times now)
- Fixed TTL (bug introduced with Fixes 1.0)
* Fixes 1.1
- Better separation of ESP wifi thread code from user thread code
- Added a flag for 'update()'-less use (disabled by default)
- The too fast updates for service queries are fixed
- Switched fully to PolledTimeout; LEATimeFlag not needed anymore (BTW: a const 'expired()' method would be helpful)
- The device should stay visible now even after the first TTL timeout
- Improved service querying (queries five times now)
* Update mDNS_Clock.ino
Removed references to LEATimeFlag.h
* Update mDNS_Clock.ino
Styling
The bug referenced in the code that required a custom macro to enable
PSTR/PROGMEM compilation ( https://github.com/esp8266/Arduino/issues/3369 )
was fixed a while back and all PROGMEM references now live in their own
save .sections.
This patch simply is the output of `sed -i s/PSTR_LEA/PSTR/g *` and
`sed -i s/PROGMEM_LEA/PROGMEM/g *` on the codebase and the removal
of those defines.
* LEAmDNS Responder (II)
Created a new branch to solve commit conflicts with recent changes to ESP8266mDNSResponder.cpp by d-a-v.
* Removed millis() roll-over issues
* fix LEA-mDNS
* astyle on lea-mdns examples
* add compatibility with lwIP-v1
* ditto
* use strncasecmp instead of lwip's strnicmp from lwIP-v2 (thanks @devyte)
* ditto
* fixes
* Update mDNS_Clock.ino
unindent
* Update mDNS_ServiceMonitor.ino
unindent
* Update LEAmDNS.h
Add setInstanceName() forwarder for compat
* Disable DEBUG_ESP_MDNS_RESPONDER by default
* [Fixed] Debug output line
DEBUG_OUTPUT needs to go inside DEBUG_EX_ function otherwise throw error if DEBUG_ESP_MDNS_RESPONDER is not defined
* WIP compile examples on host with 'make examples'
* WIP bufferize tcp input
* WIP Makefile
* WIP network to rework, tcp/udp to factorize, udp addresses broken
* minor changes to the core
* WIP basic udp working
* WIP mdns
* WIP mcast receiving, not sending
* WIP mdns OK
* beta version
* SSL + doc
* update travis host test command
* licenses
* typo
* doc: arduino builder is not around: declare functions before calling them
* fix with latest SSL PR, compile in 32 bits mode
* fix make clean
* make -m32 optional
* 32bits compiler ability tester
* WIP
* WIP (fix 1 vtable error, still another one to hunt with using spiffs)
* example astyle
* fix os_printf_plus
* load / save mock spiffs
* fix style
* fix using spiffs/mock
* don't mess ram
* update doc
* remove leftover
* optimization -Os except for CI, rename ARCH32 to FORCE32
* revert useless cast (not even compiled)
* remove unused function
* use proper type for pointer arithmetics
* makefile: sketch object and cpp file moved to bin/ directories
easier to clean, and IDE don't like them
* changes for review
* make use of %zd
* less verbose makefile by default (option)
* update readme
- When the "_services._dns_sd._udp.local" meta-query is received, an
enumeration of services types is now returned (e.g. "_http._tcp.local")
instead of an enumeration of instances (e.g.
"MyService._http._tcp.local"). This is consistent with Section 9 of the
RFC.
- When a response is sent, the response records are now properly
partitioned as either answers or additional records. Only response
records that were explicitly requested as a result of the questions
should be treated as answers. This is consistent with Section 12 of the
RFC.
- The "MDNSResponder::advertiseServices()" method has been removed as it
was declared as "private" and is no longer being called. This method
was sending a response on multiple interfaces when available, but this
wasn't really necessary since the interface from which the request was
received that caused it to be invoked is known.
MDNSResponder::advertiseServices() was transmitting all service adverts
on the same interface (AP) rather than once on STA and once on AP. Fix
this simple mistake.
With this change, both "ping esp8266.local" and "avahi-browse -a" see
the ESP8266 from a test Linux PC, on both AP and STA interfaces (where
applicable), with the ESP8266 running mDNS_Web_Server.ino modified for
each of AP-only, STA-only and AP+STA modes.
Note that no attempt has been made to make MDNSResponder::queryService()
operate correctly with multiple interfaces, either in this commit or the
commit this commit fixes.
Fixes: a546d64e07d2 ("ESP8266mDNS: support AP and STA interfaces at once")
Fixes#3101
* Suppressed -Wunused-parameter and -Wunused-function by casting to void unused identifiers.
* Explicit initialization of all fields to suppress -Wmissing-field-initializers.
* Fixed signed/unsigned integer comparison.
* memset initialization of structs.
* More -Wunused-parameter fixes.