Add SimpleMDNS, IGMP, and .local lookup (#2582)
* Enable LWIP IGMP, MDNS internal server * Enable MDNS lookup from LWIP DNS * Add SimpleMDNS responder, small code and no malloc * Ensure we copy out lwipopts in make-libpico Adds a small wrapper around the LWIP-provided MDNS responder application. Drop-in replacement in many basic cases for LEAmDNS. For FreeRTOS it is important to not allocate memory on an LWIP callback. LEAmDNS needs to do this to create response objects, leading to crashes. Increase LWIP timers by bumping the LWIP_ARP number (as done before). Replace ArduinoOTA LEAmDNS with SimpleMDNS and update a HTTPUpdateServer example.
This commit is contained in:
parent
c4b6521849
commit
f5c4136b94
39 changed files with 320 additions and 89 deletions
|
|
@ -235,7 +235,7 @@ Requirements
|
||||||
Implementation Overview
|
Implementation Overview
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Updates with a web browser are implemented using ``HTTPUpdateServer`` class together with ``WebServer`` and ``LEAmDNS`` classes. The following code is required to get it work:
|
Updates with a web browser are implemented using ``HTTPUpdateServer`` class together with ``WebServer`` and ``LEAmDNS`` or ``SimpleMDNS`` classes. The following code is required to get it work:
|
||||||
|
|
||||||
setup()
|
setup()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ Please note that WiFi on the Pico W is a work-in-progress and there are some imp
|
||||||
|
|
||||||
* FreeRTOS is supported only on core 0 and from within ``setup`` and ``loop``, not tasks, due to the requirement for a very different LWIP implementation. PRs always appreciated!
|
* FreeRTOS is supported only on core 0 and from within ``setup`` and ``loop``, not tasks, due to the requirement for a very different LWIP implementation. PRs always appreciated!
|
||||||
|
|
||||||
* LEAmDNS (``MDNS``) is not supported in FreeRTOS due to internal IRQ-time memory allocations.
|
* LEAmDNS (``MDNS``) is not supported in FreeRTOS due to internal IRQ-time memory allocations. Instead, use the SimpleMDNS library ( ``#include <SimpleMDNS.h>`` ) which has no such allocations.
|
||||||
|
|
||||||
The WiFi library borrows much work from the `ESP8266 Arduino Core <https://github.com/esp8266/Arduino>`__ , especially the ``WiFiClient`` and ``WiFiServer`` classes.
|
The WiFi library borrows much work from the `ESP8266 Arduino Core <https://github.com/esp8266/Arduino>`__ , especially the ``WiFiClient`` and ``WiFiServer`` classes.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,9 @@ extern unsigned long __lwip_rand(void);
|
||||||
#define MEM_SIZE (__LWIP_MEMMULT * 16384)
|
#define MEM_SIZE (__LWIP_MEMMULT * 16384)
|
||||||
#define MEMP_NUM_TCP_SEG (32)
|
#define MEMP_NUM_TCP_SEG (32)
|
||||||
#define MEMP_NUM_ARP_QUEUE (10)
|
#define MEMP_NUM_ARP_QUEUE (10)
|
||||||
|
//#define MEMP_NUM_SYS_TIMEOUT (LWIP_NUM_SYS_TIMEOUT_INTERNAL + 4)
|
||||||
#define PBUF_POOL_SIZE (__LWIP_MEMMULT > 1 ? 32 : 24)
|
#define PBUF_POOL_SIZE (__LWIP_MEMMULT > 1 ? 32 : 24)
|
||||||
#define LWIP_ARP 2
|
#define LWIP_ARP 5
|
||||||
#define LWIP_ETHERNET 1
|
#define LWIP_ETHERNET 1
|
||||||
#define LWIP_ICMP 1
|
#define LWIP_ICMP 1
|
||||||
#define LWIP_RAW 1
|
#define LWIP_RAW 1
|
||||||
|
|
@ -41,6 +42,7 @@ extern unsigned long __lwip_rand(void);
|
||||||
#define LWIP_NETIF_STATUS_CALLBACK 1
|
#define LWIP_NETIF_STATUS_CALLBACK 1
|
||||||
#define LWIP_NETIF_LINK_CALLBACK 1
|
#define LWIP_NETIF_LINK_CALLBACK 1
|
||||||
#define LWIP_NETIF_HOSTNAME 1
|
#define LWIP_NETIF_HOSTNAME 1
|
||||||
|
#define LWIP_NUM_NETIF_CLIENT_DATA 5
|
||||||
#define LWIP_NETCONN 0
|
#define LWIP_NETCONN 0
|
||||||
#define LWIP_STATS 0
|
#define LWIP_STATS 0
|
||||||
#define LWIP_STATS_DISPLAY 0
|
#define LWIP_STATS_DISPLAY 0
|
||||||
|
|
@ -54,17 +56,22 @@ extern unsigned long __lwip_rand(void);
|
||||||
#define LWIP_TCP 1
|
#define LWIP_TCP 1
|
||||||
#define LWIP_UDP 1
|
#define LWIP_UDP 1
|
||||||
#define LWIP_DNS 1
|
#define LWIP_DNS 1
|
||||||
|
#define LWIP_DNS_SUPPORT_MDNS_QUERIES 1
|
||||||
#define LWIP_TCP_KEEPALIVE 1
|
#define LWIP_TCP_KEEPALIVE 1
|
||||||
#define LWIP_NETIF_TX_SINGLE_PBUF 1
|
#define LWIP_NETIF_TX_SINGLE_PBUF 1
|
||||||
#define DHCP_DOES_ARP_CHECK 0
|
#define DHCP_DOES_ARP_CHECK 0
|
||||||
#define LWIP_DHCP_DOES_ACD_CHECK 0
|
#define LWIP_DHCP_DOES_ACD_CHECK 0
|
||||||
|
#define LWIP_IGMP 1
|
||||||
|
#define LWIP_MDNS_RESPONDER 1
|
||||||
|
#define MDNS_MAX_SERVICES 4
|
||||||
|
|
||||||
// See #1285
|
// See #1285
|
||||||
#define MEMP_NUM_UDP_PCB (__LWIP_MEMMULT * 6)
|
#define MEMP_NUM_UDP_PCB (__LWIP_MEMMULT * 7)
|
||||||
#define MEMP_NUM_TCP_PCB (__LWIP_MEMMULT * 5)
|
#define MEMP_NUM_TCP_PCB (__LWIP_MEMMULT * 5)
|
||||||
|
|
||||||
#if LWIP_IPV6
|
#if LWIP_IPV6
|
||||||
#define LWIP_IPV6_DHCP6 1
|
#define LWIP_IPV6_DHCP6 1
|
||||||
|
#define LWIP_IPV6_MLD 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// NTP
|
// NTP
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#include <LEAmDNS.h>
|
#include <SimpleMDNS.h>
|
||||||
#include <WiFiUdp.h>
|
#include <WiFiUdp.h>
|
||||||
#include <ArduinoOTA.h>
|
#include <ArduinoOTA.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#include <LEAmDNS.h>
|
#include <SimpleMDNS.h>
|
||||||
#include <WiFiUdp.h>
|
#include <WiFiUdp.h>
|
||||||
#include <ArduinoOTA.h>
|
#include <ArduinoOTA.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#include <LEAmDNS.h>
|
#include <SimpleMDNS.h>
|
||||||
#include <WiFiUdp.h>
|
#include <WiFiUdp.h>
|
||||||
#include <ArduinoOTA.h>
|
#include <ArduinoOTA.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,7 @@
|
||||||
|
|
||||||
#include <lwip/udp.h>
|
#include <lwip/udp.h>
|
||||||
#include <include/UdpContext.h>
|
#include <include/UdpContext.h>
|
||||||
|
#include <SimpleMDNS.h>
|
||||||
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_MDNS)
|
|
||||||
#include <LEAmDNS.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DEBUG_RP2040_CORE
|
#ifdef DEBUG_RP2040_CORE
|
||||||
#ifdef DEBUG_RP2040_PORT
|
#ifdef DEBUG_RP2040_PORT
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#include <WiFiClient.h>
|
#include <WiFiClient.h>
|
||||||
#include <WebServer.h>
|
#include <WebServer.h>
|
||||||
#include <LEAmDNS.h>
|
#include <SimpleMDNS.h>
|
||||||
#include <HTTPUpdateServer.h>
|
#include <HTTPUpdateServer.h>
|
||||||
|
|
||||||
#ifndef STASSID
|
#ifndef STASSID
|
||||||
|
|
|
||||||
|
|
@ -1348,3 +1348,8 @@ protected:
|
||||||
} // namespace esp8266
|
} // namespace esp8266
|
||||||
|
|
||||||
#include <ESP8266mDNS.h>
|
#include <ESP8266mDNS.h>
|
||||||
|
|
||||||
|
#define __LEAMDNS_H 1
|
||||||
|
#ifdef __SIMPLEMDNS_H
|
||||||
|
#error SimpleMDNS and LeaMDNS both included. Only one allowed at a time.
|
||||||
|
#endif
|
||||||
|
|
|
||||||
21
libraries/SimpleMDNS/README.md
Normal file
21
libraries/SimpleMDNS/README.md
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
# SimpleMDNS Library for Arduino-Pico
|
||||||
|
|
||||||
|
This library implements a very basic MDNS responder (xxx.local) for the
|
||||||
|
Pico to enable things like local name resolution and Arduino IDE OTA
|
||||||
|
connections. It uses the LWIP-provided simplified MDNS application.
|
||||||
|
|
||||||
|
Unlike LEAmDNS, this library only supports very simple configurations.
|
||||||
|
They should be sufficient for OTA and name resolution and simple web
|
||||||
|
servers, but for more complicated needs please use LEAmDNS.
|
||||||
|
|
||||||
|
The benefit of this simplicity is that it is low code and has no runtime
|
||||||
|
memory allocations. This means it can be run under FreeRTOS (which LEAmDNS
|
||||||
|
does not presently support).
|
||||||
|
|
||||||
|
This should be a drop-in replacement, just replace `#include <LEAmDNS.h>`
|
||||||
|
with `#include <SimpleMDNS.h>`.
|
||||||
|
|
||||||
|
Be sure to `MDNS.begin()` after enabling WiFi/Ethernet.begin().
|
||||||
|
|
||||||
|
-Earle F. Philhower, III
|
||||||
|
<earlephilhower@yahoo.com>
|
||||||
23
libraries/SimpleMDNS/keywords.txt
Normal file
23
libraries/SimpleMDNS/keywords.txt
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#######################################
|
||||||
|
# Syntax Coloring Map
|
||||||
|
#######################################
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Datatypes (KEYWORD1)
|
||||||
|
#######################################
|
||||||
|
|
||||||
|
SimpleMDNS KEYWORD1
|
||||||
|
MDNS KEYWORD1
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Methods and Functions (KEYWORD2)
|
||||||
|
#######################################
|
||||||
|
|
||||||
|
begin KEYWORD2
|
||||||
|
addService KEYWORD2
|
||||||
|
enableArduino KEYWORD2
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Constants (LITERAL1)
|
||||||
|
#######################################
|
||||||
|
|
||||||
10
libraries/SimpleMDNS/library.properties
Normal file
10
libraries/SimpleMDNS/library.properties
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
name=SimpleMDNS
|
||||||
|
version=1.0
|
||||||
|
author=Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||||
|
maintainer=Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||||
|
sentence=Creates a simple mDNS responder using LWIP features
|
||||||
|
paragraph=Creates a mDNS responder to ensure host domain uniqueness in local networks and to allow for mDNS service discovery and announcement.
|
||||||
|
category=Communication
|
||||||
|
url=https://github.com/earlephilhower/arduino-pico
|
||||||
|
architectures=rp2040
|
||||||
|
dot_a_linkage=true
|
||||||
96
libraries/SimpleMDNS/src/SimpleMDNS.cpp
Normal file
96
libraries/SimpleMDNS/src/SimpleMDNS.cpp
Normal file
|
|
@ -0,0 +1,96 @@
|
||||||
|
/*
|
||||||
|
SimpleMDNS for Rasperry Pi Pico
|
||||||
|
Implements a basic MDNS responder (xxx.local)
|
||||||
|
|
||||||
|
Copyright (c) 2024 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2.1 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <Arduino.h>
|
||||||
|
#include "SimpleMDNS.h"
|
||||||
|
#include <LwipEthernet.h>
|
||||||
|
#include <lwip/apps/mdns.h>
|
||||||
|
|
||||||
|
void SimpleMDNS::begin(const char *hostname, unsigned int ttl) {
|
||||||
|
if (_running) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mdns_resp_init();
|
||||||
|
struct netif *n = netif_list;
|
||||||
|
while (n) {
|
||||||
|
mdns_resp_add_netif(n, hostname);
|
||||||
|
n = n->next;
|
||||||
|
}
|
||||||
|
__setStateChangeCallback(_statusCB);
|
||||||
|
_hostname = strdup(hostname);
|
||||||
|
_running = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SimpleMDNS::enableArduino(unsigned int port, bool passwd) {
|
||||||
|
if (!_running) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
struct netif *n = netif_list;
|
||||||
|
while (n) {
|
||||||
|
mdns_resp_add_service(n, _hostname, "_arduino", DNSSD_PROTO_TCP, port, _arduinoGetTxt, (void *)passwd);
|
||||||
|
n = n->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SimpleMDNS::addService(const char *service, const char *proto, unsigned int port) {
|
||||||
|
if (!_running) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
char s[128];
|
||||||
|
snprintf(s, sizeof(s), "_%s", service);
|
||||||
|
s[sizeof(s) - 1] = 0;
|
||||||
|
struct netif *n = netif_list;
|
||||||
|
while (n) {
|
||||||
|
mdns_resp_add_service(n, _hostname, s, !strcasecmp("tcp", proto) ? DNSSD_PROTO_TCP : DNSSD_PROTO_UDP, port, _nullGetTxt, nullptr);
|
||||||
|
n = n->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SimpleMDNS::update() {
|
||||||
|
/* No-op */
|
||||||
|
}
|
||||||
|
|
||||||
|
void SimpleMDNS::end() {
|
||||||
|
/* No-op */
|
||||||
|
}
|
||||||
|
|
||||||
|
void SimpleMDNS::_statusCB(struct netif *netif) {
|
||||||
|
mdns_resp_netif_settings_changed(netif);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SimpleMDNS::_addServiceTxt(struct mdns_service *service, const char *str) {
|
||||||
|
mdns_resp_add_service_txtitem(service, str, strlen(str));
|
||||||
|
}
|
||||||
|
|
||||||
|
void SimpleMDNS::_arduinoGetTxt(struct mdns_service *service, void *txt_userdata) {
|
||||||
|
_addServiceTxt(service, "tcp_check=no");
|
||||||
|
_addServiceTxt(service, "ssh_upload=no");
|
||||||
|
_addServiceTxt(service, "board=" ARDUINO_VARIANT);
|
||||||
|
_addServiceTxt(service, (bool)txt_userdata ? "auth_upload=yes" : "auth_upload=no");
|
||||||
|
}
|
||||||
|
|
||||||
|
void SimpleMDNS::_nullGetTxt(struct mdns_service *service, void *txt_userdata) {
|
||||||
|
/* nop */
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *SimpleMDNS::_hostname = nullptr;
|
||||||
|
|
||||||
|
SimpleMDNS MDNS;
|
||||||
51
libraries/SimpleMDNS/src/SimpleMDNS.h
Normal file
51
libraries/SimpleMDNS/src/SimpleMDNS.h
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
/*
|
||||||
|
SimpleMDNS for Rasperry Pi Pico
|
||||||
|
Implements a basic MDNS responder (xxx.local)
|
||||||
|
|
||||||
|
Copyright (c) 2024 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2.1 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include <Arduino.h>
|
||||||
|
|
||||||
|
class SimpleMDNS {
|
||||||
|
|
||||||
|
public:
|
||||||
|
void begin(const char *hostname, unsigned int ttl = 60);
|
||||||
|
void enableArduino(unsigned int port, bool passwd = false);
|
||||||
|
void addService(const char *service, const char *proto, unsigned int port);
|
||||||
|
|
||||||
|
// No-ops here
|
||||||
|
void end();
|
||||||
|
void update();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static void _statusCB(struct netif *netif);
|
||||||
|
static void _addServiceTxt(struct mdns_service *service, const char *str);
|
||||||
|
static void _arduinoGetTxt(struct mdns_service *service, void *txt_userdata);
|
||||||
|
static void _nullGetTxt(struct mdns_service *service, void *txt_userdata);
|
||||||
|
|
||||||
|
bool _running = false;
|
||||||
|
static const char *_hostname;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern SimpleMDNS MDNS;
|
||||||
|
|
||||||
|
#define __SIMPLEMDNS_H 1
|
||||||
|
#ifdef __LEAMDNS_H
|
||||||
|
#error SimpleMDNS and LeaMDNS both included. Only one allowed at a time.
|
||||||
|
#endif
|
||||||
|
|
@ -229,3 +229,8 @@ void lwipPollingPeriod(int ms) {
|
||||||
_pollingPeriod = ms;
|
_pollingPeriod = ms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::function<void(struct netif *)> _scb;
|
||||||
|
void __setStateChangeCallback(std::function<void(struct netif *)> s) {
|
||||||
|
_scb = s;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,3 +44,6 @@ int hostByName(const char *aHostname, IPAddress &aResult, int timeout_ms = 5000)
|
||||||
|
|
||||||
// Set the LWIP polling time (default 50ms). Lower polling times == lower latency but higher CPU usage
|
// Set the LWIP polling time (default 50ms). Lower polling times == lower latency but higher CPU usage
|
||||||
void lwipPollingPeriod(int ms);
|
void lwipPollingPeriod(int ms);
|
||||||
|
|
||||||
|
// Sets the global netif state change callback
|
||||||
|
void __setStateChangeCallback(std::function<void(struct netif *)> s);
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,7 @@ protected:
|
||||||
static err_t linkoutput_s(netif* netif, struct pbuf* p);
|
static err_t linkoutput_s(netif* netif, struct pbuf* p);
|
||||||
static void netif_status_callback_s(netif* netif);
|
static void netif_status_callback_s(netif* netif);
|
||||||
static void _irq(void *param);
|
static void _irq(void *param);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// called on a regular basis or on interrupt
|
// called on a regular basis or on interrupt
|
||||||
err_t handlePackets();
|
err_t handlePackets();
|
||||||
|
|
@ -533,6 +534,7 @@ err_t LwipIntfDev<RawDev>::netif_init() {
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern std::function<void(struct netif *)> _scb;
|
||||||
template<class RawDev>
|
template<class RawDev>
|
||||||
void LwipIntfDev<RawDev>::netif_status_callback() {
|
void LwipIntfDev<RawDev>::netif_status_callback() {
|
||||||
check_route();
|
check_route();
|
||||||
|
|
@ -540,6 +542,9 @@ void LwipIntfDev<RawDev>::netif_status_callback() {
|
||||||
sntp_stop();
|
sntp_stop();
|
||||||
sntp_init();
|
sntp_init();
|
||||||
}
|
}
|
||||||
|
if (_scb) {
|
||||||
|
_scb(&_netif);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class RawDev>
|
template<class RawDev>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ for dir in ./cores/rp2040 ./libraries/EEPROM ./libraries/I2S ./libraries/SingleF
|
||||||
./libraries/SPISlave ./libraries/lwIP_ESPHost ./libraries/FatFS\
|
./libraries/SPISlave ./libraries/lwIP_ESPHost ./libraries/FatFS\
|
||||||
./libraries/FatFSUSB ./libraries/BluetoothAudio ./libraries/BluetoothHCI \
|
./libraries/FatFSUSB ./libraries/BluetoothAudio ./libraries/BluetoothHCI \
|
||||||
./libraries/BluetoothHIDMaster ./libraries/NetBIOS ./libraries/Ticker \
|
./libraries/BluetoothHIDMaster ./libraries/NetBIOS ./libraries/Ticker \
|
||||||
./libraries/VFS ./libraries/rp2350; do
|
./libraries/VFS ./libraries/rp2350 ./libraries/SimpleMDNS; do
|
||||||
find $dir -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" \) -a \! -path '*api*' -exec astyle --suffix=none --options=./tests/astyle_core.conf \{\} \;
|
find $dir -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" \) -a \! -path '*api*' -exec astyle --suffix=none --options=./tests/astyle_core.conf \{\} \;
|
||||||
find $dir -type f -name "*.ino" -exec astyle --suffix=none --options=./tests/astyle_examples.conf \{\} \;
|
find $dir -type f -name "*.ino" -exec astyle --suffix=none --options=./tests/astyle_examples.conf \{\} \;
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -232,6 +232,7 @@ set(picow_link_libraries
|
||||||
pico_lwip
|
pico_lwip
|
||||||
pico_lwip_nosys
|
pico_lwip_nosys
|
||||||
pico_lwip_sntp
|
pico_lwip_sntp
|
||||||
|
pico_lwip_mdns
|
||||||
pico_stdlib
|
pico_stdlib
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -332,4 +333,5 @@ add_custom_command(TARGET pico-${cpu} POST_BUILD
|
||||||
COMMAND sed 's/include.*pico-sdk/include \"..\\/..\\/pico-sdk/' ./generated/pico_base/pico/config_autogen.h > ../../../include/${cpu}/pico_base/pico/config_autogen.h
|
COMMAND sed 's/include.*pico-sdk/include \"..\\/..\\/pico-sdk/' ./generated/pico_base/pico/config_autogen.h > ../../../include/${cpu}/pico_base/pico/config_autogen.h
|
||||||
COMMAND cp ../tusb_config.h ../../../include/${cpu}/.
|
COMMAND cp ../tusb_config.h ../../../include/${cpu}/.
|
||||||
COMMAND cp ../btstack_config.h ../../../include/${cpu}/.
|
COMMAND cp ../btstack_config.h ../../../include/${cpu}/.
|
||||||
|
COMMAND cp ../lwipopts.h ../../../include/.
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ extern unsigned long __lwip_rand(void);
|
||||||
#define MEMP_NUM_TCP_SEG (32)
|
#define MEMP_NUM_TCP_SEG (32)
|
||||||
#define MEMP_NUM_ARP_QUEUE (10)
|
#define MEMP_NUM_ARP_QUEUE (10)
|
||||||
#define PBUF_POOL_SIZE (__LWIP_MEMMULT > 1 ? 32 : 24)
|
#define PBUF_POOL_SIZE (__LWIP_MEMMULT > 1 ? 32 : 24)
|
||||||
#define LWIP_ARP 2
|
#define LWIP_ARP 5
|
||||||
#define LWIP_ETHERNET 1
|
#define LWIP_ETHERNET 1
|
||||||
#define LWIP_ICMP 1
|
#define LWIP_ICMP 1
|
||||||
#define LWIP_RAW 1
|
#define LWIP_RAW 1
|
||||||
|
|
@ -41,6 +41,7 @@ extern unsigned long __lwip_rand(void);
|
||||||
#define LWIP_NETIF_STATUS_CALLBACK 1
|
#define LWIP_NETIF_STATUS_CALLBACK 1
|
||||||
#define LWIP_NETIF_LINK_CALLBACK 1
|
#define LWIP_NETIF_LINK_CALLBACK 1
|
||||||
#define LWIP_NETIF_HOSTNAME 1
|
#define LWIP_NETIF_HOSTNAME 1
|
||||||
|
#define LWIP_NUM_NETIF_CLIENT_DATA 5
|
||||||
#define LWIP_NETCONN 0
|
#define LWIP_NETCONN 0
|
||||||
#define LWIP_STATS 0
|
#define LWIP_STATS 0
|
||||||
#define LWIP_STATS_DISPLAY 0
|
#define LWIP_STATS_DISPLAY 0
|
||||||
|
|
@ -54,17 +55,22 @@ extern unsigned long __lwip_rand(void);
|
||||||
#define LWIP_TCP 1
|
#define LWIP_TCP 1
|
||||||
#define LWIP_UDP 1
|
#define LWIP_UDP 1
|
||||||
#define LWIP_DNS 1
|
#define LWIP_DNS 1
|
||||||
|
#define LWIP_DNS_SUPPORT_MDNS_QUERIES 1
|
||||||
#define LWIP_TCP_KEEPALIVE 1
|
#define LWIP_TCP_KEEPALIVE 1
|
||||||
#define LWIP_NETIF_TX_SINGLE_PBUF 1
|
#define LWIP_NETIF_TX_SINGLE_PBUF 1
|
||||||
#define DHCP_DOES_ARP_CHECK 0
|
#define DHCP_DOES_ARP_CHECK 0
|
||||||
#define LWIP_DHCP_DOES_ACD_CHECK 0
|
#define LWIP_DHCP_DOES_ACD_CHECK 0
|
||||||
|
#define LWIP_IGMP 1
|
||||||
|
#define LWIP_MDNS_RESPONDER 1
|
||||||
|
#define MDNS_MAX_SERVICES 4
|
||||||
|
|
||||||
// See #1285
|
// See #1285
|
||||||
#define MEMP_NUM_UDP_PCB (__LWIP_MEMMULT * 6)
|
#define MEMP_NUM_UDP_PCB (__LWIP_MEMMULT * 7)
|
||||||
#define MEMP_NUM_TCP_PCB (__LWIP_MEMMULT * 5)
|
#define MEMP_NUM_TCP_PCB (__LWIP_MEMMULT * 5)
|
||||||
|
|
||||||
#if LWIP_IPV6
|
#if LWIP_IPV6
|
||||||
#define LWIP_IPV6_DHCP6 1
|
#define LWIP_IPV6_DHCP6 1
|
||||||
|
#define LWIP_IPV6_MLD 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// NTP
|
// NTP
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue