arduino-libraries / WiFiNINA

136 stars 105 forks source link

added server.accept() #257

Open JAndrassy opened 9 months ago

JAndrassy commented 9 months ago

The first PR for server.accept was destroyed by GitHub Sync function, when I today attempted to sync the old branch for server.accept() with current master to get the current version of api.md. Sorry. This one is based on current master branch.

Note that https://github.com/arduino-libraries/WiFiNINA/pull/204 already received approval from multiple project maintainers.


server.accept() depends on nina-fw PR https://github.com/arduino/nina-fw/pull/79 (merged)

This PR adds server.accept() function as documented for the Ethernet library:

https://www.arduino.cc/en/Reference/EthernetServerAccept

If server.accept() is used with older firmware it will behave as available(), because the accept parameter in SPI request will be ignored.

The PR contains the accept() example "WiFiAdvancedChatServer" ported from Ethernet library.

Documentation in api.md was adopted from Ethernet library documentation.

overview of Server implementations in libraries https://github.com/JAndrassy/Arduino-Networking-API/blob/main/ArduinoNetAPILibs.md#server-class

github-actions[bot] commented 9 months ago

Memory usage change @ 97c4d9411624d5b58b625406d8f5e388443034d4

Board flash % RAM for global variables %
arduino:mbed_nano:nanorp2040connect :small_red_triangle: 0 - +12 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018:mode=on :small_red_triangle: 0 - +8 0.0 - +0.02 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 :small_red_triangle: 0 - +12 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 :small_red_triangle: 0 - +12 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot :small_red_triangle: 0 - +12 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table Board|`examples/AP_SimpleWebServer`
flash|%|`examples/AP_SimpleWebServer`
RAM for global variables|%|`examples/ConnectNoEncryption`
flash|%|`examples/ConnectNoEncryption`
RAM for global variables|%|`examples/ConnectWithWEP`
flash|%|`examples/ConnectWithWEP`
RAM for global variables|%|`examples/ConnectWithWPA`
flash|%|`examples/ConnectWithWPA`
RAM for global variables|%|`examples/ConnectWithWPA2Enterprise`
flash|%|`examples/ConnectWithWPA2Enterprise`
RAM for global variables|%|`examples/ScanNetworks`
flash|%|`examples/ScanNetworks`
RAM for global variables|%|`examples/ScanNetworksAdvanced`
flash|%|`examples/ScanNetworksAdvanced`
RAM for global variables|%|`examples/SimpleWebServerWiFi`
flash|%|`examples/SimpleWebServerWiFi`
RAM for global variables|%|`examples/Tools/CheckFirmwareVersion`
flash|%|`examples/Tools/CheckFirmwareVersion`
RAM for global variables|%|`examples/Tools/FirmwareUpdater`
flash|%|`examples/Tools/FirmwareUpdater`
RAM for global variables|%|`examples/Tools/SerialNINAPassthrough`
flash|%|`examples/Tools/SerialNINAPassthrough`
RAM for global variables|%|`examples/WiFiAdvancedChatServer`
flash|%|`examples/WiFiAdvancedChatServer`
RAM for global variables|%|`examples/WiFiChatServer`
flash|%|`examples/WiFiChatServer`
RAM for global variables|%|`examples/WiFiPing`
flash|%|`examples/WiFiPing`
RAM for global variables|%|`examples/WiFiSSLClient`
flash|%|`examples/WiFiSSLClient`
RAM for global variables|%|`examples/WiFiStorage`
flash|%|`examples/WiFiStorage`
RAM for global variables|%|`examples/WiFiUdpNtpClient`
flash|%|`examples/WiFiUdpNtpClient`
RAM for global variables|%|`examples/WiFiUdpSendReceiveString`
flash|%|`examples/WiFiUdpSendReceiveString`
RAM for global variables|%|`examples/WiFiWebClient`
flash|%|`examples/WiFiWebClient`
RAM for global variables|%|`examples/WiFiWebClientRepeating`
flash|%|`examples/WiFiWebClientRepeating`
RAM for global variables|%|`examples/WiFiWebServer`
flash|%|`examples/WiFiWebServer`
RAM for global variables|% -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|- `arduino:mbed_nano:nanorp2040connect`|12|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|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.0|0|0.0|12|0.0|0|0.0 `arduino:samd:nano_33_iot`|12|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|12|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|N/A|N/A|N/A|N/A|12|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|12|0.0|0|0.0
Click for full report CSV ``` Board,examples/AP_SimpleWebServer
flash,%,examples/AP_SimpleWebServer
RAM for global variables,%,examples/ConnectNoEncryption
flash,%,examples/ConnectNoEncryption
RAM for global variables,%,examples/ConnectWithWEP
flash,%,examples/ConnectWithWEP
RAM for global variables,%,examples/ConnectWithWPA
flash,%,examples/ConnectWithWPA
RAM for global variables,%,examples/ConnectWithWPA2Enterprise
flash,%,examples/ConnectWithWPA2Enterprise
RAM for global variables,%,examples/ScanNetworks
flash,%,examples/ScanNetworks
RAM for global variables,%,examples/ScanNetworksAdvanced
flash,%,examples/ScanNetworksAdvanced
RAM for global variables,%,examples/SimpleWebServerWiFi
flash,%,examples/SimpleWebServerWiFi
RAM for global variables,%,examples/Tools/CheckFirmwareVersion
flash,%,examples/Tools/CheckFirmwareVersion
RAM for global variables,%,examples/Tools/FirmwareUpdater
flash,%,examples/Tools/FirmwareUpdater
RAM for global variables,%,examples/Tools/SerialNINAPassthrough
flash,%,examples/Tools/SerialNINAPassthrough
RAM for global variables,%,examples/WiFiAdvancedChatServer
flash,%,examples/WiFiAdvancedChatServer
RAM for global variables,%,examples/WiFiChatServer
flash,%,examples/WiFiChatServer
RAM for global variables,%,examples/WiFiPing
flash,%,examples/WiFiPing
RAM for global variables,%,examples/WiFiSSLClient
flash,%,examples/WiFiSSLClient
RAM for global variables,%,examples/WiFiStorage
flash,%,examples/WiFiStorage
RAM for global variables,%,examples/WiFiUdpNtpClient
flash,%,examples/WiFiUdpNtpClient
RAM for global variables,%,examples/WiFiUdpSendReceiveString
flash,%,examples/WiFiUdpSendReceiveString
RAM for global variables,%,examples/WiFiWebClient
flash,%,examples/WiFiWebClient
RAM for global variables,%,examples/WiFiWebClientRepeating
flash,%,examples/WiFiWebClientRepeating
RAM for global variables,%,examples/WiFiWebServer
flash,%,examples/WiFiWebServer
RAM for global variables,% arduino:mbed_nano:nanorp2040connect,12,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,12,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,N/A,N/A,N/A,N/A,12,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,12,0.0,0,0.0 arduino:megaavr:uno2018:mode=on,6,0.01,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,6,0.01,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,N/A,N/A,N/A,N/A,8,0.02,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,8,0.02,0,0.0 arduino:samd:mkrvidor4000,12,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,12,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,N/A,N/A,N/A,N/A,12,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0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