--- a/src/eric7/Documentation/Source/eric7.MicroPython.MicroPythonDeviceInterface.html Thu Apr 27 17:59:09 2023 +0200 +++ b/src/eric7/Documentation/Source/eric7.MicroPython.MicroPythonDeviceInterface.html Fri Apr 28 12:07:41 2023 +0200 @@ -9,7 +9,7 @@ <h1>eric7.MicroPython.MicroPythonDeviceInterface</h1> <p> -Module implementing some file system commands for MicroPython. +Module implementing an interface base class to talk to a connected MicroPython device. </p> <h3>Global Attributes</h3> @@ -43,8 +43,8 @@ <dt>dataReceived(data)</dt> <dd> -emitted to send data received via the serial - connection for further processing +emitted to send data received via the connection + for further processing </dd> <dt>executeAsyncFinished()</dt> <dd> @@ -57,7 +57,7 @@ <h3>Class Attributes</h3> <table> -<tr><td>PasteModePrompt</td></tr><tr><td>TracebackMarker</td></tr> +<tr><td>None</td></tr> </table> <h3>Class Methods</h3> @@ -73,48 +73,12 @@ <td>Constructor</td> </tr> <tr> -<td><a href="#MicroPythonDeviceInterface.__executeAsyncPaste">__executeAsyncPaste</a></td> -<td>Private method to execute a series of commands over a period of time without returning any result (asynchronous execution).</td> -</tr> -<tr> -<td><a href="#MicroPythonDeviceInterface.__executeAsyncRaw">__executeAsyncRaw</a></td> -<td>Private method to execute a series of commands over a period of time without returning any result (asynchronous execution).</td> -</tr> -<tr> -<td><a href="#MicroPythonDeviceInterface.__execute_paste">__execute_paste</a></td> -<td>Private method to send commands to the connected device using 'paste' mode and return the result.</td> -</tr> -<tr> -<td><a href="#MicroPythonDeviceInterface.__execute_raw">__execute_raw</a></td> -<td>Private method to send commands to the connected device using 'raw REPL' mode and return the result.</td> -</tr> -<tr> -<td><a href="#MicroPythonDeviceInterface.__pasteOff">__pasteOff</a></td> -<td>Private method to switch 'paste' mode off.</td> -</tr> -<tr> -<td><a href="#MicroPythonDeviceInterface.__pasteOn">__pasteOn</a></td> -<td>Private method to switch the connected device to 'paste' mode.</td> -</tr> -<tr> -<td><a href="#MicroPythonDeviceInterface.__rawOff">__rawOff</a></td> -<td>Private method to switch 'raw' mode off.</td> -</tr> -<tr> -<td><a href="#MicroPythonDeviceInterface.__rawOn">__rawOn</a></td> -<td>Private method to switch the connected device to 'raw' mode.</td> -</tr> -<tr> -<td><a href="#MicroPythonDeviceInterface.__readSerial">__readSerial</a></td> -<td>Private slot to read all available serial data and emit it with the "dataReceived" signal for further processing.</td> -</tr> -<tr> <td><a href="#MicroPythonDeviceInterface.connectToDevice">connectToDevice</a></td> -<td>Public slot to start the manager.</td> +<td>Public slot to connect to the device.</td> </tr> <tr> <td><a href="#MicroPythonDeviceInterface.disconnectFromDevice">disconnectFromDevice</a></td> -<td>Public slot to stop the thread.</td> +<td>Public slot to disconnect from the device.</td> </tr> <tr> <td><a href="#MicroPythonDeviceInterface.execute">execute</a></td> @@ -161,184 +125,18 @@ reference to the parent object </dd> </dl> -<a NAME="MicroPythonDeviceInterface.__executeAsyncPaste" ID="MicroPythonDeviceInterface.__executeAsyncPaste"></a> -<h4>MicroPythonDeviceInterface.__executeAsyncPaste</h4> -<b>__executeAsyncPaste</b>(<i>commandsList</i>) - -<p> - Private method to execute a series of commands over a period of time - without returning any result (asynchronous execution). -</p> -<dl> - -<dt><i>commandsList</i> (list of str)</dt> -<dd> -list of commands to be execute on the device -</dd> -</dl> -<a NAME="MicroPythonDeviceInterface.__executeAsyncRaw" ID="MicroPythonDeviceInterface.__executeAsyncRaw"></a> -<h4>MicroPythonDeviceInterface.__executeAsyncRaw</h4> -<b>__executeAsyncRaw</b>(<i>commandsList</i>) - -<p> - Private method to execute a series of commands over a period of time - without returning any result (asynchronous execution). -</p> -<dl> - -<dt><i>commandsList</i> (list of bytes)</dt> -<dd> -list of commands to be execute on the device -</dd> -</dl> -<a NAME="MicroPythonDeviceInterface.__execute_paste" ID="MicroPythonDeviceInterface.__execute_paste"></a> -<h4>MicroPythonDeviceInterface.__execute_paste</h4> -<b>__execute_paste</b>(<i>commands, timeout=0</i>) +<a NAME="MicroPythonDeviceInterface.connectToDevice" ID="MicroPythonDeviceInterface.connectToDevice"></a> +<h4>MicroPythonDeviceInterface.connectToDevice</h4> +<b>connectToDevice</b>(<i>connection</i>) <p> - Private method to send commands to the connected device using 'paste' mode - and return the result. -</p> -<p> - If no serial connection is available, empty results will be returned. -</p> -<dl> - -<dt><i>commands</i> (str or list of str)</dt> -<dd> -list of commands to be executed -</dd> -<dt><i>timeout</i> (int (optional))</dt> -<dd> -per command timeout in milliseconds (0 for configured default) - (defaults to 0) -</dd> -</dl> -<dl> -<dt>Return:</dt> -<dd> -tuple containing stdout and stderr output of the device -</dd> -</dl> -<dl> -<dt>Return Type:</dt> -<dd> -tuple of (bytes, bytes) -</dd> -</dl> -<a NAME="MicroPythonDeviceInterface.__execute_raw" ID="MicroPythonDeviceInterface.__execute_raw"></a> -<h4>MicroPythonDeviceInterface.__execute_raw</h4> -<b>__execute_raw</b>(<i>commands, timeout=0</i>) - -<p> - Private method to send commands to the connected device using 'raw REPL' mode - and return the result. -</p> -<p> - If no serial connection is available, empty results will be returned. + Public slot to connect to the device. </p> <dl> -<dt><i>commands</i> (str or list of str)</dt> -<dd> -list of commands to be executed -</dd> -<dt><i>timeout</i> (int (optional))</dt> -<dd> -per command timeout in milliseconds (0 for configured default) - (defaults to 0) -</dd> -</dl> -<dl> -<dt>Return:</dt> -<dd> -tuple containing stdout and stderr output of the device -</dd> -</dl> -<dl> -<dt>Return Type:</dt> -<dd> -tuple of (bytes, bytes) -</dd> -</dl> -<a NAME="MicroPythonDeviceInterface.__pasteOff" ID="MicroPythonDeviceInterface.__pasteOff"></a> -<h4>MicroPythonDeviceInterface.__pasteOff</h4> -<b>__pasteOff</b>(<i></i>) - -<p> - Private method to switch 'paste' mode off. -</p> -<a NAME="MicroPythonDeviceInterface.__pasteOn" ID="MicroPythonDeviceInterface.__pasteOn"></a> -<h4>MicroPythonDeviceInterface.__pasteOn</h4> -<b>__pasteOn</b>(<i></i>) - -<p> - Private method to switch the connected device to 'paste' mode. -</p> -<p> - Note: switching to paste mode is done with synchronous writes. -</p> -<dl> -<dt>Return:</dt> -<dd> -flag indicating success -</dd> -</dl> -<dl> -<dt>Return Type:</dt> +<dt><i>connection</i> (str)</dt> <dd> -bool -</dd> -</dl> -<a NAME="MicroPythonDeviceInterface.__rawOff" ID="MicroPythonDeviceInterface.__rawOff"></a> -<h4>MicroPythonDeviceInterface.__rawOff</h4> -<b>__rawOff</b>(<i></i>) - -<p> - Private method to switch 'raw' mode off. -</p> -<a NAME="MicroPythonDeviceInterface.__rawOn" ID="MicroPythonDeviceInterface.__rawOn"></a> -<h4>MicroPythonDeviceInterface.__rawOn</h4> -<b>__rawOn</b>(<i></i>) - -<p> - Private method to switch the connected device to 'raw' mode. -</p> -<p> - Note: switching to raw mode is done with synchronous writes. -</p> -<dl> -<dt>Return:</dt> -<dd> -flag indicating success -</dd> -</dl> -<dl> -<dt>Return Type:</dt> -<dd> -bool -</dd> -</dl> -<a NAME="MicroPythonDeviceInterface.__readSerial" ID="MicroPythonDeviceInterface.__readSerial"></a> -<h4>MicroPythonDeviceInterface.__readSerial</h4> -<b>__readSerial</b>(<i></i>) - -<p> - Private slot to read all available serial data and emit it with the - "dataReceived" signal for further processing. -</p> -<a NAME="MicroPythonDeviceInterface.connectToDevice" ID="MicroPythonDeviceInterface.connectToDevice"></a> -<h4>MicroPythonDeviceInterface.connectToDevice</h4> -<b>connectToDevice</b>(<i>port</i>) - -<p> - Public slot to start the manager. -</p> -<dl> - -<dt><i>port</i> (str)</dt> -<dd> -name of the port to be used +name of the connection to be used </dd> </dl> <dl> @@ -353,13 +151,29 @@ bool </dd> </dl> +<dl> + +<dt>Raises <b>NotImplementedError</b>:</dt> +<dd> +raised to indicate that this method needs to + be implemented in a derived class +</dd> +</dl> <a NAME="MicroPythonDeviceInterface.disconnectFromDevice" ID="MicroPythonDeviceInterface.disconnectFromDevice"></a> <h4>MicroPythonDeviceInterface.disconnectFromDevice</h4> <b>disconnectFromDevice</b>(<i></i>) <p> - Public slot to stop the thread. + Public slot to disconnect from the device. </p> +<dl> + +<dt>Raises <b>NotImplementedError</b>:</dt> +<dd> +raised to indicate that this method needs to + be implemented in a derived class +</dd> +</dl> <a NAME="MicroPythonDeviceInterface.execute" ID="MicroPythonDeviceInterface.execute"></a> <h4>MicroPythonDeviceInterface.execute</h4> <b>execute</b>(<i>commands, *, mode="raw", timeout=0</i>) @@ -369,7 +183,7 @@ result. </p> <p> - If no serial connection is available, empty results will be returned. + If no connection is available, empty results will be returned. </p> <dl> @@ -402,6 +216,11 @@ </dl> <dl> +<dt>Raises <b>NotImplementedError</b>:</dt> +<dd> +raised to indicate that this method needs to + be implemented in a derived class +</dd> <dt>Raises <b>ValueError</b>:</dt> <dd> raised in case of an unsupported submit mode @@ -421,13 +240,19 @@ <dd> list of commands to be execute on the device </dd> -<dt><i>submitMode</i> (str (one of 'raw' or 'paste'))</dt> +<dt><i>submitMode</i> (str)</dt> <dd> -mode to be used to submit the commands +mode to be used to submit the commands (one of 'raw' + or 'paste') </dd> </dl> <dl> +<dt>Raises <b>NotImplementedError</b>:</dt> +<dd> +raised to indicate that this method needs to + be implemented in a derived class +</dd> <dt>Raises <b>ValueError</b>:</dt> <dd> raised to indicate an unknown submit mode @@ -459,6 +284,14 @@ bool </dd> </dl> +<dl> + +<dt>Raises <b>NotImplementedError</b>:</dt> +<dd> +raised to indicate that this method needs to + be implemented in a derived class +</dd> +</dl> <a NAME="MicroPythonDeviceInterface.probeDevice" ID="MicroPythonDeviceInterface.probeDevice"></a> <h4>MicroPythonDeviceInterface.probeDevice</h4> <b>probeDevice</b>(<i></i>) @@ -467,7 +300,7 @@ Public method to check the device is responding. </p> <p> - If the device has not been flashed with a MicroPython formware, the + If the device has not been flashed with a MicroPython firmware, the probe will fail. </p> <dl> @@ -482,6 +315,14 @@ bool </dd> </dl> +<dl> + +<dt>Raises <b>NotImplementedError</b>:</dt> +<dd> +raised to indicate that this method needs to + be implemented in a derived class +</dd> +</dl> <a NAME="MicroPythonDeviceInterface.write" ID="MicroPythonDeviceInterface.write"></a> <h4>MicroPythonDeviceInterface.write</h4> <b>write</b>(<i>data</i>) @@ -496,6 +337,14 @@ data to be written </dd> </dl> +<dl> + +<dt>Raises <b>NotImplementedError</b>:</dt> +<dd> +raised to indicate that this method needs to + be implemented in a derived class +</dd> +</dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html> \ No newline at end of file