* Handle possible failure of mdns_resp_add_service
* One more place where mdns_resp_add_service may fail
* addServiceImpl should always store services
* Register in services when new netif is added
* Refactored handling of cached services.
---------
Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
* mDNS: Fix build against LwIP 2.2.0
* Stop defining ip_addr_t when !CONFIG_IPV6
The only reason we had to do this is because we forgot to define LWIP_IPV4,
which is fixed in our LwIP port now, but keep it around for !CONFIG_IPV6
for now for builds against older LwIP.
* Allow returning IPv6 results from WiFiClass::hostByName()
* Add ipv6 and extra mDNS files for LwIP 2.2.0
* Add IPv6 support to BK72xx WifiSTA
Add an allLocalIPv6() method to return a *vector* of addresses, rather
than just one. It's not clear where the enableIpV6() and localIPv6()
methods came from; they don't seem to be part of the standard Arduino
class.
Eventually at least for ESPHome, I'd like to stop using these classes
and just let the ESPHome wifi component talk directly to LwIP. Or maybe
LibreTiny should offer an API compatible with the esp-idf one which is
a light wrapper around LwIP.
But short of a major refactor, this seems like a reasonable option.
* Update LwIP default to 2.2.0
* Apply suggestions from code review
---------
Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
According to guide `gpio_stay_*_map` are specifically there to prevent
pulling pins to a specific level and let them float during deep sleep.
https://docs.bekencorp.com/sdk_3.0.x/bk7238/build/en/latest/developer-guide/power_save/sleep_test.html
This allows any external low-power circuitry to change a pin level, as
required, to trigger the wake up
This requires changes in BDK and was implemented via fixup. Also, exposed
`gpio_stay_lo_map` parameter via `lt_deep_sleep_keep_floating_gpio` to
manage this configuration for pins in range P0-P31.
* Fixed unsafe conversion to underscore string
* Fixed formatting
* Save one byte if underscore not needed
* Don't allocate new string if already underscored
* Fix missing first character while copying
* Renamed function and made it inline
* Don't use signed index variable when searching for service
* Add proper cleanup of LwIPmDNS
- Free allocated memory both on end() and in the destructor
- Unregister callback from netif
* Don't free const pointer
* Removed unneeded casting
* Don't break the loop if failed to add txt record
* Fixed code formatting
* Free list returned by wlan_sta_scan_result()
* scanAlloc improvements
There were a few things I didn't like about this function:
1) realloc() was called a bit too often.
2) if realloc() failed, the previous memory was not freed.
3) scanAlloc returned previous count or 255 on error. But there was no real check for error and 255 could've been used as index to null. I think it's better to simple return boolean.
4) scanAlloc was clearing memory only up to (and excluding) the new entries.
* Corrected clearing new entries in scanAlloc
* scanAlloc() now returns number of allocated items
* Fixed compilation issues related to goto.
* Initial support code for Deep Sleep
* Global functions
* Remove unnecessary override
* clang-format
* Support for multiple pins
* Fix math
* Add a way to unset GPIOs
* Clang format
* Update brief
---------
Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>