|
|
@ -72,7 +72,7 @@ parameter should be `id`. |
|
|
|
connection parameters. For various medium types, there are different |
|
|
|
sets of predefined/recommended parameters, among them: |
|
|
|
|
|
|
|
* WiFi: `bssid` keyword to connect by BSSID (MAC address) instead |
|
|
|
* WiFi: *bssid* keyword to connect by BSSID (MAC address) instead |
|
|
|
of access point name |
|
|
|
|
|
|
|
.. method:: disconnect() |
|
|
@ -118,7 +118,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 |
|
|
|
`ifconfig()`). These include network-specific and hardware-specific |
|
|
|
parameters and status values. 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 |
|
|
@ -170,11 +170,11 @@ parameter should be `id`. |
|
|
|
|
|
|
|
Arguments are: |
|
|
|
|
|
|
|
- ``spi`` is an :ref:`SPI object <pyb.SPI>` which is the SPI bus that the CC3000 is |
|
|
|
- *spi* is an :ref:`SPI object <pyb.SPI>` which is the SPI bus that the CC3000 is |
|
|
|
connected to (the MOSI, MISO and CLK pins). |
|
|
|
- ``pin_cs`` is a :ref:`Pin object <pyb.Pin>` which is connected to the CC3000 CS pin. |
|
|
|
- ``pin_en`` is a :ref:`Pin object <pyb.Pin>` which is connected to the CC3000 VBEN pin. |
|
|
|
- ``pin_irq`` is a :ref:`Pin object <pyb.Pin>` which is connected to the CC3000 IRQ pin. |
|
|
|
- *pin_cs* is a :ref:`Pin object <pyb.Pin>` which is connected to the CC3000 CS pin. |
|
|
|
- *pin_en* is a :ref:`Pin object <pyb.Pin>` which is connected to the CC3000 VBEN pin. |
|
|
|
- *pin_irq* is a :ref:`Pin object <pyb.Pin>` which is connected to the CC3000 IRQ pin. |
|
|
|
|
|
|
|
All of these objects will be initialised by the driver, so there is no need to |
|
|
|
initialise them yourself. For example, you can use:: |
|
|
@ -256,10 +256,10 @@ parameter should be `id`. |
|
|
|
|
|
|
|
Arguments are: |
|
|
|
|
|
|
|
- ``spi`` is an :ref:`SPI object <pyb.SPI>` which is the SPI bus that the WIZnet5x00 is |
|
|
|
- *spi* is an :ref:`SPI object <pyb.SPI>` which is the SPI bus that the WIZnet5x00 is |
|
|
|
connected to (the MOSI, MISO and SCLK pins). |
|
|
|
- ``pin_cs`` is a :ref:`Pin object <pyb.Pin>` which is connected to the WIZnet5x00 nSS pin. |
|
|
|
- ``pin_rst`` is a :ref:`Pin object <pyb.Pin>` which is connected to the WIZnet5x00 nRESET pin. |
|
|
|
- *pin_cs* is a :ref:`Pin object <pyb.Pin>` which is connected to the WIZnet5x00 nSS pin. |
|
|
|
- *pin_rst* is a :ref:`Pin object <pyb.Pin>` which is connected to the WIZnet5x00 nRESET pin. |
|
|
|
|
|
|
|
All of these objects will be initialised by the driver, so there is no need to |
|
|
|
initialise them yourself. For example, you can use:: |
|
|
@ -294,7 +294,7 @@ parameter should be `id`. |
|
|
|
|
|
|
|
Get or set the PHY mode. |
|
|
|
|
|
|
|
If the ``mode`` parameter is provided, sets the mode to its value. If |
|
|
|
If the *mode* parameter is provided, sets the mode to its value. If |
|
|
|
the function is called without parameters, returns the current mode. |
|
|
|
|
|
|
|
The possible modes are defined as constants: |
|
|
@ -322,7 +322,7 @@ parameter should be `id`. |
|
|
|
``network.STA_IF`` (station aka client, connects to upstream WiFi access |
|
|
|
points) and ``network.AP_IF`` (access point, allows other WiFi clients to |
|
|
|
connect). Availability of the methods below depends on interface type. |
|
|
|
For example, only STA interface may ``connect()`` to an access point. |
|
|
|
For example, only STA interface may `connect()` to an access point. |
|
|
|
|
|
|
|
Methods |
|
|
|
------- |
|
|
@ -350,8 +350,8 @@ parameter should be `id`. |
|
|
|
|
|
|
|
(ssid, bssid, channel, RSSI, authmode, hidden) |
|
|
|
|
|
|
|
`bssid` is hardware address of an access point, in binary form, returned as |
|
|
|
bytes object. You can use ``ubinascii.hexlify()`` to convert it to ASCII form. |
|
|
|
*bssid* is hardware address of an access point, in binary form, returned as |
|
|
|
bytes object. You can use `ubinascii.hexlify()` to convert it to ASCII form. |
|
|
|
|
|
|
|
There are five values for authmode: |
|
|
|
|
|
|
@ -399,7 +399,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 |
|
|
|
``wlan.ifconfig()``). These include network-specific and hardware-specific |
|
|
|
`wlan.ifconfig()`). These include network-specific and hardware-specific |
|
|
|
parameters. For setting parameters, keyword argument syntax should be used, |
|
|
|
multiple parameters can be set at once. For querying, parameters name should |
|
|
|
be quoted as a string, and only one parameter can be queries at time:: |
|
|
@ -450,7 +450,7 @@ parameter should be `id`. |
|
|
|
|
|
|
|
.. class:: WLAN(id=0, ...) |
|
|
|
|
|
|
|
Create a WLAN object, and optionally configure it. See ``init`` for params of configuration. |
|
|
|
Create a WLAN object, and optionally configure it. See `init()` for params of configuration. |
|
|
|
|
|
|
|
.. note:: |
|
|
|
|
|
|
@ -469,14 +469,14 @@ parameter should be `id`. |
|
|
|
|
|
|
|
Arguments are: |
|
|
|
|
|
|
|
- ``mode`` can be either ``WLAN.STA`` or ``WLAN.AP``. |
|
|
|
- ``ssid`` is a string with the ssid name. Only needed when mode is ``WLAN.AP``. |
|
|
|
- ``auth`` is a tuple with (sec, key). Security can be ``None``, ``WLAN.WEP``, |
|
|
|
- *mode* can be either ``WLAN.STA`` or ``WLAN.AP``. |
|
|
|
- *ssid* is a string with the ssid name. Only needed when mode is ``WLAN.AP``. |
|
|
|
- *auth* is a tuple with (sec, key). Security can be ``None``, ``WLAN.WEP``, |
|
|
|
``WLAN.WPA`` or ``WLAN.WPA2``. The key is a string with the network password. |
|
|
|
If ``sec`` is ``WLAN.WEP`` the key must be a string representing hexadecimal |
|
|
|
values (e.g. 'ABC1DE45BF'). Only needed when mode is ``WLAN.AP``. |
|
|
|
- ``channel`` a number in the range 1-11. Only needed when mode is ``WLAN.AP``. |
|
|
|
- ``antenna`` selects between the internal and the external antenna. Can be either |
|
|
|
- *channel* a number in the range 1-11. Only needed when mode is ``WLAN.AP``. |
|
|
|
- *antenna* selects between the internal and the external antenna. Can be either |
|
|
|
``WLAN.INT_ANT`` or ``WLAN.EXT_ANT``. |
|
|
|
|
|
|
|
For example, you can do:: |
|
|
@ -494,13 +494,13 @@ parameter should be `id`. |
|
|
|
Connect to a WiFi access point using the given SSID, and other security |
|
|
|
parameters. |
|
|
|
|
|
|
|
- ``auth`` is a tuple with (sec, key). Security can be ``None``, ``WLAN.WEP``, |
|
|
|
- *auth* is a tuple with (sec, key). Security can be ``None``, ``WLAN.WEP``, |
|
|
|
``WLAN.WPA`` or ``WLAN.WPA2``. The key is a string with the network password. |
|
|
|
If ``sec`` is ``WLAN.WEP`` the key must be a string representing hexadecimal |
|
|
|
values (e.g. 'ABC1DE45BF'). |
|
|
|
- ``bssid`` is the MAC address of the AP to connect to. Useful when there are several |
|
|
|
- *bssid* is the MAC address of the AP to connect to. Useful when there are several |
|
|
|
APs with the same ssid. |
|
|
|
- ``timeout`` is the maximum time in milliseconds to wait for the connection to succeed. |
|
|
|
- *timeout* is the maximum time in milliseconds to wait for the connection to succeed. |
|
|
|
|
|
|
|
.. method:: wlan.scan() |
|
|
|
|
|
|
@ -518,7 +518,7 @@ parameter should be `id`. |
|
|
|
|
|
|
|
.. method:: wlan.ifconfig(if_id=0, config=['dhcp' or configtuple]) |
|
|
|
|
|
|
|
With no parameters given returns a 4-tuple of ``(ip, subnet_mask, gateway, DNS_server)``. |
|
|
|
With no parameters given returns a 4-tuple of *(ip, subnet_mask, gateway, DNS_server)*. |
|
|
|
|
|
|
|
if ``'dhcp'`` is passed as a parameter then the DHCP client is enabled and the IP params |
|
|
|
are negotiated with the AP. |
|
|
@ -556,8 +556,8 @@ parameter should be `id`. |
|
|
|
Create a callback to be triggered when a WLAN event occurs during ``machine.SLEEP`` |
|
|
|
mode. Events are triggered by socket activity or by WLAN connection/disconnection. |
|
|
|
|
|
|
|
- ``handler`` is the function that gets called when the IRQ is triggered. |
|
|
|
- ``wake`` must be ``machine.SLEEP``. |
|
|
|
- *handler* is the function that gets called when the IRQ is triggered. |
|
|
|
- *wake* must be ``machine.SLEEP``. |
|
|
|
|
|
|
|
Returns an IRQ object. |
|
|
|
|
|
|
|