src/eric7/Documentation/Source/eric7.MicroPython.MicroPythonDeviceInterface.html

branch
mpy_network
changeset 9799
a79430a8811d
parent 9766
f0e22f3a5878
child 9989
286c2a21f36f
equal deleted inserted replaced
9798:4402d76c5fa9 9799:a79430a8811d
55 <h3>Derived from</h3> 55 <h3>Derived from</h3>
56 QObject 56 QObject
57 <h3>Class Attributes</h3> 57 <h3>Class Attributes</h3>
58 58
59 <table> 59 <table>
60 <tr><td>None</td></tr> 60 <tr><td>PasteModePrompt</td></tr><tr><td>TracebackMarker</td></tr>
61 </table> 61 </table>
62 <h3>Class Methods</h3> 62 <h3>Class Methods</h3>
63 63
64 <table> 64 <table>
65 <tr><td>None</td></tr> 65 <tr><td>None</td></tr>
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>
156 </p> 275 </p>
157 <dl> 276 <dl>
158 <dt>Return:</dt> 277 <dt>Return:</dt>
159 <dd> 278 <dd>
160 flag indicating success 279 flag indicating success
161 @rtype bool 280 </dd>
281 </dl>
282 <dl>
283 <dt>Return Type:</dt>
284 <dd>
285 bool
162 </dd> 286 </dd>
163 </dl> 287 </dl>
164 <a NAME="MicroPythonDeviceInterface.__readSerial" ID="MicroPythonDeviceInterface.__readSerial"></a> 288 <a NAME="MicroPythonDeviceInterface.__readSerial" ID="MicroPythonDeviceInterface.__readSerial"></a>
165 <h4>MicroPythonDeviceInterface.__readSerial</h4> 289 <h4>MicroPythonDeviceInterface.__readSerial</h4>
166 <b>__readSerial</b>(<i></i>) 290 <b>__readSerial</b>(<i></i>)
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>
217 341
218 <dt><i>commands</i> (str or list of str)</dt> 342 <dt><i>commands</i> (str or list of str)</dt>
219 <dd> 343 <dd>
220 list of commands to be executed 344 list of commands to be executed
221 </dd> 345 </dd>
346 <dt><i>mode=</i> (str)</dt>
347 <dd>
348 submit mode to be used (one of 'raw' or 'paste') (defaults to
349 'raw')
350 </dd>
351 <dt><i>timeout=</i> (int (optional))</dt>
352 <dd>
353 per command timeout in milliseconds (0 for configured default)
354 (defaults to 0)
355 </dd>
222 </dl> 356 </dl>
223 <dl> 357 <dl>
224 <dt>Return:</dt> 358 <dt>Return:</dt>
225 <dd> 359 <dd>
226 tuple containing stdout and stderr output of the device 360 tuple containing stdout and stderr output of the device
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>

eric ide

mercurial