5 <link rel="stylesheet" href="styles.css"> |
5 <link rel="stylesheet" href="styles.css"> |
6 </head> |
6 </head> |
7 <body> |
7 <body> |
8 <a NAME="top" ID="top"></a> |
8 <a NAME="top" ID="top"></a> |
9 <h1>eric7.MicroPython.BluetoothDialogs.BluetoothAdvertisement</h1> |
9 <h1>eric7.MicroPython.BluetoothDialogs.BluetoothAdvertisement</h1> |
10 |
|
11 <p> |
10 <p> |
12 Module implementing a class to parse and store the Bluetooth device advertisement data. |
11 Module implementing a class to parse and store the Bluetooth device advertisement data. |
13 </p> |
12 </p> |
|
13 |
14 <h3>Global Attributes</h3> |
14 <h3>Global Attributes</h3> |
15 |
15 <table> |
16 <table> |
16 <tr><td>ADV_DIRECT_IND</td></tr> |
17 <tr><td>ADV_DIRECT_IND</td></tr><tr><td>ADV_IND</td></tr><tr><td>ADV_NONCONN_IND</td></tr><tr><td>ADV_SCAN_IND</td></tr><tr><td>ADV_TYPE_COMPLETE_NAME</td></tr><tr><td>ADV_TYPE_MANUFACTURER</td></tr><tr><td>ADV_TYPE_SHORT_NAME</td></tr><tr><td>ADV_TYPE_SVC_DATA</td></tr><tr><td>ADV_TYPE_TX_POWER_LEVEL</td></tr><tr><td>ADV_TYPE_UUID128_COMPLETE</td></tr><tr><td>ADV_TYPE_UUID128_INCOMPLETE</td></tr><tr><td>ADV_TYPE_UUID16_COMPLETE</td></tr><tr><td>ADV_TYPE_UUID16_INCOMPLETE</td></tr><tr><td>ADV_TYPE_UUID32_COMPLETE</td></tr><tr><td>ADV_TYPE_UUID32_INCOMPLETE</td></tr><tr><td>ManufacturerIDs</td></tr><tr><td>SCAN_RSP</td></tr><tr><td>ServiceIDs</td></tr> |
17 <tr><td>ADV_IND</td></tr> |
18 </table> |
18 <tr><td>ADV_NONCONN_IND</td></tr> |
|
19 <tr><td>ADV_SCAN_IND</td></tr> |
|
20 <tr><td>ADV_TYPE_COMPLETE_NAME</td></tr> |
|
21 <tr><td>ADV_TYPE_MANUFACTURER</td></tr> |
|
22 <tr><td>ADV_TYPE_SHORT_NAME</td></tr> |
|
23 <tr><td>ADV_TYPE_SVC_DATA</td></tr> |
|
24 <tr><td>ADV_TYPE_TX_POWER_LEVEL</td></tr> |
|
25 <tr><td>ADV_TYPE_UUID128_COMPLETE</td></tr> |
|
26 <tr><td>ADV_TYPE_UUID128_INCOMPLETE</td></tr> |
|
27 <tr><td>ADV_TYPE_UUID16_COMPLETE</td></tr> |
|
28 <tr><td>ADV_TYPE_UUID16_INCOMPLETE</td></tr> |
|
29 <tr><td>ADV_TYPE_UUID32_COMPLETE</td></tr> |
|
30 <tr><td>ADV_TYPE_UUID32_INCOMPLETE</td></tr> |
|
31 <tr><td>ManufacturerIDs</td></tr> |
|
32 <tr><td>SCAN_RSP</td></tr> |
|
33 <tr><td>ServiceIDs</td></tr> |
|
34 </table> |
|
35 |
19 <h3>Classes</h3> |
36 <h3>Classes</h3> |
20 |
37 <table> |
21 <table> |
|
22 |
|
23 <tr> |
38 <tr> |
24 <td><a href="#BluetoothAdvertisement">BluetoothAdvertisement</a></td> |
39 <td><a href="#BluetoothAdvertisement">BluetoothAdvertisement</a></td> |
25 <td>Class to parse and store the Bluetooth device advertisement data.</td> |
40 <td>Class to parse and store the Bluetooth device advertisement data.</td> |
26 </tr> |
41 </tr> |
27 </table> |
42 </table> |
|
43 |
28 <h3>Functions</h3> |
44 <h3>Functions</h3> |
29 |
45 <table> |
30 <table> |
|
31 |
|
32 <tr> |
46 <tr> |
33 <td><a href="#_loadManufacturerIDs">_loadManufacturerIDs</a></td> |
47 <td><a href="#_loadManufacturerIDs">_loadManufacturerIDs</a></td> |
34 <td>Function to load the manufacturer IDs.</td> |
48 <td>Function to load the manufacturer IDs.</td> |
35 </tr> |
49 </tr> |
36 <tr> |
50 <tr> |
37 <td><a href="#_loadServiceUUIDs">_loadServiceUUIDs</a></td> |
51 <td><a href="#_loadServiceUUIDs">_loadServiceUUIDs</a></td> |
38 <td>Function to load the service UUIDs.</td> |
52 <td>Function to load the service UUIDs.</td> |
39 </tr> |
53 </tr> |
40 </table> |
54 </table> |
|
55 |
41 <hr /> |
56 <hr /> |
42 <hr /> |
57 <hr /> |
43 <a NAME="BluetoothAdvertisement" ID="BluetoothAdvertisement"></a> |
58 <a NAME="BluetoothAdvertisement" ID="BluetoothAdvertisement"></a> |
44 <h2>BluetoothAdvertisement</h2> |
59 <h2>BluetoothAdvertisement</h2> |
45 |
|
46 <p> |
60 <p> |
47 Class to parse and store the Bluetooth device advertisement data. |
61 Class to parse and store the Bluetooth device advertisement data. |
48 </p> |
62 </p> |
|
63 |
49 <h3>Derived from</h3> |
64 <h3>Derived from</h3> |
50 None |
65 None |
51 <h3>Class Attributes</h3> |
66 <h3>Class Attributes</h3> |
52 |
|
53 <table> |
67 <table> |
54 <tr><td>None</td></tr> |
68 <tr><td>None</td></tr> |
55 </table> |
69 </table> |
|
70 |
56 <h3>Class Methods</h3> |
71 <h3>Class Methods</h3> |
57 |
|
58 <table> |
72 <table> |
59 <tr><td>None</td></tr> |
73 <tr><td>None</td></tr> |
60 </table> |
74 </table> |
|
75 |
61 <h3>Methods</h3> |
76 <h3>Methods</h3> |
62 |
77 <table> |
63 <table> |
|
64 |
|
65 <tr> |
78 <tr> |
66 <td><a href="#BluetoothAdvertisement.__init__">BluetoothAdvertisement</a></td> |
79 <td><a href="#BluetoothAdvertisement.__init__">BluetoothAdvertisement</a></td> |
67 <td>Constructor</td> |
80 <td>Constructor</td> |
68 </tr> |
81 </tr> |
69 <tr> |
82 <tr> |
113 <tr> |
126 <tr> |
114 <td><a href="#BluetoothAdvertisement.update">update</a></td> |
127 <td><a href="#BluetoothAdvertisement.update">update</a></td> |
115 <td>Public method to update the advertisement data.</td> |
128 <td>Public method to update the advertisement data.</td> |
116 </tr> |
129 </tr> |
117 </table> |
130 </table> |
|
131 |
118 <h3>Static Methods</h3> |
132 <h3>Static Methods</h3> |
119 |
|
120 <table> |
133 <table> |
121 <tr><td>None</td></tr> |
134 <tr><td>None</td></tr> |
122 </table> |
135 </table> |
|
136 |
123 |
137 |
124 <a NAME="BluetoothAdvertisement.__init__" ID="BluetoothAdvertisement.__init__"></a> |
138 <a NAME="BluetoothAdvertisement.__init__" ID="BluetoothAdvertisement.__init__"></a> |
125 <h4>BluetoothAdvertisement (Constructor)</h4> |
139 <h4>BluetoothAdvertisement (Constructor)</h4> |
126 <b>BluetoothAdvertisement</b>(<i>address</i>) |
140 <b>BluetoothAdvertisement</b>(<i>address</i>) |
127 |
|
128 <p> |
141 <p> |
129 Constructor |
142 Constructor |
130 </p> |
143 </p> |
|
144 |
131 <dl> |
145 <dl> |
132 |
146 |
133 <dt><i>address</i> (str)</dt> |
147 <dt><i>address</i> (str)</dt> |
134 <dd> |
148 <dd> |
135 address of the device advertisement |
149 address of the device advertisement |
136 </dd> |
150 </dd> |
137 </dl> |
151 </dl> |
138 <a NAME="BluetoothAdvertisement.__decodeField" ID="BluetoothAdvertisement.__decodeField"></a> |
152 <a NAME="BluetoothAdvertisement.__decodeField" ID="BluetoothAdvertisement.__decodeField"></a> |
139 <h4>BluetoothAdvertisement.__decodeField</h4> |
153 <h4>BluetoothAdvertisement.__decodeField</h4> |
140 <b>__decodeField</b>(<i>*advType</i>) |
154 <b>__decodeField</b>(<i>*advType</i>) |
141 |
|
142 <p> |
155 <p> |
143 Private method to get all fields of the specified types. |
156 Private method to get all fields of the specified types. |
144 </p> |
157 </p> |
|
158 |
145 <dl> |
159 <dl> |
146 |
160 |
147 <dt><i>*advType</i> (int)</dt> |
161 <dt><i>*advType</i> (int)</dt> |
148 <dd> |
162 <dd> |
149 type of fields to be extracted |
163 type of fields to be extracted |
162 </dd> |
176 </dd> |
163 </dl> |
177 </dl> |
164 <a NAME="BluetoothAdvertisement.__splitBytes" ID="BluetoothAdvertisement.__splitBytes"></a> |
178 <a NAME="BluetoothAdvertisement.__splitBytes" ID="BluetoothAdvertisement.__splitBytes"></a> |
165 <h4>BluetoothAdvertisement.__splitBytes</h4> |
179 <h4>BluetoothAdvertisement.__splitBytes</h4> |
166 <b>__splitBytes</b>(<i>data, chunkSize</i>) |
180 <b>__splitBytes</b>(<i>data, chunkSize</i>) |
167 |
|
168 <p> |
181 <p> |
169 Private method to split some data into chunks of given size. |
182 Private method to split some data into chunks of given size. |
170 </p> |
183 </p> |
|
184 |
171 <dl> |
185 <dl> |
172 |
186 |
173 <dt><i>data</i> (bytes, bytearray, str)</dt> |
187 <dt><i>data</i> (bytes, bytearray, str)</dt> |
174 <dd> |
188 <dd> |
175 data to be chunked |
189 data to be chunked |
249 </dd> |
263 </dd> |
250 </dl> |
264 </dl> |
251 <a NAME="BluetoothAdvertisement.manufacturer" ID="BluetoothAdvertisement.manufacturer"></a> |
265 <a NAME="BluetoothAdvertisement.manufacturer" ID="BluetoothAdvertisement.manufacturer"></a> |
252 <h4>BluetoothAdvertisement.manufacturer</h4> |
266 <h4>BluetoothAdvertisement.manufacturer</h4> |
253 <b>manufacturer</b>(<i>filterId=None, withName=False</i>) |
267 <b>manufacturer</b>(<i>filterId=None, withName=False</i>) |
254 |
|
255 <p> |
268 <p> |
256 Public method to get the manufacturer data. |
269 Public method to get the manufacturer data. |
257 </p> |
270 </p> |
|
271 |
258 <dl> |
272 <dl> |
259 |
273 |
260 <dt><i>filterId</i> (int (optional))</dt> |
274 <dt><i>filterId</i> (int (optional))</dt> |
261 <dd> |
275 <dd> |
262 manufacturer ID to filter on (defaults to None) |
276 manufacturer ID to filter on (defaults to None) |
319 </dd> |
333 </dd> |
320 </dl> |
334 </dl> |
321 <a NAME="BluetoothAdvertisement.services" ID="BluetoothAdvertisement.services"></a> |
335 <a NAME="BluetoothAdvertisement.services" ID="BluetoothAdvertisement.services"></a> |
322 <h4>BluetoothAdvertisement.services</h4> |
336 <h4>BluetoothAdvertisement.services</h4> |
323 <b>services</b>(<i></i>) |
337 <b>services</b>(<i></i>) |
324 |
|
325 <p> |
338 <p> |
326 Public method to get the service IDs. |
339 Public method to get the service IDs. |
327 </p> |
340 </p> |
|
341 |
328 <dl> |
342 <dl> |
329 <dt>Return:</dt> |
343 <dt>Return:</dt> |
330 <dd> |
344 <dd> |
331 list of tuples containing the advertised service ID, the associated |
345 list of tuples containing the advertised service ID, the associated |
332 service name (if available) and a flag indicating a complete ID |
346 service name (if available) and a flag indicating a complete ID |
377 </dd> |
391 </dd> |
378 </dl> |
392 </dl> |
379 <a NAME="BluetoothAdvertisement.update" ID="BluetoothAdvertisement.update"></a> |
393 <a NAME="BluetoothAdvertisement.update" ID="BluetoothAdvertisement.update"></a> |
380 <h4>BluetoothAdvertisement.update</h4> |
394 <h4>BluetoothAdvertisement.update</h4> |
381 <b>update</b>(<i>advType, rssi, advData</i>) |
395 <b>update</b>(<i>advType, rssi, advData</i>) |
382 |
|
383 <p> |
396 <p> |
384 Public method to update the advertisement data. |
397 Public method to update the advertisement data. |
385 </p> |
398 </p> |
|
399 |
386 <dl> |
400 <dl> |
387 |
401 |
388 <dt><i>advType</i> (int)</dt> |
402 <dt><i>advType</i> (int)</dt> |
389 <dd> |
403 <dd> |
390 type of advertisement data |
404 type of advertisement data |
402 <hr /> |
416 <hr /> |
403 <hr /> |
417 <hr /> |
404 <a NAME="_loadManufacturerIDs" ID="_loadManufacturerIDs"></a> |
418 <a NAME="_loadManufacturerIDs" ID="_loadManufacturerIDs"></a> |
405 <h2>_loadManufacturerIDs</h2> |
419 <h2>_loadManufacturerIDs</h2> |
406 <b>_loadManufacturerIDs</b>(<i></i>) |
420 <b>_loadManufacturerIDs</b>(<i></i>) |
407 |
|
408 <p> |
421 <p> |
409 Function to load the manufacturer IDs. |
422 Function to load the manufacturer IDs. |
410 </p> |
423 </p> |
|
424 |
411 <div align="right"><a href="#top">Up</a></div> |
425 <div align="right"><a href="#top">Up</a></div> |
412 <hr /> |
426 <hr /> |
413 <hr /> |
427 <hr /> |
414 <a NAME="_loadServiceUUIDs" ID="_loadServiceUUIDs"></a> |
428 <a NAME="_loadServiceUUIDs" ID="_loadServiceUUIDs"></a> |
415 <h2>_loadServiceUUIDs</h2> |
429 <h2>_loadServiceUUIDs</h2> |
416 <b>_loadServiceUUIDs</b>(<i></i>) |
430 <b>_loadServiceUUIDs</b>(<i></i>) |
417 |
|
418 <p> |
431 <p> |
419 Function to load the service UUIDs. |
432 Function to load the service UUIDs. |
420 </p> |
433 </p> |
|
434 |
421 <div align="right"><a href="#top">Up</a></div> |
435 <div align="right"><a href="#top">Up</a></div> |
422 <hr /> |
436 <hr /> |
423 </body></html> |
437 </body></html> |