summaryrefslogtreecommitdiffstatshomepage
path: root/docs
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2023-09-29 22:49:49 +1000
committerDamien George <damien@micropython.org>2023-10-04 12:39:23 +1100
commitb329fdcb7394f7a30cb81c48e04ba3d557d29396 (patch)
tree87e1cfae4064af67a87a0f0f78c14c6adc8b8eb0 /docs
parentd6c55a40fe611201ae5a56e1738da443862911db (diff)
downloadmicropython-b329fdcb7394f7a30cb81c48e04ba3d557d29396.tar.gz
micropython-b329fdcb7394f7a30cb81c48e04ba3d557d29396.zip
extmod/modnetwork: Increase max hostname length to 32.
This changes from the previous limit of 15 characters. Although DHCP and mDNS allow for up to 63, ESP32 and ESP8266 only allow 32, so this seems like a reasonable limit to enforce across all ports (and avoids wasting the additional memory). Also clarifies that `MICROPY_PY_NETWORK_HOSTNAME_MAX_LEN` does not include the null terminator (which was unclear before). This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/library/network.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/library/network.rst b/docs/library/network.rst
index a14d6192ea..cc50884294 100644
--- a/docs/library/network.rst
+++ b/docs/library/network.rst
@@ -188,6 +188,11 @@ The following are functions available in the network module.
during connection. For this reason, you must set the hostname before
activating/connecting your network interfaces.
+ The length of the hostname is limited to 32 characters.
+ :term:`MicroPython ports <MicroPython port>` may choose to set a lower
+ limit for memory reasons. If the given name does not fit, a `ValueError`
+ is raised.
+
The default hostname is typically the name of the board.
.. function:: phy_mode([mode])