eric6/Documentation/Source/eric6.MicroPython.MicroPythonSerialPort.html

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

eric ide

mercurial