Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ethernet.setHostname added (hostname to send with DHCP request) #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JAndrassy
Copy link
Contributor

@JAndrassy JAndrassy commented Oct 7, 2023

There is already a PR for setHostname to set the hostname sent with the DHCP request and some older PR which don't use the setHostname() setter.

I provide my approach which doesn't store the hostname internally to save memory. I added the same code to my EthernetENC library. If setHostname is not used from the sketch the old code with the default hostname is executed.

overview of WiFi/Ethernet getters and setters:
https://github.com/JAndrassy/Arduino-Networking-API/blob/main/ArduinoNetAPILibs.md#network-interface-getters-and-setters

@github-actions
Copy link

github-actions bot commented Oct 7, 2023

Memory usage change @ 294063e

Board flash % RAM for global variables %
arduino:avr:leonardo ❔ -98 - +646 -0.34 - +2.25 💚 -102 - 0 -3.98 - 0.0
arduino:avr:mega ❔ -98 - +646 -0.04 - +0.25 💚 -102 - 0 -1.25 - 0.0
arduino:avr:nano ❔ -98 - +646 -0.32 - +2.1 💚 -102 - 0 -4.98 - 0.0
arduino:megaavr:nona4809 🔺 0 - +110 0.0 - +0.22 💚 -116 - 0 -1.89 - 0.0
arduino:megaavr:uno2018 🔺 0 - +110 0.0 - +0.23 💚 -116 - 0 -1.89 - 0.0
arduino:sam:arduino_due_x_dbg 🔺 0 - +48 0.0 - +0.01 N/A N/A
arduino:samd:arduino_zero_edbg 🔺 0 - +40 0.0 - +0.02 💚 -112 - 0 -0.34 - 0.0
arduino:samd:mkr1000 🔺 0 - +40 0.0 - +0.02 💚 -112 - 0 -0.34 - 0.0
arduino:samd:mkrfox1200 🔺 0 - +40 0.0 - +0.02 💚 -112 - 0 -0.34 - 0.0
arduino:samd:mkrgsm1400 🔺 0 - +40 0.0 - +0.02 💚 -112 - 0 -0.34 - 0.0
arduino:samd:mkrnb1500 🔺 0 - +40 0.0 - +0.02 💚 -112 - 0 -0.34 - 0.0
arduino:samd:mkrvidor4000 🔺 0 - +40 0.0 - +0.02 💚 -112 - 0 -0.34 - 0.0
arduino:samd:mkrwan1300 🔺 0 - +40 0.0 - +0.02 💚 -112 - 0 -0.34 - 0.0
arduino:samd:mkrwan1310 🔺 0 - +40 0.0 - +0.02 💚 -112 - 0 -0.34 - 0.0
arduino:samd:mkrwifi1010 🔺 0 - +40 0.0 - +0.02 💚 -112 - 0 -0.34 - 0.0
arduino:samd:mkrzero 🔺 0 - +40 0.0 - +0.02 💚 -112 - 0 -0.34 - 0.0
arduino:samd:nano_33_iot 🔺 0 - +40 0.0 - +0.02 💚 -112 - 0 -0.34 - 0.0
Click for full report table
Board examples/AdvancedChatServer
flash
% examples/AdvancedChatServer
RAM for global variables
% examples/BarometricPressureWebServer
flash
% examples/BarometricPressureWebServer
RAM for global variables
% examples/ChatServer
flash
% examples/ChatServer
RAM for global variables
% examples/DhcpAddressPrinter
flash
% examples/DhcpAddressPrinter
RAM for global variables
% examples/DhcpChatServer
flash
% examples/DhcpChatServer
RAM for global variables
% examples/LinkStatus
flash
% examples/LinkStatus
RAM for global variables
% examples/PagerServer
flash
% examples/PagerServer
RAM for global variables
% examples/TelnetClient
flash
% examples/TelnetClient
RAM for global variables
% examples/UDPSendReceiveString
flash
% examples/UDPSendReceiveString
RAM for global variables
% examples/UdpNtpClient
flash
% examples/UdpNtpClient
RAM for global variables
% examples/WebClient
flash
% examples/WebClient
RAM for global variables
% examples/WebClientRepeating
flash
% examples/WebClientRepeating
RAM for global variables
% examples/WebServer
flash
% examples/WebServer
RAM for global variables
%
arduino:avr:leonardo 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 646 2.25 -92 -3.59 54 0.19 -102 -3.98 0 0.0 0 0.0 -98 -0.34 -102 -3.98 0 0.0 0 0.0 0 0.0 0 0.0 646 2.25 -92 -3.59 -62 -0.22 -102 -3.98 -98 -0.34 -102 -3.98 0 0.0 0 0.0
arduino:avr:mega 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 646 0.25 -92 -1.12 54 0.02 -102 -1.25 0 0.0 0 0.0 -98 -0.04 -102 -1.25 0 0.0 0 0.0 0 0.0 0 0.0 646 0.25 -92 -1.12 -62 -0.02 -102 -1.25 -96 -0.04 -102 -1.25 0 0.0 0 0.0
arduino:avr:nano 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 646 2.1 -92 -4.49 54 0.18 -102 -4.98 0 0.0 0 0.0 -98 -0.32 -102 -4.98 0 0.0 0 0.0 0 0.0 0 0.0 646 2.1 -92 -4.49 -62 -0.2 -102 -4.98 -96 -0.31 -102 -4.98 0 0.0 0 0.0
arduino:megaavr:nona4809 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 110 0.22 -116 -1.89 108 0.22 -116 -1.89 0 0.0 0 0.0 104 0.21 -116 -1.89 0 0.0 0 0.0 0 0.0 0 0.0 108 0.22 -116 -1.89 104 0.21 -116 -1.89 104 0.21 -116 -1.89 0 0.0 0 0.0
arduino:megaavr:uno2018 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 110 0.23 -116 -1.89 108 0.22 -116 -1.89 0 0.0 0 0.0 104 0.21 -116 -1.89 0 0.0 0 0.0 0 0.0 0 0.0 108 0.22 -116 -1.89 104 0.21 -116 -1.89 104 0.21 -116 -1.89 0 0.0 0 0.0
arduino:sam:arduino_due_x_dbg 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 40 0.01 N/A N/A 48 0.01 N/A N/A 0 0.0 N/A N/A 40 0.01 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 48 0.01 N/A N/A 40 0.01 N/A N/A 40 0.01 N/A N/A 0 0.0 N/A N/A
arduino:samd:arduino_zero_edbg 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0 40 0.02 -112 -0.34 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0
arduino:samd:mkr1000 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0 40 0.02 -112 -0.34 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0
arduino:samd:mkrfox1200 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0 40 0.02 -112 -0.34 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0
arduino:samd:mkrgsm1400 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0 40 0.02 -112 -0.34 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0
arduino:samd:mkrnb1500 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0 40 0.02 -112 -0.34 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0
arduino:samd:mkrvidor4000 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0 40 0.02 -112 -0.34 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0 40 0.02 -112 -0.34 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0
arduino:samd:mkrwan1310 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0 40 0.02 -112 -0.34 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0
arduino:samd:mkrwifi1010 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0 40 0.02 -112 -0.34 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0
arduino:samd:mkrzero 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0 40 0.02 -112 -0.34 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0
arduino:samd:nano_33_iot 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0 40 0.02 -112 -0.34 0 0.0 0 0.0 0 0.0 0 0.0 40 0.02 -112 -0.34 40 0.02 -112 -0.34 40 0.02 -112 -0.34 0 0.0 0 0.0
Click for full report CSV
Board,examples/AdvancedChatServer<br>flash,%,examples/AdvancedChatServer<br>RAM for global variables,%,examples/BarometricPressureWebServer<br>flash,%,examples/BarometricPressureWebServer<br>RAM for global variables,%,examples/ChatServer<br>flash,%,examples/ChatServer<br>RAM for global variables,%,examples/DhcpAddressPrinter<br>flash,%,examples/DhcpAddressPrinter<br>RAM for global variables,%,examples/DhcpChatServer<br>flash,%,examples/DhcpChatServer<br>RAM for global variables,%,examples/LinkStatus<br>flash,%,examples/LinkStatus<br>RAM for global variables,%,examples/PagerServer<br>flash,%,examples/PagerServer<br>RAM for global variables,%,examples/TelnetClient<br>flash,%,examples/TelnetClient<br>RAM for global variables,%,examples/UDPSendReceiveString<br>flash,%,examples/UDPSendReceiveString<br>RAM for global variables,%,examples/UdpNtpClient<br>flash,%,examples/UdpNtpClient<br>RAM for global variables,%,examples/WebClient<br>flash,%,examples/WebClient<br>RAM for global variables,%,examples/WebClientRepeating<br>flash,%,examples/WebClientRepeating<br>RAM for global variables,%,examples/WebServer<br>flash,%,examples/WebServer<br>RAM for global variables,%
arduino:avr:leonardo,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,646,2.25,-92,-3.59,54,0.19,-102,-3.98,0,0.0,0,0.0,-98,-0.34,-102,-3.98,0,0.0,0,0.0,0,0.0,0,0.0,646,2.25,-92,-3.59,-62,-0.22,-102,-3.98,-98,-0.34,-102,-3.98,0,0.0,0,0.0
arduino:avr:mega,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,646,0.25,-92,-1.12,54,0.02,-102,-1.25,0,0.0,0,0.0,-98,-0.04,-102,-1.25,0,0.0,0,0.0,0,0.0,0,0.0,646,0.25,-92,-1.12,-62,-0.02,-102,-1.25,-96,-0.04,-102,-1.25,0,0.0,0,0.0
arduino:avr:nano,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,646,2.1,-92,-4.49,54,0.18,-102,-4.98,0,0.0,0,0.0,-98,-0.32,-102,-4.98,0,0.0,0,0.0,0,0.0,0,0.0,646,2.1,-92,-4.49,-62,-0.2,-102,-4.98,-96,-0.31,-102,-4.98,0,0.0,0,0.0
arduino:megaavr:nona4809,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,110,0.22,-116,-1.89,108,0.22,-116,-1.89,0,0.0,0,0.0,104,0.21,-116,-1.89,0,0.0,0,0.0,0,0.0,0,0.0,108,0.22,-116,-1.89,104,0.21,-116,-1.89,104,0.21,-116,-1.89,0,0.0,0,0.0
arduino:megaavr:uno2018,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,110,0.23,-116,-1.89,108,0.22,-116,-1.89,0,0.0,0,0.0,104,0.21,-116,-1.89,0,0.0,0,0.0,0,0.0,0,0.0,108,0.22,-116,-1.89,104,0.21,-116,-1.89,104,0.21,-116,-1.89,0,0.0,0,0.0
arduino:sam:arduino_due_x_dbg,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,40,0.01,N/A,N/A,48,0.01,N/A,N/A,0,0.0,N/A,N/A,40,0.01,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,48,0.01,N/A,N/A,40,0.01,N/A,N/A,40,0.01,N/A,N/A,0,0.0,N/A,N/A
arduino:samd:arduino_zero_edbg,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0,40,0.02,-112,-0.34,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0
arduino:samd:mkr1000,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0,40,0.02,-112,-0.34,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0
arduino:samd:mkrfox1200,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0,40,0.02,-112,-0.34,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0
arduino:samd:mkrgsm1400,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0,40,0.02,-112,-0.34,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0
arduino:samd:mkrnb1500,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0,40,0.02,-112,-0.34,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0
arduino:samd:mkrvidor4000,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0,40,0.02,-112,-0.34,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0
arduino:samd:mkrwan1300,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0,40,0.02,-112,-0.34,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0
arduino:samd:mkrwan1310,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0,40,0.02,-112,-0.34,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0
arduino:samd:mkrwifi1010,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0,40,0.02,-112,-0.34,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0
arduino:samd:mkrzero,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0,40,0.02,-112,-0.34,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0
arduino:samd:nano_33_iot,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0,40,0.02,-112,-0.34,0,0.0,0,0.0,0,0.0,0,0.0,40,0.02,-112,-0.34,40,0.02,-112,-0.34,40,0.02,-112,-0.34,0,0.0,0,0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant