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.__executeAsyncPaste">__executeAsyncPaste</a></td> |
|
77 <td>Private method to execute a series of commands over a period of time without returning any result (asynchronous execution).</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#MicroPythonDeviceInterface.__executeAsyncRaw">__executeAsyncRaw</a></td> |
|
81 <td>Private method to execute a series of commands over a period of time without returning any result (asynchronous execution).</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#MicroPythonDeviceInterface.__execute_paste">__execute_paste</a></td> |
|
85 <td>Private method to send commands to the connected device using 'paste' mode and return the result.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#MicroPythonDeviceInterface.__execute_raw">__execute_raw</a></td> |
|
89 <td>Private method to send commands to the connected device using 'raw REPL' mode and return the result.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#MicroPythonDeviceInterface.__pasteOff">__pasteOff</a></td> |
|
93 <td>Private method to switch 'paste' mode off.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#MicroPythonDeviceInterface.__pasteOn">__pasteOn</a></td> |
|
97 <td>Private method to switch the connected device to 'paste' mode.</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#MicroPythonDeviceInterface.__rawOff">__rawOff</a></td> |
|
101 <td>Private method to switch 'raw' mode off.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#MicroPythonDeviceInterface.__rawOn">__rawOn</a></td> |
|
105 <td>Private method to switch the connected device to 'raw' mode.</td> |
|
106 </tr> |
|
107 <tr> |
|
108 <td><a href="#MicroPythonDeviceInterface.__readSerial">__readSerial</a></td> |
|
109 <td>Private slot to read all available serial data and emit it with the "dataReceived" signal for further processing.</td> |
|
110 </tr> |
|
111 <tr> |
|
112 <td><a href="#MicroPythonDeviceInterface.connectToDevice">connectToDevice</a></td> |
76 <td><a href="#MicroPythonDeviceInterface.connectToDevice">connectToDevice</a></td> |
113 <td>Public slot to start the manager.</td> |
77 <td>Public slot to connect to the device.</td> |
114 </tr> |
78 </tr> |
115 <tr> |
79 <tr> |
116 <td><a href="#MicroPythonDeviceInterface.disconnectFromDevice">disconnectFromDevice</a></td> |
80 <td><a href="#MicroPythonDeviceInterface.disconnectFromDevice">disconnectFromDevice</a></td> |
117 <td>Public slot to stop the thread.</td> |
81 <td>Public slot to disconnect from the device.</td> |
118 </tr> |
82 </tr> |
119 <tr> |
83 <tr> |
120 <td><a href="#MicroPythonDeviceInterface.execute">execute</a></td> |
84 <td><a href="#MicroPythonDeviceInterface.execute">execute</a></td> |
121 <td>Public method to send commands to the connected device and return the result.</td> |
85 <td>Public method to send commands to the connected device and return the result.</td> |
122 </tr> |
86 </tr> |
159 <dt><i>parent</i> (QObject)</dt> |
123 <dt><i>parent</i> (QObject)</dt> |
160 <dd> |
124 <dd> |
161 reference to the parent object |
125 reference to the parent object |
162 </dd> |
126 </dd> |
163 </dl> |
127 </dl> |
164 <a NAME="MicroPythonDeviceInterface.__executeAsyncPaste" ID="MicroPythonDeviceInterface.__executeAsyncPaste"></a> |
|
165 <h4>MicroPythonDeviceInterface.__executeAsyncPaste</h4> |
|
166 <b>__executeAsyncPaste</b>(<i>commandsList</i>) |
|
167 |
|
168 <p> |
|
169 Private method to execute a series of commands over a period of time |
|
170 without returning any result (asynchronous execution). |
|
171 </p> |
|
172 <dl> |
|
173 |
|
174 <dt><i>commandsList</i> (list of str)</dt> |
|
175 <dd> |
|
176 list of commands to be execute on the device |
|
177 </dd> |
|
178 </dl> |
|
179 <a NAME="MicroPythonDeviceInterface.__executeAsyncRaw" ID="MicroPythonDeviceInterface.__executeAsyncRaw"></a> |
|
180 <h4>MicroPythonDeviceInterface.__executeAsyncRaw</h4> |
|
181 <b>__executeAsyncRaw</b>(<i>commandsList</i>) |
|
182 |
|
183 <p> |
|
184 Private method to execute a series of commands over a period of time |
|
185 without returning any result (asynchronous execution). |
|
186 </p> |
|
187 <dl> |
|
188 |
|
189 <dt><i>commandsList</i> (list of bytes)</dt> |
|
190 <dd> |
|
191 list of commands to be execute on the device |
|
192 </dd> |
|
193 </dl> |
|
194 <a NAME="MicroPythonDeviceInterface.__execute_paste" ID="MicroPythonDeviceInterface.__execute_paste"></a> |
|
195 <h4>MicroPythonDeviceInterface.__execute_paste</h4> |
|
196 <b>__execute_paste</b>(<i>commands, timeout=0</i>) |
|
197 |
|
198 <p> |
|
199 Private method to send commands to the connected device using 'paste' mode |
|
200 and return the result. |
|
201 </p> |
|
202 <p> |
|
203 If no serial connection is available, empty results will be returned. |
|
204 </p> |
|
205 <dl> |
|
206 |
|
207 <dt><i>commands</i> (str or list of str)</dt> |
|
208 <dd> |
|
209 list of commands to be executed |
|
210 </dd> |
|
211 <dt><i>timeout</i> (int (optional))</dt> |
|
212 <dd> |
|
213 per command timeout in milliseconds (0 for configured default) |
|
214 (defaults to 0) |
|
215 </dd> |
|
216 </dl> |
|
217 <dl> |
|
218 <dt>Return:</dt> |
|
219 <dd> |
|
220 tuple containing stdout and stderr output of the device |
|
221 </dd> |
|
222 </dl> |
|
223 <dl> |
|
224 <dt>Return Type:</dt> |
|
225 <dd> |
|
226 tuple of (bytes, bytes) |
|
227 </dd> |
|
228 </dl> |
|
229 <a NAME="MicroPythonDeviceInterface.__execute_raw" ID="MicroPythonDeviceInterface.__execute_raw"></a> |
|
230 <h4>MicroPythonDeviceInterface.__execute_raw</h4> |
|
231 <b>__execute_raw</b>(<i>commands, timeout=0</i>) |
|
232 |
|
233 <p> |
|
234 Private method to send commands to the connected device using 'raw REPL' mode |
|
235 and return the result. |
|
236 </p> |
|
237 <p> |
|
238 If no serial connection is available, empty results will be returned. |
|
239 </p> |
|
240 <dl> |
|
241 |
|
242 <dt><i>commands</i> (str or list of str)</dt> |
|
243 <dd> |
|
244 list of commands to be executed |
|
245 </dd> |
|
246 <dt><i>timeout</i> (int (optional))</dt> |
|
247 <dd> |
|
248 per command timeout in milliseconds (0 for configured default) |
|
249 (defaults to 0) |
|
250 </dd> |
|
251 </dl> |
|
252 <dl> |
|
253 <dt>Return:</dt> |
|
254 <dd> |
|
255 tuple containing stdout and stderr output of the device |
|
256 </dd> |
|
257 </dl> |
|
258 <dl> |
|
259 <dt>Return Type:</dt> |
|
260 <dd> |
|
261 tuple of (bytes, bytes) |
|
262 </dd> |
|
263 </dl> |
|
264 <a NAME="MicroPythonDeviceInterface.__pasteOff" ID="MicroPythonDeviceInterface.__pasteOff"></a> |
|
265 <h4>MicroPythonDeviceInterface.__pasteOff</h4> |
|
266 <b>__pasteOff</b>(<i></i>) |
|
267 |
|
268 <p> |
|
269 Private method to switch 'paste' mode off. |
|
270 </p> |
|
271 <a NAME="MicroPythonDeviceInterface.__pasteOn" ID="MicroPythonDeviceInterface.__pasteOn"></a> |
|
272 <h4>MicroPythonDeviceInterface.__pasteOn</h4> |
|
273 <b>__pasteOn</b>(<i></i>) |
|
274 |
|
275 <p> |
|
276 Private method to switch the connected device to 'paste' mode. |
|
277 </p> |
|
278 <p> |
|
279 Note: switching to paste mode is done with synchronous writes. |
|
280 </p> |
|
281 <dl> |
|
282 <dt>Return:</dt> |
|
283 <dd> |
|
284 flag indicating success |
|
285 </dd> |
|
286 </dl> |
|
287 <dl> |
|
288 <dt>Return Type:</dt> |
|
289 <dd> |
|
290 bool |
|
291 </dd> |
|
292 </dl> |
|
293 <a NAME="MicroPythonDeviceInterface.__rawOff" ID="MicroPythonDeviceInterface.__rawOff"></a> |
|
294 <h4>MicroPythonDeviceInterface.__rawOff</h4> |
|
295 <b>__rawOff</b>(<i></i>) |
|
296 |
|
297 <p> |
|
298 Private method to switch 'raw' mode off. |
|
299 </p> |
|
300 <a NAME="MicroPythonDeviceInterface.__rawOn" ID="MicroPythonDeviceInterface.__rawOn"></a> |
|
301 <h4>MicroPythonDeviceInterface.__rawOn</h4> |
|
302 <b>__rawOn</b>(<i></i>) |
|
303 |
|
304 <p> |
|
305 Private method to switch the connected device to 'raw' mode. |
|
306 </p> |
|
307 <p> |
|
308 Note: switching to raw mode is done with synchronous writes. |
|
309 </p> |
|
310 <dl> |
|
311 <dt>Return:</dt> |
|
312 <dd> |
|
313 flag indicating success |
|
314 </dd> |
|
315 </dl> |
|
316 <dl> |
|
317 <dt>Return Type:</dt> |
|
318 <dd> |
|
319 bool |
|
320 </dd> |
|
321 </dl> |
|
322 <a NAME="MicroPythonDeviceInterface.__readSerial" ID="MicroPythonDeviceInterface.__readSerial"></a> |
|
323 <h4>MicroPythonDeviceInterface.__readSerial</h4> |
|
324 <b>__readSerial</b>(<i></i>) |
|
325 |
|
326 <p> |
|
327 Private slot to read all available serial data and emit it with the |
|
328 "dataReceived" signal for further processing. |
|
329 </p> |
|
330 <a NAME="MicroPythonDeviceInterface.connectToDevice" ID="MicroPythonDeviceInterface.connectToDevice"></a> |
128 <a NAME="MicroPythonDeviceInterface.connectToDevice" ID="MicroPythonDeviceInterface.connectToDevice"></a> |
331 <h4>MicroPythonDeviceInterface.connectToDevice</h4> |
129 <h4>MicroPythonDeviceInterface.connectToDevice</h4> |
332 <b>connectToDevice</b>(<i>port</i>) |
130 <b>connectToDevice</b>(<i>connection</i>) |
333 |
131 |
334 <p> |
132 <p> |
335 Public slot to start the manager. |
133 Public slot to connect to the device. |
336 </p> |
134 </p> |
337 <dl> |
135 <dl> |
338 |
136 |
339 <dt><i>port</i> (str)</dt> |
137 <dt><i>connection</i> (str)</dt> |
340 <dd> |
138 <dd> |
341 name of the port to be used |
139 name of the connection to be used |
342 </dd> |
140 </dd> |
343 </dl> |
141 </dl> |
344 <dl> |
142 <dl> |
345 <dt>Return:</dt> |
143 <dt>Return:</dt> |
346 <dd> |
144 <dd> |
349 </dl> |
147 </dl> |
350 <dl> |
148 <dl> |
351 <dt>Return Type:</dt> |
149 <dt>Return Type:</dt> |
352 <dd> |
150 <dd> |
353 bool |
151 bool |
|
152 </dd> |
|
153 </dl> |
|
154 <dl> |
|
155 |
|
156 <dt>Raises <b>NotImplementedError</b>:</dt> |
|
157 <dd> |
|
158 raised to indicate that this method needs to |
|
159 be implemented in a derived class |
354 </dd> |
160 </dd> |
355 </dl> |
161 </dl> |
356 <a NAME="MicroPythonDeviceInterface.disconnectFromDevice" ID="MicroPythonDeviceInterface.disconnectFromDevice"></a> |
162 <a NAME="MicroPythonDeviceInterface.disconnectFromDevice" ID="MicroPythonDeviceInterface.disconnectFromDevice"></a> |
357 <h4>MicroPythonDeviceInterface.disconnectFromDevice</h4> |
163 <h4>MicroPythonDeviceInterface.disconnectFromDevice</h4> |
358 <b>disconnectFromDevice</b>(<i></i>) |
164 <b>disconnectFromDevice</b>(<i></i>) |
359 |
165 |
360 <p> |
166 <p> |
361 Public slot to stop the thread. |
167 Public slot to disconnect from the device. |
362 </p> |
168 </p> |
|
169 <dl> |
|
170 |
|
171 <dt>Raises <b>NotImplementedError</b>:</dt> |
|
172 <dd> |
|
173 raised to indicate that this method needs to |
|
174 be implemented in a derived class |
|
175 </dd> |
|
176 </dl> |
363 <a NAME="MicroPythonDeviceInterface.execute" ID="MicroPythonDeviceInterface.execute"></a> |
177 <a NAME="MicroPythonDeviceInterface.execute" ID="MicroPythonDeviceInterface.execute"></a> |
364 <h4>MicroPythonDeviceInterface.execute</h4> |
178 <h4>MicroPythonDeviceInterface.execute</h4> |
365 <b>execute</b>(<i>commands, *, mode="raw", timeout=0</i>) |
179 <b>execute</b>(<i>commands, *, mode="raw", timeout=0</i>) |
366 |
180 |
367 <p> |
181 <p> |
368 Public method to send commands to the connected device and return the |
182 Public method to send commands to the connected device and return the |
369 result. |
183 result. |
370 </p> |
184 </p> |
371 <p> |
185 <p> |
372 If no serial connection is available, empty results will be returned. |
186 If no connection is available, empty results will be returned. |
373 </p> |
187 </p> |
374 <dl> |
188 <dl> |
375 |
189 |
376 <dt><i>commands</i> (str or list of str)</dt> |
190 <dt><i>commands</i> (str or list of str)</dt> |
377 <dd> |
191 <dd> |