src/eric7/MicroPython/WifiDialogs/WifiController.py

branch
mpy_network
changeset 9782
67414f28db68
parent 9781
3112f77f722b
child 9787
163511257f24
--- a/src/eric7/MicroPython/WifiDialogs/WifiController.py	Mon Feb 20 11:42:45 2023 +0100
+++ b/src/eric7/MicroPython/WifiDialogs/WifiController.py	Mon Feb 20 16:02:02 2023 +0100
@@ -214,8 +214,22 @@
         """
         Private slot to stop the Access Point interface of the connected device.
         """
-        # TODO: not implemented yet
-        pass
+        ok, err = self.__mpy.getDevice().stopAccessPoint()
+        if ok:
+            EricMessageBox.information(
+                None,
+                self.tr("Stop WiFi Access Point"),
+                self.tr("The WiFi Access Point interface was stopped successfully."),
+            )
+        else:
+            msg = self.tr("<p>The WiFi Access Point could not be stopped.</p>")
+            if err:
+                msg += self.tr("<p>Reason: {0}").format(err)
+            EricMessageBox.critical(
+                None,
+                self.tr("Stop WiFi Access Point"),
+                msg,
+            )
 
     @pyqtSlot()
     def __showConnectedClients(self):
@@ -234,5 +248,19 @@
             or 'STA')
         @type str
         """
-        # TODO: not implemented yet
-        pass
+        ok, err = self.__mpy.getDevice().deactivateInterface(interface)
+        if ok:
+            EricMessageBox.information(
+                None,
+                self.tr("Deactivate WiFi Interface"),
+                self.tr("The WiFi interface was deactivated successfully."),
+            )
+        else:
+            msg = self.tr("<p>The WiFi interface could not be deactivated.</p>")
+            if err:
+                msg += self.tr("<p>Reason: {0}").format(err)
+            EricMessageBox.critical(
+                None,
+                self.tr("Deactivate WiFi Interface"),
+                msg,
+            )

eric ide

mercurial