MicroPython, RP2040 mpy_network

Fri, 03 Mar 2023 11:29:15 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 03 Mar 2023 11:29:15 +0100
branch
mpy_network
changeset 9838
d6b87ef03c13
parent 9837
b1d925ecda15
child 9839
fc60e382b67a

MicroPython, RP2040
- changed 'pimoroni' to 'picowireless' to be more specific

src/eric7/MicroPython/Devices/RP2040Devices.py file | annotate | diff | comparison | revisions
--- a/src/eric7/MicroPython/Devices/RP2040Devices.py	Thu Mar 02 17:54:11 2023 +0100
+++ b/src/eric7/MicroPython/Devices/RP2040Devices.py	Fri Mar 03 11:29:15 2023 +0100
@@ -57,7 +57,7 @@
                 2: self.tr("connected, waiting for IP address"),
                 3: self.tr("connected"),
             },
-            "pimoroni": {
+            "picowireless": {
                 0: self.tr("idle"),
                 1: self.tr("no matching access point found"),
                 2: self.tr("network scan completed"),
@@ -70,7 +70,7 @@
                 9: self.tr("AP failed"),
             },
         }
-        # TODO: must be specific (picow, pimoroni)
+        # TODO: must be specific (picow, picowireless)
         self.__securityTranslations = {
             "picow": {
                 0: self.tr("open", "open WiFi network"),
@@ -82,7 +82,7 @@
                 6: "WPA3",
                 7: "WPA2/WPA3",
             },
-            "pimoroni": {
+            "picowireless": {
                 2: "WPA",
                 4: "WPA2 (CCMP)",
                 5: "WEP",
@@ -427,7 +427,7 @@
         Public method to check the availability of WiFi.
 
         @return tuple containing a flag indicating the availability of WiFi
-            and the WiFi type (picow or pimoroni)
+            and the WiFi type (picow or picowireless)
         @rtype tuple of (bool, str)
         @exception OSError raised to indicate an issue with the device
         """
@@ -445,10 +445,10 @@
             import picowireless as pw
             try:
                 if pw.get_fw_version() != '':
-                    return True, 'pimoroni'
+                    return True, 'picowireless'
             except RuntimeError:
                 picowireless.init()
-                return True, 'pimoroni'
+                return True, 'picowireless'
         except ImportError:
             pass
 
@@ -519,7 +519,7 @@
 wifi_status()
 del wifi_status
 """
-        elif self._deviceData["wifi_type"] == "pimoroni":
+        elif self._deviceData["wifi_type"] == "picowireless":
             command = """
 def wifi_status():
     import picowireless as pw
@@ -655,7 +655,7 @@
                 repr(password if password else ""),
                 repr(country if country else "XX"),
             )
-        elif self._deviceData["wifi_type"] == "pimoroni":
+        elif self._deviceData["wifi_type"] == "picowireless":
             command = """
 def connect_wifi(ssid, password):
     import picowireless as pw
@@ -732,7 +732,7 @@
 disconnect_wifi()
 del disconnect_wifi
 """
-        elif self._deviceData["wifi_type"] == "pimoroni":
+        elif self._deviceData["wifi_type"] == "picowireless":
             command = """
 def disconnect_wifi():
     import picowireless as pw
@@ -800,7 +800,7 @@
                 repr(ssid),
                 repr(password) if password else '""',
             )
-            if self._deviceData["wifi_type"] == "pimoroni":
+            if self._deviceData["wifi_type"] == "picowireless":
                 wifiConnectFile = "pimoroniWiFiConnect.py"
             else:
                 wifiConnectFile = "mpyWiFiConnect.py"
@@ -864,7 +864,7 @@
 check_internet()
 del check_internet
 """
-        elif self._deviceData["wifi_type"] == "pimoroni":
+        elif self._deviceData["wifi_type"] == "picowireless":
             command = """
 def check_internet():
     import picowireless as pw
@@ -921,7 +921,7 @@
                 repr(country if country else "XX")
             )
 
-        elif self._deviceData["wifi_type"] == "pimoroni":
+        elif self._deviceData["wifi_type"] == "picowireless":
             command = """
 def scan_networks():
     import picowireless as pw
@@ -1010,7 +1010,7 @@
 """.format(
                 interface
             )
-        elif self._deviceData["wifi_type"] == "pimoroni":
+        elif self._deviceData["wifi_type"] == "picowireless":
             command = """
 def deactivate():
     import picowireless as pw
@@ -1079,7 +1079,7 @@
                 ifconfig,
                 repr(country if country else "XX"),
             )
-        elif self._deviceData["wifi_type"] == "pimoroni":
+        elif self._deviceData["wifi_type"] == "picowireless":
             # AP is fixed at channel 6
             command = """
 def start_ap(ssid, password):
@@ -1121,7 +1121,7 @@
         @return tuple containg a flag indicating success and an error message
         @rtype tuple of (bool, str)
         """
-        if self._deviceData["wifi_type"] in ("picow", "pimoroni"):
+        if self._deviceData["wifi_type"] in ("picow", "picowireless"):
             return self.deactivateInterface("AP")
         else:
             return super().stopAccessPoint()
@@ -1146,7 +1146,7 @@
 get_stations()
 del get_stations
 """
-        elif self._deviceData["wifi_type"] == "pimoroni":
+        elif self._deviceData["wifi_type"] == "picowireless":
             return (
                 [],
                 self.tr(

eric ide

mercurial