8000 docs/library/network: Enhance AbstractNIC.status to take an optional argument. by dpgeorge · Pull Request #3351 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

docs/library/network: Enhance AbstractNIC.status to take an optional argument. #3351

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions docs/library/network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,20 @@ parameter should be `id`.
duration and other parameters. Where possible, parameter names
should match those in connect().

.. method:: status()
.. method:: status([param])

Return detailed status of the interface, values are dependent
on the network medium/technology.
Query dynamic status information of the interface. When called with no
argument the return value describes the network link status. Otherwise
*param* should be a string naming the particular status parameter to
retrieve.

The return types and values are dependent on the network
medium/technology. Some of the parameters that may be supported are:

* WiFi STA: use ``'rssi'`` to retrieve the RSSI of the AP signal
* WiFi AP: use ``'stations'`` to retrieve a list of all the STAs
connected to the AP. The list contains tuples of the form
(MAC, RSSI).

.. method:: ifconfig([(ip, subnet, gateway, dns)])

Expand All @@ -119,7 +129,7 @@ parameter should be `id`.
Get or set general network interface parameters. These methods allow to work
with additional parameters beyond standard IP configuration (as dealt with by
`ifconfig()`). These include network-specific and hardware-specific
parameters and status values. For setting parameters, the keyword argument
parameters. For setting parameters, the keyword argument
syntax should be used, and multiple parameters can be set at once. For
querying, a parameter name should be quoted as a string, and only one
parameter can be queried at a time::
Expand All @@ -129,8 +139,6 @@ parameter should be `id`.
# Query params one by one
print(ap.config('essid'))
print(ap.config('channel'))
# Extended status information also available this way
print(sta.config('rssi'))

.. only:: port_pyboard

Expand Down
0