Skip to content

Commit 8503017

Browse files
committed
aioble: Split into optional components.
This replaces the options that could be specified previously to include and require. The `aioble` package now provides everything. For a minimal install, the individual components can now be installed or require()'ed explicitly. Signed-off-by: Jim Mussared <[email protected]>
1 parent 4dc2d5e commit 8503017

File tree

9 files changed

+75
-28
lines changed

9 files changed

+75
-28
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
metadata(version="0.2.0")
2+
3+
require("aioble-core")
4+
5+
package("aioble", files=("central.py",), base_path="../aioble")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
metadata(version="0.2.0")
2+
3+
require("aioble-core")
4+
5+
package("aioble", files=("client.py",), base_path="../aioble")
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
metadata(version="0.2.0")
2+
3+
package(
4+
"aioble",
5+
files=(
6+
"__init__.py",
7+
"core.py",
8+
"device.py",
9+
),
10+
base_path="../aioble",
11+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
metadata(version="0.2.0")
2+
3+
require("aioble-core")
4+
5+
package("aioble", files=("l2cap.py",), base_path="../aioble")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
metadata(version="0.2.0")
2+
3+
require("aioble-core")
4+
5+
package("aioble", files=("peripheral.py",), base_path="../aioble")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
metadata(version="0.2.0")
2+
3+
require("aioble-core")
4+
5+
package("aioble", files=("security.py",), base_path="../aioble")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
metadata(version="0.2.0")
2+
3+
require("aioble-core")
4+
5+
package("aioble", files=("server.py",), base_path="../aioble")

micropython/bluetooth/aioble/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
aioble
22
======
33

4-
This library provides an object-oriented, asyncio-based wrapper for MicroPython's [ubluetooth](https://docs.micropython.org/en/latest/library/ubluetooth.html) API.
4+
This library provides an object-oriented, asyncio-based wrapper for MicroPython's
5+
[bluetooth](https://docs.micropython.org/en/latest/library/bluetooth.html) API.
56

67
**Note**: aioble requires MicroPython v1.17 or higher.
78

@@ -49,6 +50,23 @@ Security:
4950

5051
All remote operations (connect, disconnect, client read/write, server indicate, l2cap recv/send, pair) are awaitable and support timeouts.
5152

53+
Installation
54+
------------
55+
56+
You can install any combination of the following packages.
57+
- `aioble-central` -- Central (and Observer) role functionality including
58+
scanning and connecting.
59+
- `aioble-client` -- GATT client, typically used by central role devices but
60+
can also be used on peripherals.
61+
- `aioble-l2cap` -- L2CAP Connection-oriented-channels support.
62+
- `aioble-peripheral` -- Peripheral (and Broadcaster) role functionality
63+
including advertising.
64+
- `aioble-security` -- Pairing and bonding support.
65+
- `aioble-server` -- GATT server, typically used by peripheral role devices
66+
but can also be used on centrals.
67+
68+
Alternatively, install the `aioble` package, which will install everything.
69+
5270
Usage
5371
-----
5472

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
1-
_files = (
2-
"__init__.py",
3-
"core.py",
4-
"device.py",
5-
)
6-
7-
options.defaults(peripheral=True, server=True)
8-
9-
if options.central:
10-
_files += ("central.py",)
11-
12-
if options.client:
13-
_files += ("client.py",)
14-
15-
if options.peripheral:
16-
_files += ("peripheral.py",)
17-
18-
if options.server:
19-
_files += ("server.py",)
20-
21-
if options.l2cap:
22-
_files += ("l2cap.py",)
23-
24-
if options.security:
25-
_files += ("security.py",)
26-
27-
package("aioble", files=_files)
1+
# This directory contains all aioble code, but the manifest itself just
2+
# forwards to the component manifests, which themselves reference the actual
3+
# code. This allows (for development purposes) all the files to live in the
4+
# one directory.
5+
6+
metadata(version="0.2.0")
7+
8+
# Default installation gives you everything. Install the individual
9+
# components (or a combination of them) if you want a more minimal install.
10+
require("aioble-peripheral")
11+
require("aioble-server")
12+
require("aioble-central")
13+
require("aioble-client")
14+
require("aioble-l2cap")
15+
require("aioble-security")

0 commit comments

Comments
 (0)