Merge pull request #8165 from anecdata/wifi_docs

Networking docs updates: Access Point, MDNS
This commit is contained in:
Scott Shawcroft 2023-07-17 14:58:28 -07:00 committed by GitHub
commit a2002e364c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 2 deletions

View File

@ -94,6 +94,10 @@ MDNS is used to resolve [`circuitpython.local`](http://circuitpython.local) to a
hostname of the form `cpy-XXXXXX.local`. The `XXXXXX` is based on network MAC address. The device
also provides the MDNS service with service type `_circuitpython` and protocol `_tcp`.
Since port 80 (or the port assigned to `CIRCUITPY_WEB_API_PORT`) is used for web workflow, the `mdns`
[module](https://docs.circuitpython.org/en/latest/shared-bindings/mdns/index.html#mdns.Server.advertise_service)
can't advertise an additional service on that port.
### HTTP
The web server is HTTP 1.1 and may use chunked responses so that it doesn't need to precompute
content length.

View File

@ -171,6 +171,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(mdns_server_find_obj, 1, _mdns_server_find);
//| ``service_type`` and ``protocol`` can only occur on one port. Any call after the first
//| will update the entry's port.
//|
//| If web workflow is active, the port it uses can't also be used to advertise a service.
//|
//| :param str service_type: The service type such as "_http"
//| :param str protocol: The service protocol such as "_tcp"
//| :param int port: The port used by the service"""

View File

@ -339,7 +339,12 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_station_obj, wifi_radio_stop_station);
//| or exactly 64 hexadecimal characters if it is the hex form of the 256-bit key.
//|
//| If ``max_connections`` is given, the access point will allow up to
//| that number of stations to connect."""
//| that number of stations to connect.
//|
//| .. note::
//|
//| In the raspberrypi port (RP2040 CYW43), ``max_connections`` is ignored.
//| """
//| ...
STATIC mp_obj_t wifi_radio_start_ap(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_ssid, ARG_password, ARG_channel, ARG_authmode, ARG_max_connections };
@ -559,7 +564,12 @@ MP_PROPERTY_GETTER(wifi_radio_ipv4_subnet_ap_obj,
//| ipv4_dns: Optional[ipaddress.IPv4Address],
//| ) -> None:
//| """Sets the IP v4 address of the station. Must include the netmask and gateway. DNS address is optional.
//| Setting the address manually will stop the DHCP client."""
//| Setting the address manually will stop the DHCP client.
//|
//| .. note::
//|
//| In the raspberrypi port (RP2040 CYW43), the access point needs to be started before the IP v4 address can be set.
//| """
//| ...
STATIC mp_obj_t wifi_radio_set_ipv4_address(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_ipv4, ARG_netmask, ARG_gateway, ARG_ipv4_dns };