1703 else: |
1703 else: |
1704 res = ast.literal_eval(out.decode("utf-8")) |
1704 res = ast.literal_eval(out.decode("utf-8")) |
1705 return res["result"], res["error"] |
1705 return res["result"], res["error"] |
1706 |
1706 |
1707 |
1707 |
1708 def createDevice( |
1708 def createDevice(microPythonWidget, deviceType, _vid, _pid, _boardName, _serialNumber): |
1709 microPythonWidget, deviceType, vid, pid, boardName, serialNumber # noqa: U100 |
|
1710 ): |
|
1711 """ |
1709 """ |
1712 Function to instantiate a MicroPython device object. |
1710 Function to instantiate a MicroPython device object. |
1713 |
1711 |
1714 @param microPythonWidget reference to the main MicroPython widget |
1712 @param microPythonWidget reference to the main MicroPython widget |
1715 @type MicroPythonWidget |
1713 @type MicroPythonWidget |
1716 @param deviceType device type assigned to this device interface |
1714 @param deviceType device type assigned to this device interface |
1717 @type str |
1715 @type str |
1718 @param vid vendor ID |
1716 @param _vid vendor ID (unused) |
1719 @type int |
1717 @type int |
1720 @param pid product ID |
1718 @param _pid product ID (unused) |
1721 @type int |
1719 @type int |
1722 @param boardName name of the board |
1720 @param _boardName name of the board (unused) |
1723 @type str |
1721 @type str |
1724 @param serialNumber serial number of the board |
1722 @param _serialNumber serial number of the board (unused) |
1725 @type str |
1723 @type str |
1726 @return reference to the instantiated device object |
1724 @return reference to the instantiated device object |
1727 @rtype EspDevice |
1725 @rtype EspDevice |
1728 """ |
1726 """ |
1729 return EspDevice(microPythonWidget, deviceType) |
1727 return EspDevice(microPythonWidget, deviceType) |