v2.0.0 Add support for ESP32S2 and update ESP-IDF to 4.4 (#4996)

This is very much still work in progress and much more will change before the final 2.0.0

Some APIs have changed. New libraries have been added. LittleFS included.

Co-authored-by: Seon Rozenblum <seonr@3sprockets.com>
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
Co-authored-by: geeksville <kevinh@geeksville.com>
Co-authored-by: Mike Dunston <m_dunston@comcast.net>
Co-authored-by: Unexpected Maker <seon@unexpectedmaker.com>
Co-authored-by: Seon Rozenblum <seonr@3sprockets.com>
Co-authored-by: microDev <70126934+microDev1@users.noreply.github.com>
Co-authored-by: tobozo <tobozo@users.noreply.github.com>
Co-authored-by: bobobo1618 <bobobo1618@users.noreply.github.com>
Co-authored-by: lorol <lorolouis@gmail.com>
Co-authored-by: geeksville <kevinh@geeksville.com>
Co-authored-by: Limor "Ladyada" Fried <limor@ladyada.net>
Co-authored-by: Sweety <switi.mhaiske@espressif.com>
Co-authored-by: Loick MAHIEUX <loick111@gmail.com>
Co-authored-by: Larry Bernstone <lbernstone@gmail.com>
Co-authored-by: Valerii Koval <valeros@users.noreply.github.com>
Co-authored-by: 快乐的我531 <2302004040@qq.com>
Co-authored-by: chegewara <imperiaonline4@gmail.com>
Co-authored-by: Clemens Kirchgatterer <clemens@1541.org>
Co-authored-by: Aron Rubin <aronrubin@gmail.com>
Co-authored-by: Pete Lewis <601236+lewispg228@users.noreply.github.com>
This commit is contained in:
Me No Dev
2021-04-05 14:23:58 +03:00
committed by GitHub
parent 46d5afb17f
commit 5502879a5b
5209 changed files with 826360 additions and 322816 deletions

View File

@ -51,9 +51,9 @@ License (MIT license):
#define STR(tok) tok
#endif
static void _on_sys_event(system_event_t *event){
mdns_handle_system_event(NULL, event);
}
// static void _on_sys_event(arduino_event_t *event){
// mdns_handle_system_event(NULL, event);
// }
MDNSResponder::MDNSResponder() :results(NULL) {}
MDNSResponder::~MDNSResponder() {
@ -65,7 +65,7 @@ bool MDNSResponder::begin(const char* hostName){
log_e("Failed starting MDNS");
return false;
}
WiFi.onEvent(_on_sys_event);
//WiFi.onEvent(_on_sys_event);
_hostname = hostName;
_hostname.toLowerCase();
if(mdns_hostname_set(hostName)) {
@ -111,10 +111,10 @@ void MDNSResponder::disableArduino(){
}
}
void MDNSResponder::enableWorkstation(wifi_interface_t interface){
void MDNSResponder::enableWorkstation(esp_interface_t interface){
char winstance[21+_hostname.length()];
uint8_t mac[6];
esp_wifi_get_mac(interface, mac);
esp_wifi_get_mac((wifi_interface_t)interface, mac);
sprintf(winstance, "%s [%02x:%02x:%02x:%02x:%02x:%02x]", _hostname.c_str(), mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
if(mdns_service_add(NULL, "_workstation", "_tcp", 9, NULL, 0)) {
@ -173,7 +173,7 @@ bool MDNSResponder::addServiceTxt(char *name, char *proto, char *key, char *valu
}
IPAddress MDNSResponder::queryHost(char *host, uint32_t timeout){
struct ip4_addr addr;
esp_ip4_addr_t addr;
addr.addr = 0;
esp_err_t err = mdns_query_a(host, timeout, &addr);

View File

@ -84,7 +84,7 @@ public:
void enableArduino(uint16_t port=3232, bool auth=false);
void disableArduino();
void enableWorkstation(wifi_interface_t interface=WIFI_IF_STA);
void enableWorkstation(esp_interface_t interface=ESP_IF_WIFI_STA);
void disableWorkstation();
IPAddress queryHost(char *host, uint32_t timeout=2000);