src/eric7/MicroPython/Devices/DeviceBase.py

branch
eric7
changeset 10328
2f394eb86dd6
parent 10230
1311cd5d117e
child 10329
a389b06170d2
equal deleted inserted replaced
10327:6b1e6d7b26f0 10328:2f394eb86dd6
1499 raise OSError(self._shortError(err)) 1499 raise OSError(self._shortError(err))
1500 1500
1501 return ast.literal_eval(out.decode("utf-8")) 1501 return ast.literal_eval(out.decode("utf-8"))
1502 1502
1503 ################################################################## 1503 ##################################################################
1504 ## Methods below general network related methods 1504 ## Methods below implement general network related methods
1505 ################################################################## 1505 ##################################################################
1506 1506
1507 def isNetworkConnected(self): 1507 def isNetworkConnected(self):
1508 """ 1508 """
1509 Public method to check, if the network interface (WiFi or Ethernet) is 1509 Public method to check, if the network interface (WiFi or Ethernet) is
1511 1511
1512 @return flag indicating the network connection state 1512 @return flag indicating the network connection state
1513 @rtype bool 1513 @rtype bool
1514 """ 1514 """
1515 # Ask the device if that is true. 1515 # Ask the device if that is true.
1516 if self.hasEthernet()[0]: 1516 if self._deviceData["ethernet"]:
1517 # It is an ethernet capable device.
1517 return self.isLanConnected() 1518 return self.isLanConnected()
1518 elif self.hasWifi(): 1519 elif self._deviceData["wifi"]:
1520 # It is a WiFi capable device.
1519 return self.isWifiClientConnected() 1521 return self.isWifiClientConnected()
1520 else: 1522 else:
1521 return False 1523 return False
1522 1524
1523 ################################################################## 1525 ##################################################################

eric ide

mercurial