71 <tr> |
71 <tr> |
72 <td><a href="#MicroPythonDeviceInterface.__init__">MicroPythonDeviceInterface</a></td> |
72 <td><a href="#MicroPythonDeviceInterface.__init__">MicroPythonDeviceInterface</a></td> |
73 <td>Constructor</td> |
73 <td>Constructor</td> |
74 </tr> |
74 </tr> |
75 <tr> |
75 <tr> |
|
76 <td><a href="#MicroPythonDeviceInterface.__execute_paste">__execute_paste</a></td> |
|
77 <td>Private method to send commands to the connected device using 'paste' mode and return the result.</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#MicroPythonDeviceInterface.__execute_raw">__execute_raw</a></td> |
|
81 <td>Private method to send commands to the connected device using 'raw REPL' mode and return the result.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#MicroPythonDeviceInterface.__pasteOff">__pasteOff</a></td> |
|
85 <td>Private method to switch 'paste' mode off.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#MicroPythonDeviceInterface.__pasteOn">__pasteOn</a></td> |
|
89 <td>Private method to switch the connected device to 'paste' mode.</td> |
|
90 </tr> |
|
91 <tr> |
76 <td><a href="#MicroPythonDeviceInterface.__rawOff">__rawOff</a></td> |
92 <td><a href="#MicroPythonDeviceInterface.__rawOff">__rawOff</a></td> |
77 <td>Private method to switch 'raw' mode off.</td> |
93 <td>Private method to switch 'raw' mode off.</td> |
78 </tr> |
94 </tr> |
79 <tr> |
95 <tr> |
80 <td><a href="#MicroPythonDeviceInterface.__rawOn">__rawOn</a></td> |
96 <td><a href="#MicroPythonDeviceInterface.__rawOn">__rawOn</a></td> |
96 <td><a href="#MicroPythonDeviceInterface.execute">execute</a></td> |
112 <td><a href="#MicroPythonDeviceInterface.execute">execute</a></td> |
97 <td>Public method to send commands to the connected device and return the result.</td> |
113 <td>Public method to send commands to the connected device and return the result.</td> |
98 </tr> |
114 </tr> |
99 <tr> |
115 <tr> |
100 <td><a href="#MicroPythonDeviceInterface.executeAsync">executeAsync</a></td> |
116 <td><a href="#MicroPythonDeviceInterface.executeAsync">executeAsync</a></td> |
|
117 <td>Public method to execute a series of commands over a period of time without returning any result (asynchronous execution).</td> |
|
118 </tr> |
|
119 <tr> |
|
120 <td><a href="#MicroPythonDeviceInterface.executeAsyncPaste">executeAsyncPaste</a></td> |
101 <td>Public method to execute a series of commands over a period of time without returning any result (asynchronous execution).</td> |
121 <td>Public method to execute a series of commands over a period of time without returning any result (asynchronous execution).</td> |
102 </tr> |
122 </tr> |
103 <tr> |
123 <tr> |
104 <td><a href="#MicroPythonDeviceInterface.handlePreferencesChanged">handlePreferencesChanged</a></td> |
124 <td><a href="#MicroPythonDeviceInterface.handlePreferencesChanged">handlePreferencesChanged</a></td> |
105 <td>Public slot to handle a change of the preferences.</td> |
125 <td>Public slot to handle a change of the preferences.</td> |
135 <dt><i>parent</i> (QObject)</dt> |
155 <dt><i>parent</i> (QObject)</dt> |
136 <dd> |
156 <dd> |
137 reference to the parent object |
157 reference to the parent object |
138 </dd> |
158 </dd> |
139 </dl> |
159 </dl> |
|
160 <a NAME="MicroPythonDeviceInterface.__execute_paste" ID="MicroPythonDeviceInterface.__execute_paste"></a> |
|
161 <h4>MicroPythonDeviceInterface.__execute_paste</h4> |
|
162 <b>__execute_paste</b>(<i>commands, timeout=0</i>) |
|
163 |
|
164 <p> |
|
165 Private method to send commands to the connected device using 'paste' mode |
|
166 and return the result. |
|
167 </p> |
|
168 <p> |
|
169 If no serial connection is available, empty results will be returned. |
|
170 </p> |
|
171 <dl> |
|
172 |
|
173 <dt><i>commands</i> (str or list of str)</dt> |
|
174 <dd> |
|
175 list of commands to be executed |
|
176 </dd> |
|
177 <dt><i>timeout</i> (int (optional))</dt> |
|
178 <dd> |
|
179 per command timeout in milliseconds (0 for configured default) |
|
180 (defaults to 0) |
|
181 </dd> |
|
182 </dl> |
|
183 <dl> |
|
184 <dt>Return:</dt> |
|
185 <dd> |
|
186 tuple containing stdout and stderr output of the device |
|
187 </dd> |
|
188 </dl> |
|
189 <dl> |
|
190 <dt>Return Type:</dt> |
|
191 <dd> |
|
192 tuple of (bytes, bytes) |
|
193 </dd> |
|
194 </dl> |
|
195 <a NAME="MicroPythonDeviceInterface.__execute_raw" ID="MicroPythonDeviceInterface.__execute_raw"></a> |
|
196 <h4>MicroPythonDeviceInterface.__execute_raw</h4> |
|
197 <b>__execute_raw</b>(<i>commands, timeout=0</i>) |
|
198 |
|
199 <p> |
|
200 Private method to send commands to the connected device using 'raw REPL' mode |
|
201 and return the result. |
|
202 </p> |
|
203 <p> |
|
204 If no serial connection is available, empty results will be returned. |
|
205 </p> |
|
206 <dl> |
|
207 |
|
208 <dt><i>commands</i> (str or list of str)</dt> |
|
209 <dd> |
|
210 list of commands to be executed |
|
211 </dd> |
|
212 <dt><i>timeout</i> (int (optional))</dt> |
|
213 <dd> |
|
214 per command timeout in milliseconds (0 for configured default) |
|
215 (defaults to 0) |
|
216 </dd> |
|
217 </dl> |
|
218 <dl> |
|
219 <dt>Return:</dt> |
|
220 <dd> |
|
221 tuple containing stdout and stderr output of the device |
|
222 </dd> |
|
223 </dl> |
|
224 <dl> |
|
225 <dt>Return Type:</dt> |
|
226 <dd> |
|
227 tuple of (bytes, bytes) |
|
228 </dd> |
|
229 </dl> |
|
230 <a NAME="MicroPythonDeviceInterface.__pasteOff" ID="MicroPythonDeviceInterface.__pasteOff"></a> |
|
231 <h4>MicroPythonDeviceInterface.__pasteOff</h4> |
|
232 <b>__pasteOff</b>(<i></i>) |
|
233 |
|
234 <p> |
|
235 Private method to switch 'paste' mode off. |
|
236 </p> |
|
237 <a NAME="MicroPythonDeviceInterface.__pasteOn" ID="MicroPythonDeviceInterface.__pasteOn"></a> |
|
238 <h4>MicroPythonDeviceInterface.__pasteOn</h4> |
|
239 <b>__pasteOn</b>(<i></i>) |
|
240 |
|
241 <p> |
|
242 Private method to switch the connected device to 'paste' mode. |
|
243 </p> |
|
244 <p> |
|
245 Note: switching to paste mode is done with synchronous writes. |
|
246 </p> |
|
247 <dl> |
|
248 <dt>Return:</dt> |
|
249 <dd> |
|
250 flag indicating success |
|
251 </dd> |
|
252 </dl> |
|
253 <dl> |
|
254 <dt>Return Type:</dt> |
|
255 <dd> |
|
256 bool |
|
257 </dd> |
|
258 </dl> |
140 <a NAME="MicroPythonDeviceInterface.__rawOff" ID="MicroPythonDeviceInterface.__rawOff"></a> |
259 <a NAME="MicroPythonDeviceInterface.__rawOff" ID="MicroPythonDeviceInterface.__rawOff"></a> |
141 <h4>MicroPythonDeviceInterface.__rawOff</h4> |
260 <h4>MicroPythonDeviceInterface.__rawOff</h4> |
142 <b>__rawOff</b>(<i></i>) |
261 <b>__rawOff</b>(<i></i>) |
143 |
262 |
144 <p> |
263 <p> |
202 <p> |
326 <p> |
203 Public slot to stop the thread. |
327 Public slot to stop the thread. |
204 </p> |
328 </p> |
205 <a NAME="MicroPythonDeviceInterface.execute" ID="MicroPythonDeviceInterface.execute"></a> |
329 <a NAME="MicroPythonDeviceInterface.execute" ID="MicroPythonDeviceInterface.execute"></a> |
206 <h4>MicroPythonDeviceInterface.execute</h4> |
330 <h4>MicroPythonDeviceInterface.execute</h4> |
207 <b>execute</b>(<i>commands</i>) |
331 <b>execute</b>(<i>commands, *, mode="raw", timeout=0</i>) |
208 |
332 |
209 <p> |
333 <p> |
210 Public method to send commands to the connected device and return the |
334 Public method to send commands to the connected device and return the |
211 result. |
335 result. |
212 </p> |
336 </p> |
228 </dl> |
362 </dl> |
229 <dl> |
363 <dl> |
230 <dt>Return Type:</dt> |
364 <dt>Return Type:</dt> |
231 <dd> |
365 <dd> |
232 tuple of (bytes, bytes) |
366 tuple of (bytes, bytes) |
|
367 </dd> |
|
368 </dl> |
|
369 <dl> |
|
370 |
|
371 <dt>Raises <b>ValueError</b>:</dt> |
|
372 <dd> |
|
373 raised in case of an unsupported submit mode |
233 </dd> |
374 </dd> |
234 </dl> |
375 </dl> |
235 <a NAME="MicroPythonDeviceInterface.executeAsync" ID="MicroPythonDeviceInterface.executeAsync"></a> |
376 <a NAME="MicroPythonDeviceInterface.executeAsync" ID="MicroPythonDeviceInterface.executeAsync"></a> |
236 <h4>MicroPythonDeviceInterface.executeAsync</h4> |
377 <h4>MicroPythonDeviceInterface.executeAsync</h4> |
237 <b>executeAsync</b>(<i>commandsList</i>) |
378 <b>executeAsync</b>(<i>commandsList</i>) |
245 <dt><i>commandsList</i> (list of bytes)</dt> |
386 <dt><i>commandsList</i> (list of bytes)</dt> |
246 <dd> |
387 <dd> |
247 list of commands to be execute on the device |
388 list of commands to be execute on the device |
248 </dd> |
389 </dd> |
249 </dl> |
390 </dl> |
|
391 <a NAME="MicroPythonDeviceInterface.executeAsyncPaste" ID="MicroPythonDeviceInterface.executeAsyncPaste"></a> |
|
392 <h4>MicroPythonDeviceInterface.executeAsyncPaste</h4> |
|
393 <b>executeAsyncPaste</b>(<i>commandsList</i>) |
|
394 |
|
395 <p> |
|
396 Public method to execute a series of commands over a period of time |
|
397 without returning any result (asynchronous execution). |
|
398 </p> |
|
399 <dl> |
|
400 |
|
401 <dt><i>commandsList</i> (list of bytes)</dt> |
|
402 <dd> |
|
403 list of commands to be execute on the device |
|
404 </dd> |
|
405 </dl> |
250 <a NAME="MicroPythonDeviceInterface.handlePreferencesChanged" ID="MicroPythonDeviceInterface.handlePreferencesChanged"></a> |
406 <a NAME="MicroPythonDeviceInterface.handlePreferencesChanged" ID="MicroPythonDeviceInterface.handlePreferencesChanged"></a> |
251 <h4>MicroPythonDeviceInterface.handlePreferencesChanged</h4> |
407 <h4>MicroPythonDeviceInterface.handlePreferencesChanged</h4> |
252 <b>handlePreferencesChanged</b>(<i></i>) |
408 <b>handlePreferencesChanged</b>(<i></i>) |
253 |
409 |
254 <p> |
410 <p> |