src/eric7/Documentation/Source/eric7.MicroPython.Devices.RP2040Devices.html

branch
mpy_network
changeset 9799
a79430a8811d
parent 9765
6378da868bb0
child 9840
d41ee69fa69b
--- a/src/eric7/Documentation/Source/eric7.MicroPython.Devices.RP2040Devices.html	Fri Feb 24 18:36:43 2023 +0100
+++ b/src/eric7/Documentation/Source/eric7.MicroPython.Devices.RP2040Devices.html	Sat Feb 25 19:18:07 2023 +0100
@@ -80,6 +80,10 @@
 <td>Private slot to flash a MicroPython firmware to the device.</td>
 </tr>
 <tr>
+<td><a href="#RP2040Device.__setCountry">__setCountry</a></td>
+<td>Private slot to configure the country of the connected RP2040 device.</td>
+</tr>
+<tr>
 <td><a href="#RP2040Device.__showFirmwareVersions">__showFirmwareVersions</a></td>
 <td>Private slot to show the firmware version of the connected device and the available firmware version.</td>
 </tr>
@@ -92,6 +96,10 @@
 <td>Public method to add device specific entries to the given menu.</td>
 </tr>
 <tr>
+<td><a href="#RP2040Device.addDeviceWifiEntries">addDeviceWifiEntries</a></td>
+<td>Public method to add device specific entries to the given menu.</td>
+</tr>
+<tr>
 <td><a href="#RP2040Device.canRunScript">canRunScript</a></td>
 <td>Public method to determine, if a script can be executed.</td>
 </tr>
@@ -108,14 +116,34 @@
 <td>Public method to determine, if a REPL can be started.</td>
 </tr>
 <tr>
+<td><a href="#RP2040Device.checkInternet">checkInternet</a></td>
+<td>Public method to check, if the internet can be reached.</td>
+</tr>
+<tr>
+<td><a href="#RP2040Device.connectWifi">connectWifi</a></td>
+<td>Public method to connect a device to a WiFi network.</td>
+</tr>
+<tr>
+<td><a href="#RP2040Device.deactivateInterface">deactivateInterface</a></td>
+<td>Public method to deactivate a given WiFi interface of the connected device.</td>
+</tr>
+<tr>
 <td><a href="#RP2040Device.deviceName">deviceName</a></td>
 <td>Public method to get the name of the device.</td>
 </tr>
 <tr>
+<td><a href="#RP2040Device.disconnectWifi">disconnectWifi</a></td>
+<td>Public method to disconnect a device from the WiFi network.</td>
+</tr>
+<tr>
 <td><a href="#RP2040Device.forceInterrupt">forceInterrupt</a></td>
 <td>Public method to determine the need for an interrupt when opening the serial connection.</td>
 </tr>
 <tr>
+<td><a href="#RP2040Device.getConnectedClients">getConnectedClients</a></td>
+<td>Public method to get a list of connected clients.</td>
+</tr>
+<tr>
 <td><a href="#RP2040Device.getDocumentationUrl">getDocumentationUrl</a></td>
 <td>Public method to get the device documentation URL.</td>
 </tr>
@@ -124,17 +152,45 @@
 <td>Public method to retrieve the entries for the downloads menu.</td>
 </tr>
 <tr>
+<td><a href="#RP2040Device.getWifiData">getWifiData</a></td>
+<td>Public method to get data related to the current WiFi status.</td>
+</tr>
+<tr>
 <td><a href="#RP2040Device.hasFlashMenuEntry">hasFlashMenuEntry</a></td>
 <td>Public method to check, if the device has its own flash menu entry.</td>
 </tr>
 <tr>
+<td><a href="#RP2040Device.hasWifi">hasWifi</a></td>
+<td>Public method to check the availability of WiFi.</td>
+</tr>
+<tr>
+<td><a href="#RP2040Device.removeCredentials">removeCredentials</a></td>
+<td>Public method to remove the saved credentials from the connected device.</td>
+</tr>
+<tr>
 <td><a href="#RP2040Device.runScript">runScript</a></td>
 <td>Public method to run the given Python script.</td>
 </tr>
 <tr>
+<td><a href="#RP2040Device.scanNetworks">scanNetworks</a></td>
+<td>Public method to scan for available WiFi networks.</td>
+</tr>
+<tr>
 <td><a href="#RP2040Device.setButtons">setButtons</a></td>
 <td>Public method to enable the supported action buttons.</td>
 </tr>
+<tr>
+<td><a href="#RP2040Device.startAccessPoint">startAccessPoint</a></td>
+<td>Public method to start the access point interface.</td>
+</tr>
+<tr>
+<td><a href="#RP2040Device.stopAccessPoint">stopAccessPoint</a></td>
+<td>Public method to stop the access point interface.</td>
+</tr>
+<tr>
+<td><a href="#RP2040Device.writeCredentials">writeCredentials</a></td>
+<td>Public method to write the given credentials to the connected device and modify the start script to connect automatically.</td>
+</tr>
 </table>
 <h3>Static Methods</h3>
 
@@ -199,6 +255,16 @@
 <p>
         Private slot to flash a MicroPython firmware to the device.
 </p>
+<a NAME="RP2040Device.__setCountry" ID="RP2040Device.__setCountry"></a>
+<h4>RP2040Device.__setCountry</h4>
+<b>__setCountry</b>(<i></i>)
+
+<p>
+        Private slot to configure the country of the connected RP2040 device.
+</p>
+<p>
+        The country is the two letter country code.
+</p>
 <a NAME="RP2040Device.__showFirmwareVersions" ID="RP2040Device.__showFirmwareVersions"></a>
 <h4>RP2040Device.__showFirmwareVersions</h4>
 <b>__showFirmwareVersions</b>(<i></i>)
@@ -244,6 +310,20 @@
 reference to the context menu
 </dd>
 </dl>
+<a NAME="RP2040Device.addDeviceWifiEntries" ID="RP2040Device.addDeviceWifiEntries"></a>
+<h4>RP2040Device.addDeviceWifiEntries</h4>
+<b>addDeviceWifiEntries</b>(<i>menu</i>)
+
+<p>
+        Public method to add device specific entries to the given menu.
+</p>
+<dl>
+
+<dt><i>menu</i> (QMenu)</dt>
+<dd>
+reference to the context menu
+</dd>
+</dl>
 <a NAME="RP2040Device.canRunScript" ID="RP2040Device.canRunScript"></a>
 <h4>RP2040Device.canRunScript</h4>
 <b>canRunScript</b>(<i></i>)
@@ -324,6 +404,89 @@
 tuple of (bool, str)
 </dd>
 </dl>
+<a NAME="RP2040Device.checkInternet" ID="RP2040Device.checkInternet"></a>
+<h4>RP2040Device.checkInternet</h4>
+<b>checkInternet</b>(<i></i>)
+
+<p>
+        Public method to check, if the internet can be reached.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple containing a flag indicating reachability and an error string
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of (bool, str)
+</dd>
+</dl>
+<a NAME="RP2040Device.connectWifi" ID="RP2040Device.connectWifi"></a>
+<h4>RP2040Device.connectWifi</h4>
+<b>connectWifi</b>(<i>ssid, password</i>)
+
+<p>
+        Public method to connect a device to a WiFi network.
+</p>
+<dl>
+
+<dt><i>ssid</i> (str)</dt>
+<dd>
+name (SSID) of the WiFi network
+</dd>
+<dt><i>password</i> (str)</dt>
+<dd>
+password needed to connect
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple containing the connection status and an error string
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of (bool, str)
+</dd>
+</dl>
+<a NAME="RP2040Device.deactivateInterface" ID="RP2040Device.deactivateInterface"></a>
+<h4>RP2040Device.deactivateInterface</h4>
+<b>deactivateInterface</b>(<i>interface</i>)
+
+<p>
+        Public method to deactivate a given WiFi interface of the connected device.
+</p>
+<dl>
+
+<dt><i>interface</i> (str)</dt>
+<dd>
+designation of the interface to be deactivated (one of 'AP'
+            or 'STA')
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple containg a flag indicating success and an error message
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of (bool, str)
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>ValueError</b>:</dt>
+<dd>
+raised to indicate a wrong value for the interface type
+</dd>
+</dl>
 <a NAME="RP2040Device.deviceName" ID="RP2040Device.deviceName"></a>
 <h4>RP2040Device.deviceName</h4>
 <b>deviceName</b>(<i></i>)
@@ -343,6 +506,25 @@
 str
 </dd>
 </dl>
+<a NAME="RP2040Device.disconnectWifi" ID="RP2040Device.disconnectWifi"></a>
+<h4>RP2040Device.disconnectWifi</h4>
+<b>disconnectWifi</b>(<i></i>)
+
+<p>
+        Public method to disconnect a device from the WiFi network.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple containing a flag indicating success and an error string
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of (bool, str)
+</dd>
+</dl>
 <a NAME="RP2040Device.forceInterrupt" ID="RP2040Device.forceInterrupt"></a>
 <h4>RP2040Device.forceInterrupt</h4>
 <b>forceInterrupt</b>(<i></i>)
@@ -363,6 +545,26 @@
 bool
 </dd>
 </dl>
+<a NAME="RP2040Device.getConnectedClients" ID="RP2040Device.getConnectedClients"></a>
+<h4>RP2040Device.getConnectedClients</h4>
+<b>getConnectedClients</b>(<i></i>)
+
+<p>
+        Public method to get a list of connected clients.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+a tuple containing a list of tuples containing the client MAC-Address
+            and the RSSI (if supported and available) and an error message
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of ([(bytes, int)], str)
+</dd>
+</dl>
 <a NAME="RP2040Device.getDocumentationUrl" ID="RP2040Device.getDocumentationUrl"></a>
 <h4>RP2040Device.getDocumentationUrl</h4>
 <b>getDocumentationUrl</b>(<i></i>)
@@ -402,6 +604,33 @@
 list of tuple of (str, str)
 </dd>
 </dl>
+<a NAME="RP2040Device.getWifiData" ID="RP2040Device.getWifiData"></a>
+<h4>RP2040Device.getWifiData</h4>
+<b>getWifiData</b>(<i></i>)
+
+<p>
+        Public method to get data related to the current WiFi status.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple of three dictionaries containing the WiFi status data
+            for the WiFi client, access point and overall data
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of (dict, dict, dict)
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
 <a NAME="RP2040Device.hasFlashMenuEntry" ID="RP2040Device.hasFlashMenuEntry"></a>
 <h4>RP2040Device.hasFlashMenuEntry</h4>
 <b>hasFlashMenuEntry</b>(<i></i>)
@@ -421,6 +650,52 @@
 bool
 </dd>
 </dl>
+<a NAME="RP2040Device.hasWifi" ID="RP2040Device.hasWifi"></a>
+<h4>RP2040Device.hasWifi</h4>
+<b>hasWifi</b>(<i></i>)
+
+<p>
+        Public method to check the availability of WiFi.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple containing a flag indicating the availability of WiFi
+            and the WiFi type (picow or pimoroni)
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of (bool, str)
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
+<a NAME="RP2040Device.removeCredentials" ID="RP2040Device.removeCredentials"></a>
+<h4>RP2040Device.removeCredentials</h4>
+<b>removeCredentials</b>(<i></i>)
+
+<p>
+        Public method to remove the saved credentials from the connected device.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple containing a flag indicating success and an error message
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of (bool, str)
+</dd>
+</dl>
 <a NAME="RP2040Device.runScript" ID="RP2040Device.runScript"></a>
 <h4>RP2040Device.runScript</h4>
 <b>runScript</b>(<i>script</i>)
@@ -435,6 +710,26 @@
 script to be executed
 </dd>
 </dl>
+<a NAME="RP2040Device.scanNetworks" ID="RP2040Device.scanNetworks"></a>
+<h4>RP2040Device.scanNetworks</h4>
+<b>scanNetworks</b>(<i></i>)
+
+<p>
+        Public method to scan for available WiFi networks.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple containing the list of available networks as a tuple of 'Name',
+            'MAC-Address', 'channel', 'RSSI' and 'security' and an error string
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of (list of tuple of (str, str, int, int, str), str)
+</dd>
+</dl>
 <a NAME="RP2040Device.setButtons" ID="RP2040Device.setButtons"></a>
 <h4>RP2040Device.setButtons</h4>
 <b>setButtons</b>(<i></i>)
@@ -442,6 +737,95 @@
 <p>
         Public method to enable the supported action buttons.
 </p>
+<a NAME="RP2040Device.startAccessPoint" ID="RP2040Device.startAccessPoint"></a>
+<h4>RP2040Device.startAccessPoint</h4>
+<b>startAccessPoint</b>(<i>ssid, security=None, password=None, ifconfig=None</i>)
+
+<p>
+        Public method to start the access point interface.
+</p>
+<dl>
+
+<dt><i>ssid</i> (str)</dt>
+<dd>
+SSID of the access point
+</dd>
+<dt><i>security</i> (int (optional))</dt>
+<dd>
+security method (defaults to None)
+</dd>
+<dt><i>password</i> (str (optional))</dt>
+<dd>
+password (defaults to None)
+</dd>
+<dt><i>ifconfig</i> (tuple of (str, str, str, str))</dt>
+<dd>
+IPv4 configuration for the access point if not default
+            (IPv4 address, netmask, gateway address, DNS server address)
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple containing a flag indicating success and an error message
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of (bool, str)
+</dd>
+</dl>
+<a NAME="RP2040Device.stopAccessPoint" ID="RP2040Device.stopAccessPoint"></a>
+<h4>RP2040Device.stopAccessPoint</h4>
+<b>stopAccessPoint</b>(<i></i>)
+
+<p>
+        Public method to stop the access point interface.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple containg a flag indicating success and an error message
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of (bool, str)
+</dd>
+</dl>
+<a NAME="RP2040Device.writeCredentials" ID="RP2040Device.writeCredentials"></a>
+<h4>RP2040Device.writeCredentials</h4>
+<b>writeCredentials</b>(<i>ssid, password</i>)
+
+<p>
+        Public method to write the given credentials to the connected device and modify
+        the start script to connect automatically.
+</p>
+<dl>
+
+<dt><i>ssid</i> (str)</dt>
+<dd>
+SSID of the network to connect to
+</dd>
+<dt><i>password</i> (str)</dt>
+<dd>
+password needed to authenticate
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple containing a flag indicating success and an error message
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of (bool, str)
+</dd>
+</dl>
 <div align="right"><a href="#top">Up</a></div>
 <hr />
 <hr />

eric ide

mercurial