Stop CI from pulling LLVM repos and using GNUPG keyservers,
ubuntu-latest already has clang-format-{13,14,15}
Fixes long-standing issue with -style=file:...
https://tls.mbed.org/ host does not support MFLN and Also Redirects the Client.
https://api.my-ip.io/ip is a better alternative, supporting MFLN and allowing the user to get a simple text with a useful information.
* Add support WiFiClientSecure TCP KeepAlive
* Make TCP keepalive and related functions virtual.
* Make TCP keepalive and related functions override.
Fixes#8939
* httpclient: use refs - httpserver: add chunks in examples
* basic https client: update cert
* debug log: read() returning -1 is usual and means "nothing to read"
* emulation on host: SSL server has never been and is now working
* style
* move SSL server certs from examples into a single place with appropriate warnings
* web-hello-servers: make chunks bigger
* factorize template declaration
* http-client: add getString(pre-reservation)
* mock: add umm_info()
* style
* comment API in example
* style
* fix per review
* Upcoming EspSoftwareSerial 7.0.1
* EspSoftwareSerial example: higher bitrates due to forcing half-duplex
* Adapt to SoftwareSerial's latest use of namespace.
* In EspSoftwareSerial, some renaming after review feedback.
* EspSoftwareSerial's use of a template class in order to permit users their own GPIO capabilities definitions.
* CI caught some warning.
* Stick to non-namespace EspSoftwareSerial class name for the moment.
* Delegate operator() is now nullptr-safe, good for use in ISRs.
* Pushed EspSoftwareSerial 8.0.1: Platformio picks up versions that aren't published in Github
Recurrent scheduled functions will always be running in background.
esp_delay()'s interval (intvl_ms) is internally kept to its highest value allowing to honor recurrent scheduled functions requirements.
It transparently allows to keep with the arduino and nonos-sdk trivial programming way and still use background services or drivers running regularly.
Remove nonos-sdk-v2.2.0-28-g89920dc aka 3v0, since we have a real v3
Remove 3.0.0...3.0.4 to reduce overhead in maintaining a bunch or binary patches
Update our docs and menu opts to mention 'experimental' status
Old versions still remains in git history, so anyone wanting to play around with 3.0.x could still make use of that work
* Don't return `true` with WiFiClientSecureBearSSL::connected() when disconnected
Apply the same condition as with normal WiFiClient - we are not connected
when it's not possible to both write and read.
Implement separate methods for actual connection status and the internal
ssl engine status and update methods that were previously using available()
for this purpose
Update examples to check available() when the intent is to only read the
data and not interact with the client in any other way. Also, use connect()
as a way to notify errors, no need to check things twice
Api for saving heap when Client class is used by a Server (WiFiServer class): Client = Server.available().
Suppose the local end is the server and the remote end is the client, we will deal with heap memory at the local end.
When the local application (server) decides to close an active connection with a remote end it issues an Client.stop.
The stop() function calls the close() function of ClientContext class which in turn calls tcp_close.
The connexion is closed by tcp_close and the protocol control block (pcb) can be put in the following states depending on the requests sent by the remote: CLOSING, FIN_WAIT_1 and FIN_WAIT_2. In theses states pcbs are not freed, then consume some memory heap.
If an acknowledgment from the remote end is received, the pcb enter in TIME_WAIT state for some minutes but pcbs in TIME_WAIT state are not freed. Then consume some heap memory.
TIME_WAIT pcbs are automatically freed after some minutes or can be freed for instance issuing an tcp_kill_timewait()
in the local application which will free the oldest pcb in TIME_WAIT state.
If the connection is first closed from the remote end (the client), the local end (server) receive a connection termination request. It then acknowledge it and enter in CLOSE_WAIT state waiting for a connection termination request from the local application.
It then send a termination request and enter in LAST_ACK state until it receive an acknowledgment from the remote end.
After receiving the acknowledgment it enter in ClOSED state and the local pcb is freed leaving some room in the heap memory.
To summarize, when a connexion termination request is send by one end (remote or local), the local pcb is not freed immediatly.
This pcb can be in the following states: FIN_WAIT_1, FIN_WAIT_2, CLOSING, TIME_WAIT, CLOSE_WAIT, LAST_ACK.
As a consequence, some old pcbs from old closed connections are still consuming heap memory.
The local application can call tcp_kill_timewait hoping it will free some TIME_WAIT state pcbs. But if the server receive frequent connections requests and close them after sending whatever it has to send, there may be zero pcbs in TIME_WAIT state among all previously closed connections.
In case of insufficient memory to accept a new connection, lwip has developped a strategy: it successively tries to kill the oldest pcb in TIME_WAIT state, or in LAST_ACK state or in CLOSING state or the oldest active connection with lower priority than the new one.
As a matter of fact this "urgent" strategy is deployed only when very few heap memory remain available (less than some kb). In case of success, Client.available returns a valid Client but the local application will crash when sending or receiving data from the client (Client.read ou readuntil or available) because this need more heap memory and just some kb were freed in lwip to allocate the new pcb structure ans start the new connection.
The propose API is intended to avoid this drawback by calling the abort function of ClientContext which in turn calls tcp_abort which calls tcp_abandon. The connection is aborted and notified to the client with a RESET and the pcb and ressources associated are immediately released increasing the available heap memory.
The NONOS SDK's `struct bss_info` in `user_interface.h` has grown since the
beginning of this project. The additional elements are not accessible.
Add a method for R/O access to full `struct bss_info`.
See #7965 (comment)
Amends #8507
I took the liberty to also do some refactoring; specifically, fixing signed vs. unsigned mismatch in len, using pointer object vs. the original manual malloc & free, try to have named constants for certain addresses and lengths, plus localize printing of u8 arrays.
The suggested test to have a 'dummy' verifier works just fine. (...how it actually works and gets the hash to compare with is a whole other question, though)
Another issue noticed while testing, in the underlying bearssl api there's an actual limit for hash length.
6105635531/inc/bearssl_rsa.h (L257)
* Fix sending NACK, use helper function to fill pbuf
As noticed in https://github.com/esp8266/Arduino/pull/8582#issuecomment-1153331408
Plus, handle the case when `pbuf->len` is less than struct size
* Make sure to call SDK functions to start and stop DHCP server
As noticed in https://github.com/esp8266/Arduino/pull/8582#issuecomment-1153331408
Can't really use `server.begin()` and `server.end()` directly, only
default static IP is applied to the interface since DHCP server is
deemed 'running' (see `wifi_softap_dhcps_status()` return value)
* s
Co-authored-by: david gauchard <gauchard@laas.fr>
* works
* fixup! works
* back to callbacks
* names
* daisy chain
* seconds
* less inline
* fix dns setter
* might as well keep using initlist
/to d-a-v it has automatic storage, here it's the same stack based one
(just one less line for us)
* shift blame
* naming
* fix impl
* revert to ip4 dns
* merge fix
* restyle
* masking done wrong
* Initialize SoftAP DhcpServer object on demand
Remove dependency on global ctor, and just construct the object when
someone asks us to do it. Only dependency right now is netif_git, which
is expected to be initialized by the lwip code some time before
dhcps_start happens.
Removing ip_info from begin(), since we never reference later on.
Also removing the specific check for netif id and simplify the ctors.
Update tests and recover old nonos-sdk dhcps functions that were not implemented.
* nonos helpers have a separate header
* wifi ap needs this anyway, simplify sketch includes
* missing example
* existing name :/
* trying to fix header dependency
* restyle
* not a c header
* no need to init
* move dhcp server getter to WiFi
more... arduino'ish? we ahve object as namespace, plus everything else
related to softAP is there
redundant includes, redundant mock impl (out-of-scope here to fix)
* ...move things back, still expose as WiFi method
* review fix
* include -nonos header in wifi lib though
* no more lwip include
* style
* need mock dhcpserver instance
* Define lwIP's s32/u32 to int
s32/u32 were previously defined as long,
but long can be 64 bits in host mode,
so this commit reduces valgrind complaints and increase coherency.
* some lads like to use `unsigned long` for 32 bits IPv4 addresses
* fix lwIP's `sys_now()` return type
* fix C declarations
* merge upstream (lwip2) update on sys_now() definition
* matching lwIP api (2/2)
Co-authored-by: Max Prokhorov <prokhorov.max@outlook.com>
* WiFiServer - 'rename' available() to accept()
* use server.accept() instead of available()
* WiFiServer.accept() and ArduinoWiFiServer class doc update