119 |
119 |
120 self._deviceType = deviceType |
120 self._deviceType = deviceType |
121 self._interface = None |
121 self._interface = None |
122 self.microPython = microPythonWidget |
122 self.microPython = microPythonWidget |
123 self._deviceData = {} # dictionary with essential device data |
123 self._deviceData = {} # dictionary with essential device data |
|
124 self._networkConnected = False # trace the network connection status |
124 |
125 |
125 self._submitMode = "raw" # default is 'raw' mode to submit commands |
126 self._submitMode = "raw" # default is 'raw' mode to submit commands |
126 |
127 |
127 def setConnected(self, connected): |
128 def setConnected(self, connected): |
128 """ |
129 """ |
224 """ |
225 """ |
225 return ( |
226 return ( |
226 self.checkDeviceData() |
227 self.checkDeviceData() |
227 and self._deviceData["mpy_name"].lower() == "circuitpython" |
228 and self._deviceData["mpy_name"].lower() == "circuitpython" |
228 ) |
229 ) |
|
230 |
|
231 def isNetworkConnected(self): |
|
232 """ |
|
233 Public method to check, if the network interface (WiFi or Ethernet) is |
|
234 connected. |
|
235 |
|
236 @return flag indicating the network connection state |
|
237 @rtype bool |
|
238 """ |
|
239 return self._networkConnected |
229 |
240 |
230 def submitMode(self): |
241 def submitMode(self): |
231 """ |
242 """ |
232 Public method to get the submit mode of the device. |
243 Public method to get the submit mode of the device. |
233 |
244 |