|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.MicroPython.MicroPythonSerialPort</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.MicroPythonSerialPort</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a QSerialPort with additional functionality for |
|
13 MicroPython devices. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 |
|
17 <table> |
|
18 <tr><td>None</td></tr> |
|
19 </table> |
|
20 <h3>Classes</h3> |
|
21 |
|
22 <table> |
|
23 |
|
24 <tr> |
|
25 <td><a href="#MicroPythonSerialPort">MicroPythonSerialPort</a></td> |
|
26 <td>Class implementing a QSerialPort with additional functionality for MicroPython devices.</td> |
|
27 </tr> |
|
28 </table> |
|
29 <h3>Functions</h3> |
|
30 |
|
31 <table> |
|
32 <tr><td>None</td></tr> |
|
33 </table> |
|
34 <hr /> |
|
35 <hr /> |
|
36 <a NAME="MicroPythonSerialPort" ID="MicroPythonSerialPort"></a> |
|
37 <h2>MicroPythonSerialPort</h2> |
|
38 |
|
39 <p> |
|
40 Class implementing a QSerialPort with additional functionality for |
|
41 MicroPython devices. |
|
42 </p> |
|
43 <h3>Derived from</h3> |
|
44 QSerialPort |
|
45 <h3>Class Attributes</h3> |
|
46 |
|
47 <table> |
|
48 <tr><td>None</td></tr> |
|
49 </table> |
|
50 <h3>Class Methods</h3> |
|
51 |
|
52 <table> |
|
53 <tr><td>None</td></tr> |
|
54 </table> |
|
55 <h3>Methods</h3> |
|
56 |
|
57 <table> |
|
58 |
|
59 <tr> |
|
60 <td><a href="#MicroPythonSerialPort.__init__">MicroPythonSerialPort</a></td> |
|
61 <td>Constructor</td> |
|
62 </tr> |
|
63 <tr> |
|
64 <td><a href="#MicroPythonSerialPort.closeSerialLink">closeSerialLink</a></td> |
|
65 <td>Public method to close the open serial connection.</td> |
|
66 </tr> |
|
67 <tr> |
|
68 <td><a href="#MicroPythonSerialPort.hasTimedOut">hasTimedOut</a></td> |
|
69 <td>Public method to check, if the last 'readUntil' has timed out.</td> |
|
70 </tr> |
|
71 <tr> |
|
72 <td><a href="#MicroPythonSerialPort.isConnected">isConnected</a></td> |
|
73 <td>Public method to get the connection state.</td> |
|
74 </tr> |
|
75 <tr> |
|
76 <td><a href="#MicroPythonSerialPort.openSerialLink">openSerialLink</a></td> |
|
77 <td>Public method to open a serial link to a given serial port.</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#MicroPythonSerialPort.readUntil">readUntil</a></td> |
|
81 <td>Public method to read data until an expected sequence is found (default: \n) or a specific size is exceeded.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#MicroPythonSerialPort.setTimeout">setTimeout</a></td> |
|
85 <td>Public method to set the timeout for device operations.</td> |
|
86 </tr> |
|
87 </table> |
|
88 <h3>Static Methods</h3> |
|
89 |
|
90 <table> |
|
91 <tr><td>None</td></tr> |
|
92 </table> |
|
93 |
|
94 <a NAME="MicroPythonSerialPort.__init__" ID="MicroPythonSerialPort.__init__"></a> |
|
95 <h4>MicroPythonSerialPort (Constructor)</h4> |
|
96 <b>MicroPythonSerialPort</b>(<i>timeout=10000, parent=None</i>) |
|
97 |
|
98 <p> |
|
99 Constructor |
|
100 </p> |
|
101 <dl> |
|
102 |
|
103 <dt><i>timeout</i> (int)</dt> |
|
104 <dd> |
|
105 timout in milliseconds to be set |
|
106 </dd> |
|
107 <dt><i>parent</i> (QObject)</dt> |
|
108 <dd> |
|
109 reference to the parent object |
|
110 </dd> |
|
111 </dl> |
|
112 <a NAME="MicroPythonSerialPort.closeSerialLink" ID="MicroPythonSerialPort.closeSerialLink"></a> |
|
113 <h4>MicroPythonSerialPort.closeSerialLink</h4> |
|
114 <b>closeSerialLink</b>(<i></i>) |
|
115 |
|
116 <p> |
|
117 Public method to close the open serial connection. |
|
118 </p> |
|
119 <a NAME="MicroPythonSerialPort.hasTimedOut" ID="MicroPythonSerialPort.hasTimedOut"></a> |
|
120 <h4>MicroPythonSerialPort.hasTimedOut</h4> |
|
121 <b>hasTimedOut</b>(<i></i>) |
|
122 |
|
123 <p> |
|
124 Public method to check, if the last 'readUntil' has timed out. |
|
125 </p> |
|
126 <dl> |
|
127 <dt>Return:</dt> |
|
128 <dd> |
|
129 flag indicating a timeout |
|
130 @rtype bool |
|
131 </dd> |
|
132 </dl> |
|
133 <a NAME="MicroPythonSerialPort.isConnected" ID="MicroPythonSerialPort.isConnected"></a> |
|
134 <h4>MicroPythonSerialPort.isConnected</h4> |
|
135 <b>isConnected</b>(<i></i>) |
|
136 |
|
137 <p> |
|
138 Public method to get the connection state. |
|
139 </p> |
|
140 <dl> |
|
141 <dt>Return:</dt> |
|
142 <dd> |
|
143 flag indicating the connection state |
|
144 </dd> |
|
145 </dl> |
|
146 <dl> |
|
147 <dt>Return Type:</dt> |
|
148 <dd> |
|
149 bool |
|
150 </dd> |
|
151 </dl> |
|
152 <a NAME="MicroPythonSerialPort.openSerialLink" ID="MicroPythonSerialPort.openSerialLink"></a> |
|
153 <h4>MicroPythonSerialPort.openSerialLink</h4> |
|
154 <b>openSerialLink</b>(<i>port</i>) |
|
155 |
|
156 <p> |
|
157 Public method to open a serial link to a given serial port. |
|
158 </p> |
|
159 <dl> |
|
160 |
|
161 <dt><i>port</i> (str)</dt> |
|
162 <dd> |
|
163 port name to connect to |
|
164 </dd> |
|
165 </dl> |
|
166 <dl> |
|
167 <dt>Return:</dt> |
|
168 <dd> |
|
169 flag indicating success |
|
170 </dd> |
|
171 </dl> |
|
172 <dl> |
|
173 <dt>Return Type:</dt> |
|
174 <dd> |
|
175 bool |
|
176 </dd> |
|
177 </dl> |
|
178 <a NAME="MicroPythonSerialPort.readUntil" ID="MicroPythonSerialPort.readUntil"></a> |
|
179 <h4>MicroPythonSerialPort.readUntil</h4> |
|
180 <b>readUntil</b>(<i>expected=b"\n", size=None</i>) |
|
181 |
|
182 <p> |
|
183 Public method to read data until an expected sequence is found |
|
184 (default: \n) or a specific size is exceeded. |
|
185 </p> |
|
186 <dl> |
|
187 |
|
188 <dt><i>expected</i> (bytes)</dt> |
|
189 <dd> |
|
190 expected bytes sequence |
|
191 </dd> |
|
192 <dt><i>size</i> (int)</dt> |
|
193 <dd> |
|
194 maximum data to be read |
|
195 </dd> |
|
196 </dl> |
|
197 <dl> |
|
198 <dt>Return:</dt> |
|
199 <dd> |
|
200 bytes read from the device including the expected sequence |
|
201 </dd> |
|
202 </dl> |
|
203 <dl> |
|
204 <dt>Return Type:</dt> |
|
205 <dd> |
|
206 bytes |
|
207 </dd> |
|
208 </dl> |
|
209 <a NAME="MicroPythonSerialPort.setTimeout" ID="MicroPythonSerialPort.setTimeout"></a> |
|
210 <h4>MicroPythonSerialPort.setTimeout</h4> |
|
211 <b>setTimeout</b>(<i>timeout</i>) |
|
212 |
|
213 <p> |
|
214 Public method to set the timeout for device operations. |
|
215 </p> |
|
216 <dl> |
|
217 |
|
218 <dt><i>timeout</i> (int)</dt> |
|
219 <dd> |
|
220 timout in milliseconds to be set |
|
221 </dd> |
|
222 </dl> |
|
223 <div align="right"><a href="#top">Up</a></div> |
|
224 <hr /> |
|
225 </body></html> |