|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.MicroPython.MicroPythonCommandsInterface</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.MicroPython.MicroPythonCommandsInterface</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing some file system commands for MicroPython. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#MicroPythonCommandsInterface">MicroPythonCommandsInterface</a></td> |
|
25 <td>Class implementing some file system commands for MicroPython.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="MicroPythonCommandsInterface" ID="MicroPythonCommandsInterface"></a> |
|
36 <h2>MicroPythonCommandsInterface</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing some file system commands for MicroPython. |
|
40 </p> |
|
41 <p> |
|
42 Commands are provided to perform operations on the file system of a |
|
43 connected MicroPython device. Supported commands are: |
|
44 <ul> |
|
45 <li>ls: directory listing</li> |
|
46 <li>lls: directory listing with meta data</li> |
|
47 <li>cd: change directory</li> |
|
48 <li>pwd: get the current directory</li> |
|
49 <li>put: copy a file to the connected device</li> |
|
50 <li>get: get a file from the connected device</li> |
|
51 <li>rm: remove a file from the connected device</li> |
|
52 <li>rmrf: remove a file/directory recursively (like 'rm -rf' in bash) |
|
53 <li>mkdir: create a new directory</li> |
|
54 <li>rmdir: remove an empty directory</li> |
|
55 </ul> |
|
56 </p> |
|
57 <p> |
|
58 There are additional commands related to time and version. |
|
59 <ul> |
|
60 <li>version: get version info about MicroPython</li> |
|
61 <li>getImplementation: get some implementation information</li> |
|
62 <li>syncTime: synchronize the time of the connected device</li> |
|
63 <li>showTime: show the current time of the connected device</li> |
|
64 </ul> |
|
65 </p> |
|
66 <h3>Signals</h3> |
|
67 <dl> |
|
68 |
|
69 <dt>dataReceived(data)</dt> |
|
70 <dd> |
|
71 emitted to send data received via the serial |
|
72 connection for further processing |
|
73 </dd> |
|
74 <dt>executeAsyncFinished()</dt> |
|
75 <dd> |
|
76 emitted to indicate the end of an |
|
77 asynchronously executed list of commands (e.g. a script) |
|
78 </dd> |
|
79 </dl> |
|
80 <h3>Derived from</h3> |
|
81 QObject |
|
82 <h3>Class Attributes</h3> |
|
83 |
|
84 <table> |
|
85 <tr><td>None</td></tr> |
|
86 </table> |
|
87 <h3>Class Methods</h3> |
|
88 |
|
89 <table> |
|
90 <tr><td>None</td></tr> |
|
91 </table> |
|
92 <h3>Methods</h3> |
|
93 |
|
94 <table> |
|
95 |
|
96 <tr> |
|
97 <td><a href="#MicroPythonCommandsInterface.__init__">MicroPythonCommandsInterface</a></td> |
|
98 <td>Constructor</td> |
|
99 </tr> |
|
100 <tr> |
|
101 <td><a href="#MicroPythonCommandsInterface.__rawOff">__rawOff</a></td> |
|
102 <td>Private method to switch 'raw' mode off.</td> |
|
103 </tr> |
|
104 <tr> |
|
105 <td><a href="#MicroPythonCommandsInterface.__rawOn">__rawOn</a></td> |
|
106 <td>Private method to switch the connected device to 'raw' mode.</td> |
|
107 </tr> |
|
108 <tr> |
|
109 <td><a href="#MicroPythonCommandsInterface.__readSerial">__readSerial</a></td> |
|
110 <td>Private slot to read all available serial data and emit it with the "dataReceived" signal for further processing.</td> |
|
111 </tr> |
|
112 <tr> |
|
113 <td><a href="#MicroPythonCommandsInterface.__shortError">__shortError</a></td> |
|
114 <td>Private method to create a shortened error message.</td> |
|
115 </tr> |
|
116 <tr> |
|
117 <td><a href="#MicroPythonCommandsInterface.cd">cd</a></td> |
|
118 <td>Public method to change the current directory on the connected device.</td> |
|
119 </tr> |
|
120 <tr> |
|
121 <td><a href="#MicroPythonCommandsInterface.connectToDevice">connectToDevice</a></td> |
|
122 <td>Public slot to start the manager.</td> |
|
123 </tr> |
|
124 <tr> |
|
125 <td><a href="#MicroPythonCommandsInterface.disconnectFromDevice">disconnectFromDevice</a></td> |
|
126 <td>Public slot to stop the thread.</td> |
|
127 </tr> |
|
128 <tr> |
|
129 <td><a href="#MicroPythonCommandsInterface.execute">execute</a></td> |
|
130 <td>Public method to send commands to the connected device and return the result.</td> |
|
131 </tr> |
|
132 <tr> |
|
133 <td><a href="#MicroPythonCommandsInterface.executeAsync">executeAsync</a></td> |
|
134 <td>Public method to execute a series of commands over a period of time without returning any result (asynchronous execution).</td> |
|
135 </tr> |
|
136 <tr> |
|
137 <td><a href="#MicroPythonCommandsInterface.fileSystemInfo">fileSystemInfo</a></td> |
|
138 <td>Public method to obtain information about the currently mounted file systems.</td> |
|
139 </tr> |
|
140 <tr> |
|
141 <td><a href="#MicroPythonCommandsInterface.get">get</a></td> |
|
142 <td>Public method to copy a file from the connected device.</td> |
|
143 </tr> |
|
144 <tr> |
|
145 <td><a href="#MicroPythonCommandsInterface.getBoardInformation">getBoardInformation</a></td> |
|
146 <td>Public method to get some information data of the connected board.</td> |
|
147 </tr> |
|
148 <tr> |
|
149 <td><a href="#MicroPythonCommandsInterface.getImplementation">getImplementation</a></td> |
|
150 <td>Public method to get some implementation information of the connected device.</td> |
|
151 </tr> |
|
152 <tr> |
|
153 <td><a href="#MicroPythonCommandsInterface.getTime">getTime</a></td> |
|
154 <td>Public method to get the current time of the device.</td> |
|
155 </tr> |
|
156 <tr> |
|
157 <td><a href="#MicroPythonCommandsInterface.handlePreferencesChanged">handlePreferencesChanged</a></td> |
|
158 <td>Public slot to handle a change of the preferences.</td> |
|
159 </tr> |
|
160 <tr> |
|
161 <td><a href="#MicroPythonCommandsInterface.isConnected">isConnected</a></td> |
|
162 <td>Public method to get the connection status.</td> |
|
163 </tr> |
|
164 <tr> |
|
165 <td><a href="#MicroPythonCommandsInterface.lls">lls</a></td> |
|
166 <td>Public method to get a long directory listing of the connected device including meta data.</td> |
|
167 </tr> |
|
168 <tr> |
|
169 <td><a href="#MicroPythonCommandsInterface.ls">ls</a></td> |
|
170 <td>Public method to get a directory listing of the connected device.</td> |
|
171 </tr> |
|
172 <tr> |
|
173 <td><a href="#MicroPythonCommandsInterface.mkdir">mkdir</a></td> |
|
174 <td>Public method to create a new directory.</td> |
|
175 </tr> |
|
176 <tr> |
|
177 <td><a href="#MicroPythonCommandsInterface.put">put</a></td> |
|
178 <td>Public method to copy a local file to the connected device.</td> |
|
179 </tr> |
|
180 <tr> |
|
181 <td><a href="#MicroPythonCommandsInterface.pwd">pwd</a></td> |
|
182 <td>Public method to get the current directory of the connected device.</td> |
|
183 </tr> |
|
184 <tr> |
|
185 <td><a href="#MicroPythonCommandsInterface.remainingTask">remainingTask</a></td> |
|
186 <td></td> |
|
187 </tr> |
|
188 <tr> |
|
189 <td><a href="#MicroPythonCommandsInterface.rm">rm</a></td> |
|
190 <td>Public method to remove a file from the connected device.</td> |
|
191 </tr> |
|
192 <tr> |
|
193 <td><a href="#MicroPythonCommandsInterface.rmdir">rmdir</a></td> |
|
194 <td>Public method to remove a directory.</td> |
|
195 </tr> |
|
196 <tr> |
|
197 <td><a href="#MicroPythonCommandsInterface.rmrf">rmrf</a></td> |
|
198 <td>Public method to remove a file or directory recursively.</td> |
|
199 </tr> |
|
200 <tr> |
|
201 <td><a href="#MicroPythonCommandsInterface.syncTime">syncTime</a></td> |
|
202 <td>Public method to set the time of the connected device to the local computer's time.</td> |
|
203 </tr> |
|
204 <tr> |
|
205 <td><a href="#MicroPythonCommandsInterface.version">version</a></td> |
|
206 <td>Public method to get the MicroPython version information of the connected device.</td> |
|
207 </tr> |
|
208 <tr> |
|
209 <td><a href="#MicroPythonCommandsInterface.write">write</a></td> |
|
210 <td>Public method to write data to the connected device.</td> |
|
211 </tr> |
|
212 </table> |
|
213 <h3>Static Methods</h3> |
|
214 |
|
215 <table> |
|
216 <tr><td>None</td></tr> |
|
217 </table> |
|
218 |
|
219 <a NAME="MicroPythonCommandsInterface.__init__" ID="MicroPythonCommandsInterface.__init__"></a> |
|
220 <h4>MicroPythonCommandsInterface (Constructor)</h4> |
|
221 <b>MicroPythonCommandsInterface</b>(<i>parent=None</i>) |
|
222 |
|
223 <p> |
|
224 Constructor |
|
225 </p> |
|
226 <dl> |
|
227 |
|
228 <dt><i>parent</i> (QObject)</dt> |
|
229 <dd> |
|
230 reference to the parent object |
|
231 </dd> |
|
232 </dl> |
|
233 <a NAME="MicroPythonCommandsInterface.__rawOff" ID="MicroPythonCommandsInterface.__rawOff"></a> |
|
234 <h4>MicroPythonCommandsInterface.__rawOff</h4> |
|
235 <b>__rawOff</b>(<i></i>) |
|
236 |
|
237 <p> |
|
238 Private method to switch 'raw' mode off. |
|
239 </p> |
|
240 <a NAME="MicroPythonCommandsInterface.__rawOn" ID="MicroPythonCommandsInterface.__rawOn"></a> |
|
241 <h4>MicroPythonCommandsInterface.__rawOn</h4> |
|
242 <b>__rawOn</b>(<i></i>) |
|
243 |
|
244 <p> |
|
245 Private method to switch the connected device to 'raw' mode. |
|
246 </p> |
|
247 <p> |
|
248 Note: switching to raw mode is done with synchronous writes. |
|
249 </p> |
|
250 <dl> |
|
251 <dt>Return:</dt> |
|
252 <dd> |
|
253 flag indicating success |
|
254 @rtype bool |
|
255 </dd> |
|
256 </dl> |
|
257 <a NAME="MicroPythonCommandsInterface.__readSerial" ID="MicroPythonCommandsInterface.__readSerial"></a> |
|
258 <h4>MicroPythonCommandsInterface.__readSerial</h4> |
|
259 <b>__readSerial</b>(<i></i>) |
|
260 |
|
261 <p> |
|
262 Private slot to read all available serial data and emit it with the |
|
263 "dataReceived" signal for further processing. |
|
264 </p> |
|
265 <a NAME="MicroPythonCommandsInterface.__shortError" ID="MicroPythonCommandsInterface.__shortError"></a> |
|
266 <h4>MicroPythonCommandsInterface.__shortError</h4> |
|
267 <b>__shortError</b>(<i>error</i>) |
|
268 |
|
269 <p> |
|
270 Private method to create a shortened error message. |
|
271 </p> |
|
272 <dl> |
|
273 |
|
274 <dt><i>error</i> (bytes)</dt> |
|
275 <dd> |
|
276 verbose error message |
|
277 </dd> |
|
278 </dl> |
|
279 <dl> |
|
280 <dt>Return:</dt> |
|
281 <dd> |
|
282 shortened error message |
|
283 </dd> |
|
284 </dl> |
|
285 <dl> |
|
286 <dt>Return Type:</dt> |
|
287 <dd> |
|
288 str |
|
289 </dd> |
|
290 </dl> |
|
291 <a NAME="MicroPythonCommandsInterface.cd" ID="MicroPythonCommandsInterface.cd"></a> |
|
292 <h4>MicroPythonCommandsInterface.cd</h4> |
|
293 <b>cd</b>(<i>dirname</i>) |
|
294 |
|
295 <p> |
|
296 Public method to change the current directory on the connected device. |
|
297 </p> |
|
298 <dl> |
|
299 |
|
300 <dt><i>dirname</i> (str)</dt> |
|
301 <dd> |
|
302 directory to change to |
|
303 </dd> |
|
304 </dl> |
|
305 <dl> |
|
306 |
|
307 <dt>Raises <b>OSError</b>:</dt> |
|
308 <dd> |
|
309 raised to indicate an issue with the device |
|
310 </dd> |
|
311 </dl> |
|
312 <a NAME="MicroPythonCommandsInterface.connectToDevice" ID="MicroPythonCommandsInterface.connectToDevice"></a> |
|
313 <h4>MicroPythonCommandsInterface.connectToDevice</h4> |
|
314 <b>connectToDevice</b>(<i>port</i>) |
|
315 |
|
316 <p> |
|
317 Public slot to start the manager. |
|
318 </p> |
|
319 <dl> |
|
320 |
|
321 <dt><i>port</i> (str)</dt> |
|
322 <dd> |
|
323 name of the port to be used |
|
324 </dd> |
|
325 </dl> |
|
326 <dl> |
|
327 <dt>Return:</dt> |
|
328 <dd> |
|
329 flag indicating success |
|
330 </dd> |
|
331 </dl> |
|
332 <dl> |
|
333 <dt>Return Type:</dt> |
|
334 <dd> |
|
335 bool |
|
336 </dd> |
|
337 </dl> |
|
338 <a NAME="MicroPythonCommandsInterface.disconnectFromDevice" ID="MicroPythonCommandsInterface.disconnectFromDevice"></a> |
|
339 <h4>MicroPythonCommandsInterface.disconnectFromDevice</h4> |
|
340 <b>disconnectFromDevice</b>(<i></i>) |
|
341 |
|
342 <p> |
|
343 Public slot to stop the thread. |
|
344 </p> |
|
345 <a NAME="MicroPythonCommandsInterface.execute" ID="MicroPythonCommandsInterface.execute"></a> |
|
346 <h4>MicroPythonCommandsInterface.execute</h4> |
|
347 <b>execute</b>(<i>commands</i>) |
|
348 |
|
349 <p> |
|
350 Public method to send commands to the connected device and return the |
|
351 result. |
|
352 </p> |
|
353 <p> |
|
354 If no serial connection is available, empty results will be returned. |
|
355 </p> |
|
356 <dl> |
|
357 |
|
358 <dt><i>commands</i> (str)</dt> |
|
359 <dd> |
|
360 list of commands to be executed |
|
361 </dd> |
|
362 </dl> |
|
363 <dl> |
|
364 <dt>Return:</dt> |
|
365 <dd> |
|
366 tuple containing stdout and stderr output of the device |
|
367 </dd> |
|
368 </dl> |
|
369 <dl> |
|
370 <dt>Return Type:</dt> |
|
371 <dd> |
|
372 tuple of (bytes, bytes) |
|
373 </dd> |
|
374 </dl> |
|
375 <a NAME="MicroPythonCommandsInterface.executeAsync" ID="MicroPythonCommandsInterface.executeAsync"></a> |
|
376 <h4>MicroPythonCommandsInterface.executeAsync</h4> |
|
377 <b>executeAsync</b>(<i>commandsList</i>) |
|
378 |
|
379 <p> |
|
380 Public method to execute a series of commands over a period of time |
|
381 without returning any result (asynchronous execution). |
|
382 </p> |
|
383 <dl> |
|
384 |
|
385 <dt><i>commandsList</i> (list of bytes)</dt> |
|
386 <dd> |
|
387 list of commands to be execute on the device |
|
388 </dd> |
|
389 </dl> |
|
390 <a NAME="MicroPythonCommandsInterface.fileSystemInfo" ID="MicroPythonCommandsInterface.fileSystemInfo"></a> |
|
391 <h4>MicroPythonCommandsInterface.fileSystemInfo</h4> |
|
392 <b>fileSystemInfo</b>(<i></i>) |
|
393 |
|
394 <p> |
|
395 Public method to obtain information about the currently mounted file |
|
396 systems. |
|
397 </p> |
|
398 <dl> |
|
399 <dt>Return:</dt> |
|
400 <dd> |
|
401 tuple of tuples containing the file system name, the total |
|
402 size, the used size and the free size |
|
403 </dd> |
|
404 </dl> |
|
405 <dl> |
|
406 <dt>Return Type:</dt> |
|
407 <dd> |
|
408 tuple of tuples of (str, int, int, int) |
|
409 </dd> |
|
410 </dl> |
|
411 <dl> |
|
412 |
|
413 <dt>Raises <b>OSError</b>:</dt> |
|
414 <dd> |
|
415 raised to indicate an issue with the device |
|
416 </dd> |
|
417 </dl> |
|
418 <a NAME="MicroPythonCommandsInterface.get" ID="MicroPythonCommandsInterface.get"></a> |
|
419 <h4>MicroPythonCommandsInterface.get</h4> |
|
420 <b>get</b>(<i>deviceFileName, hostFileName=None</i>) |
|
421 |
|
422 <p> |
|
423 Public method to copy a file from the connected device. |
|
424 </p> |
|
425 <dl> |
|
426 |
|
427 <dt><i>deviceFileName</i> (str)</dt> |
|
428 <dd> |
|
429 name of the file to copy |
|
430 </dd> |
|
431 <dt><i>hostFileName</i> (str)</dt> |
|
432 <dd> |
|
433 name of the file to copy to |
|
434 </dd> |
|
435 </dl> |
|
436 <dl> |
|
437 <dt>Return:</dt> |
|
438 <dd> |
|
439 flag indicating success |
|
440 </dd> |
|
441 </dl> |
|
442 <dl> |
|
443 <dt>Return Type:</dt> |
|
444 <dd> |
|
445 bool |
|
446 </dd> |
|
447 </dl> |
|
448 <dl> |
|
449 |
|
450 <dt>Raises <b>OSError</b>:</dt> |
|
451 <dd> |
|
452 raised to indicate an issue with the device |
|
453 </dd> |
|
454 </dl> |
|
455 <a NAME="MicroPythonCommandsInterface.getBoardInformation" ID="MicroPythonCommandsInterface.getBoardInformation"></a> |
|
456 <h4>MicroPythonCommandsInterface.getBoardInformation</h4> |
|
457 <b>getBoardInformation</b>(<i></i>) |
|
458 |
|
459 <p> |
|
460 Public method to get some information data of the connected board. |
|
461 </p> |
|
462 <dl> |
|
463 <dt>Return:</dt> |
|
464 <dd> |
|
465 dictionary containing the determined data |
|
466 </dd> |
|
467 </dl> |
|
468 <dl> |
|
469 <dt>Return Type:</dt> |
|
470 <dd> |
|
471 dict |
|
472 </dd> |
|
473 </dl> |
|
474 <dl> |
|
475 |
|
476 <dt>Raises <b>OSError</b>:</dt> |
|
477 <dd> |
|
478 raised to indicate an issue with the device |
|
479 </dd> |
|
480 </dl> |
|
481 <a NAME="MicroPythonCommandsInterface.getImplementation" ID="MicroPythonCommandsInterface.getImplementation"></a> |
|
482 <h4>MicroPythonCommandsInterface.getImplementation</h4> |
|
483 <b>getImplementation</b>(<i></i>) |
|
484 |
|
485 <p> |
|
486 Public method to get some implementation information of the connected |
|
487 device. |
|
488 </p> |
|
489 <dl> |
|
490 <dt>Return:</dt> |
|
491 <dd> |
|
492 dictionary containing the implementation information |
|
493 </dd> |
|
494 </dl> |
|
495 <dl> |
|
496 <dt>Return Type:</dt> |
|
497 <dd> |
|
498 dict |
|
499 </dd> |
|
500 </dl> |
|
501 <dl> |
|
502 |
|
503 <dt>Raises <b>OSError</b>:</dt> |
|
504 <dd> |
|
505 raised to indicate an issue with the device |
|
506 </dd> |
|
507 </dl> |
|
508 <a NAME="MicroPythonCommandsInterface.getTime" ID="MicroPythonCommandsInterface.getTime"></a> |
|
509 <h4>MicroPythonCommandsInterface.getTime</h4> |
|
510 <b>getTime</b>(<i></i>) |
|
511 |
|
512 <p> |
|
513 Public method to get the current time of the device. |
|
514 </p> |
|
515 <dl> |
|
516 <dt>Return:</dt> |
|
517 <dd> |
|
518 time of the device |
|
519 </dd> |
|
520 </dl> |
|
521 <dl> |
|
522 <dt>Return Type:</dt> |
|
523 <dd> |
|
524 str |
|
525 </dd> |
|
526 </dl> |
|
527 <dl> |
|
528 |
|
529 <dt>Raises <b>OSError</b>:</dt> |
|
530 <dd> |
|
531 raised to indicate an issue with the device |
|
532 </dd> |
|
533 </dl> |
|
534 <a NAME="MicroPythonCommandsInterface.handlePreferencesChanged" ID="MicroPythonCommandsInterface.handlePreferencesChanged"></a> |
|
535 <h4>MicroPythonCommandsInterface.handlePreferencesChanged</h4> |
|
536 <b>handlePreferencesChanged</b>(<i></i>) |
|
537 |
|
538 <p> |
|
539 Public slot to handle a change of the preferences. |
|
540 </p> |
|
541 <a NAME="MicroPythonCommandsInterface.isConnected" ID="MicroPythonCommandsInterface.isConnected"></a> |
|
542 <h4>MicroPythonCommandsInterface.isConnected</h4> |
|
543 <b>isConnected</b>(<i></i>) |
|
544 |
|
545 <p> |
|
546 Public method to get the connection status. |
|
547 </p> |
|
548 <dl> |
|
549 <dt>Return:</dt> |
|
550 <dd> |
|
551 flag indicating the connection status |
|
552 </dd> |
|
553 </dl> |
|
554 <dl> |
|
555 <dt>Return Type:</dt> |
|
556 <dd> |
|
557 bool |
|
558 </dd> |
|
559 </dl> |
|
560 <a NAME="MicroPythonCommandsInterface.lls" ID="MicroPythonCommandsInterface.lls"></a> |
|
561 <h4>MicroPythonCommandsInterface.lls</h4> |
|
562 <b>lls</b>(<i>dirname="", fullstat=False, showHidden=False</i>) |
|
563 |
|
564 <p> |
|
565 Public method to get a long directory listing of the connected device |
|
566 including meta data. |
|
567 </p> |
|
568 <dl> |
|
569 |
|
570 <dt><i>dirname</i> (str)</dt> |
|
571 <dd> |
|
572 name of the directory to be listed |
|
573 </dd> |
|
574 <dt><i>fullstat</i> (bool)</dt> |
|
575 <dd> |
|
576 flag indicating to return the full stat() tuple |
|
577 </dd> |
|
578 <dt><i>showHidden</i> (bool)</dt> |
|
579 <dd> |
|
580 flag indicating to show hidden files as well |
|
581 </dd> |
|
582 </dl> |
|
583 <dl> |
|
584 <dt>Return:</dt> |
|
585 <dd> |
|
586 list containing the directory listing with tuple entries of |
|
587 the name and and a tuple of mode, size and time (if fullstat is |
|
588 false) or the complete stat() tuple. 'None' is returned in case the |
|
589 directory doesn't exist. |
|
590 </dd> |
|
591 </dl> |
|
592 <dl> |
|
593 <dt>Return Type:</dt> |
|
594 <dd> |
|
595 tuple of (str, tuple) |
|
596 </dd> |
|
597 </dl> |
|
598 <dl> |
|
599 |
|
600 <dt>Raises <b>OSError</b>:</dt> |
|
601 <dd> |
|
602 raised to indicate an issue with the device |
|
603 </dd> |
|
604 </dl> |
|
605 <a NAME="MicroPythonCommandsInterface.ls" ID="MicroPythonCommandsInterface.ls"></a> |
|
606 <h4>MicroPythonCommandsInterface.ls</h4> |
|
607 <b>ls</b>(<i>dirname=""</i>) |
|
608 |
|
609 <p> |
|
610 Public method to get a directory listing of the connected device. |
|
611 </p> |
|
612 <dl> |
|
613 |
|
614 <dt><i>dirname</i> (str)</dt> |
|
615 <dd> |
|
616 name of the directory to be listed |
|
617 </dd> |
|
618 </dl> |
|
619 <dl> |
|
620 <dt>Return:</dt> |
|
621 <dd> |
|
622 tuple containg the directory listing |
|
623 </dd> |
|
624 </dl> |
|
625 <dl> |
|
626 <dt>Return Type:</dt> |
|
627 <dd> |
|
628 tuple of str |
|
629 </dd> |
|
630 </dl> |
|
631 <dl> |
|
632 |
|
633 <dt>Raises <b>OSError</b>:</dt> |
|
634 <dd> |
|
635 raised to indicate an issue with the device |
|
636 </dd> |
|
637 </dl> |
|
638 <a NAME="MicroPythonCommandsInterface.mkdir" ID="MicroPythonCommandsInterface.mkdir"></a> |
|
639 <h4>MicroPythonCommandsInterface.mkdir</h4> |
|
640 <b>mkdir</b>(<i>dirname</i>) |
|
641 |
|
642 <p> |
|
643 Public method to create a new directory. |
|
644 </p> |
|
645 <dl> |
|
646 |
|
647 <dt><i>dirname</i> (str)</dt> |
|
648 <dd> |
|
649 name of the directory to create |
|
650 </dd> |
|
651 </dl> |
|
652 <dl> |
|
653 |
|
654 <dt>Raises <b>OSError</b>:</dt> |
|
655 <dd> |
|
656 raised to indicate an issue with the device |
|
657 </dd> |
|
658 </dl> |
|
659 <a NAME="MicroPythonCommandsInterface.put" ID="MicroPythonCommandsInterface.put"></a> |
|
660 <h4>MicroPythonCommandsInterface.put</h4> |
|
661 <b>put</b>(<i>hostFileName, deviceFileName=None</i>) |
|
662 |
|
663 <p> |
|
664 Public method to copy a local file to the connected device. |
|
665 </p> |
|
666 <dl> |
|
667 |
|
668 <dt><i>hostFileName</i> (str)</dt> |
|
669 <dd> |
|
670 name of the file to be copied |
|
671 </dd> |
|
672 <dt><i>deviceFileName</i> (str)</dt> |
|
673 <dd> |
|
674 name of the file to copy to |
|
675 </dd> |
|
676 </dl> |
|
677 <dl> |
|
678 <dt>Return:</dt> |
|
679 <dd> |
|
680 flag indicating success |
|
681 </dd> |
|
682 </dl> |
|
683 <dl> |
|
684 <dt>Return Type:</dt> |
|
685 <dd> |
|
686 bool |
|
687 </dd> |
|
688 </dl> |
|
689 <dl> |
|
690 |
|
691 <dt>Raises <b>OSError</b>:</dt> |
|
692 <dd> |
|
693 raised to indicate an issue with the device |
|
694 </dd> |
|
695 </dl> |
|
696 <a NAME="MicroPythonCommandsInterface.pwd" ID="MicroPythonCommandsInterface.pwd"></a> |
|
697 <h4>MicroPythonCommandsInterface.pwd</h4> |
|
698 <b>pwd</b>(<i></i>) |
|
699 |
|
700 <p> |
|
701 Public method to get the current directory of the connected device. |
|
702 </p> |
|
703 <dl> |
|
704 <dt>Return:</dt> |
|
705 <dd> |
|
706 current directory |
|
707 </dd> |
|
708 </dl> |
|
709 <dl> |
|
710 <dt>Return Type:</dt> |
|
711 <dd> |
|
712 str |
|
713 </dd> |
|
714 </dl> |
|
715 <dl> |
|
716 |
|
717 <dt>Raises <b>OSError</b>:</dt> |
|
718 <dd> |
|
719 raised to indicate an issue with the device |
|
720 </dd> |
|
721 </dl> |
|
722 <a NAME="MicroPythonCommandsInterface.remainingTask" ID="MicroPythonCommandsInterface.remainingTask"></a> |
|
723 <h4>MicroPythonCommandsInterface.remainingTask</h4> |
|
724 <b>remainingTask</b>(<i></i>) |
|
725 |
|
726 <a NAME="MicroPythonCommandsInterface.rm" ID="MicroPythonCommandsInterface.rm"></a> |
|
727 <h4>MicroPythonCommandsInterface.rm</h4> |
|
728 <b>rm</b>(<i>filename</i>) |
|
729 |
|
730 <p> |
|
731 Public method to remove a file from the connected device. |
|
732 </p> |
|
733 <dl> |
|
734 |
|
735 <dt><i>filename</i> (str)</dt> |
|
736 <dd> |
|
737 name of the file to be removed |
|
738 </dd> |
|
739 </dl> |
|
740 <dl> |
|
741 |
|
742 <dt>Raises <b>OSError</b>:</dt> |
|
743 <dd> |
|
744 raised to indicate an issue with the device |
|
745 </dd> |
|
746 </dl> |
|
747 <a NAME="MicroPythonCommandsInterface.rmdir" ID="MicroPythonCommandsInterface.rmdir"></a> |
|
748 <h4>MicroPythonCommandsInterface.rmdir</h4> |
|
749 <b>rmdir</b>(<i>dirname</i>) |
|
750 |
|
751 <p> |
|
752 Public method to remove a directory. |
|
753 </p> |
|
754 <dl> |
|
755 |
|
756 <dt><i>dirname</i> (str)</dt> |
|
757 <dd> |
|
758 name of the directory to be removed |
|
759 </dd> |
|
760 </dl> |
|
761 <dl> |
|
762 |
|
763 <dt>Raises <b>OSError</b>:</dt> |
|
764 <dd> |
|
765 raised to indicate an issue with the device |
|
766 </dd> |
|
767 </dl> |
|
768 <a NAME="MicroPythonCommandsInterface.rmrf" ID="MicroPythonCommandsInterface.rmrf"></a> |
|
769 <h4>MicroPythonCommandsInterface.rmrf</h4> |
|
770 <b>rmrf</b>(<i>name, recursive=False, force=False</i>) |
|
771 |
|
772 <p> |
|
773 Public method to remove a file or directory recursively. |
|
774 </p> |
|
775 <dl> |
|
776 |
|
777 <dt><i>name</i> (str)</dt> |
|
778 <dd> |
|
779 of the file or directory to remove |
|
780 </dd> |
|
781 <dt><i>recursive</i> (bool)</dt> |
|
782 <dd> |
|
783 flag indicating a recursive deletion |
|
784 </dd> |
|
785 <dt><i>force</i> (bool)</dt> |
|
786 <dd> |
|
787 flag indicating to ignore errors |
|
788 </dd> |
|
789 </dl> |
|
790 <dl> |
|
791 <dt>Return:</dt> |
|
792 <dd> |
|
793 flag indicating success |
|
794 </dd> |
|
795 </dl> |
|
796 <dl> |
|
797 <dt>Return Type:</dt> |
|
798 <dd> |
|
799 bool |
|
800 </dd> |
|
801 </dl> |
|
802 <dl> |
|
803 |
|
804 <dt>Raises <b>OSError</b>:</dt> |
|
805 <dd> |
|
806 raised to indicate an issue with the device |
|
807 </dd> |
|
808 </dl> |
|
809 <a NAME="MicroPythonCommandsInterface.syncTime" ID="MicroPythonCommandsInterface.syncTime"></a> |
|
810 <h4>MicroPythonCommandsInterface.syncTime</h4> |
|
811 <b>syncTime</b>(<i>deviceType</i>) |
|
812 |
|
813 <p> |
|
814 Public method to set the time of the connected device to the local |
|
815 computer's time. |
|
816 </p> |
|
817 <dl> |
|
818 |
|
819 <dt><i>deviceType</i> (str)</dt> |
|
820 <dd> |
|
821 type of board to sync time to |
|
822 </dd> |
|
823 </dl> |
|
824 <dl> |
|
825 |
|
826 <dt>Raises <b>OSError</b>:</dt> |
|
827 <dd> |
|
828 raised to indicate an issue with the device |
|
829 </dd> |
|
830 </dl> |
|
831 <a NAME="MicroPythonCommandsInterface.version" ID="MicroPythonCommandsInterface.version"></a> |
|
832 <h4>MicroPythonCommandsInterface.version</h4> |
|
833 <b>version</b>(<i></i>) |
|
834 |
|
835 <p> |
|
836 Public method to get the MicroPython version information of the |
|
837 connected device. |
|
838 </p> |
|
839 <dl> |
|
840 <dt>Return:</dt> |
|
841 <dd> |
|
842 dictionary containing the version information |
|
843 </dd> |
|
844 </dl> |
|
845 <dl> |
|
846 <dt>Return Type:</dt> |
|
847 <dd> |
|
848 dict |
|
849 </dd> |
|
850 </dl> |
|
851 <dl> |
|
852 |
|
853 <dt>Raises <b>OSError</b>:</dt> |
|
854 <dd> |
|
855 raised to indicate an issue with the device |
|
856 </dd> |
|
857 </dl> |
|
858 <a NAME="MicroPythonCommandsInterface.write" ID="MicroPythonCommandsInterface.write"></a> |
|
859 <h4>MicroPythonCommandsInterface.write</h4> |
|
860 <b>write</b>(<i>data</i>) |
|
861 |
|
862 <p> |
|
863 Public method to write data to the connected device. |
|
864 </p> |
|
865 <dl> |
|
866 |
|
867 <dt><i>data</i> (bytes or bytearray)</dt> |
|
868 <dd> |
|
869 data to be written |
|
870 </dd> |
|
871 </dl> |
|
872 <div align="right"><a href="#top">Up</a></div> |
|
873 <hr /> |
|
874 </body></html> |