src/eric7/MicroPython/Devices/DeviceBase.py

branch
eric7
changeset 10138
56614cf9d03c
parent 10095
0e6da289da44
child 10144
45a9177c8e77
diff -r fe5195fba5f7 -r 56614cf9d03c src/eric7/MicroPython/Devices/DeviceBase.py
--- a/src/eric7/MicroPython/Devices/DeviceBase.py	Sat Jul 29 16:45:57 2023 +0200
+++ b/src/eric7/MicroPython/Devices/DeviceBase.py	Sat Jul 29 19:27:18 2023 +0200
@@ -121,6 +121,7 @@
         self._interface = None
         self.microPython = microPythonWidget
         self._deviceData = {}  # dictionary with essential device data
+        self._networkConnected = False  # trace the network connection status
 
         self._submitMode = "raw"  # default is 'raw' mode to submit commands
 
@@ -227,6 +228,16 @@
             and self._deviceData["mpy_name"].lower() == "circuitpython"
         )
 
+    def isNetworkConnected(self):
+        """
+        Public method to check, if the network interface (WiFi or Ethernet) is
+        connected.
+
+        @return flag indicating the network connection state
+        @rtype bool
+        """
+        return self._networkConnected
+
     def submitMode(self):
         """
         Public method to get the submit mode of the device.

eric ide

mercurial