kopia lustrzana https://github.com/micropython/micropython-lib
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 <jim.mussared@gmail.com>pull/551/head
rodzic
4dc2d5e17f
commit
8503017e3b
|
@ -0,0 +1,5 @@
|
|||
metadata(version="0.2.0")
|
||||
|
||||
require("aioble-core")
|
||||
|
||||
package("aioble", files=("central.py",), base_path="../aioble")
|
|
@ -0,0 +1,5 @@
|
|||
metadata(version="0.2.0")
|
||||
|
||||
require("aioble-core")
|
||||
|
||||
package("aioble", files=("client.py",), base_path="../aioble")
|
|
@ -0,0 +1,11 @@
|
|||
metadata(version="0.2.0")
|
||||
|
||||
package(
|
||||
"aioble",
|
||||
files=(
|
||||
"__init__.py",
|
||||
"core.py",
|
||||
"device.py",
|
||||
),
|
||||
base_path="../aioble",
|
||||
)
|
|
@ -0,0 +1,5 @@
|
|||
metadata(version="0.2.0")
|
||||
|
||||
require("aioble-core")
|
||||
|
||||
package("aioble", files=("l2cap.py",), base_path="../aioble")
|
|
@ -0,0 +1,5 @@
|
|||
metadata(version="0.2.0")
|
||||
|
||||
require("aioble-core")
|
||||
|
||||
package("aioble", files=("peripheral.py",), base_path="../aioble")
|
|
@ -0,0 +1,5 @@
|
|||
metadata(version="0.2.0")
|
||||
|
||||
require("aioble-core")
|
||||
|
||||
package("aioble", files=("security.py",), base_path="../aioble")
|
|
@ -0,0 +1,5 @@
|
|||
metadata(version="0.2.0")
|
||||
|
||||
require("aioble-core")
|
||||
|
||||
package("aioble", files=("server.py",), base_path="../aioble")
|
|
@ -1,7 +1,8 @@
|
|||
aioble
|
||||
======
|
||||
|
||||
This library provides an object-oriented, asyncio-based wrapper for MicroPython's [ubluetooth](https://docs.micropython.org/en/latest/library/ubluetooth.html) API.
|
||||
This library provides an object-oriented, asyncio-based wrapper for MicroPython's
|
||||
[bluetooth](https://docs.micropython.org/en/latest/library/bluetooth.html) API.
|
||||
|
||||
**Note**: aioble requires MicroPython v1.17 or higher.
|
||||
|
||||
|
@ -49,6 +50,23 @@ Security:
|
|||
|
||||
All remote operations (connect, disconnect, client read/write, server indicate, l2cap recv/send, pair) are awaitable and support timeouts.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
You can install any combination of the following packages.
|
||||
- `aioble-central` -- Central (and Observer) role functionality including
|
||||
scanning and connecting.
|
||||
- `aioble-client` -- GATT client, typically used by central role devices but
|
||||
can also be used on peripherals.
|
||||
- `aioble-l2cap` -- L2CAP Connection-oriented-channels support.
|
||||
- `aioble-peripheral` -- Peripheral (and Broadcaster) role functionality
|
||||
including advertising.
|
||||
- `aioble-security` -- Pairing and bonding support.
|
||||
- `aioble-server` -- GATT server, typically used by peripheral role devices
|
||||
but can also be used on centrals.
|
||||
|
||||
Alternatively, install the `aioble` package, which will install everything.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
|
|
|
@ -1,27 +1,15 @@
|
|||
_files = (
|
||||
"__init__.py",
|
||||
"core.py",
|
||||
"device.py",
|
||||
)
|
||||
# This directory contains all aioble code, but the manifest itself just
|
||||
# forwards to the component manifests, which themselves reference the actual
|
||||
# code. This allows (for development purposes) all the files to live in the
|
||||
# one directory.
|
||||
|
||||
options.defaults(peripheral=True, server=True)
|
||||
metadata(version="0.2.0")
|
||||
|
||||
if options.central:
|
||||
_files += ("central.py",)
|
||||
|
||||
if options.client:
|
||||
_files += ("client.py",)
|
||||
|
||||
if options.peripheral:
|
||||
_files += ("peripheral.py",)
|
||||
|
||||
if options.server:
|
||||
_files += ("server.py",)
|
||||
|
||||
if options.l2cap:
|
||||
_files += ("l2cap.py",)
|
||||
|
||||
if options.security:
|
||||
_files += ("security.py",)
|
||||
|
||||
package("aioble", files=_files)
|
||||
# Default installation gives you everything. Install the individual
|
||||
# components (or a combination of them) if you want a more minimal install.
|
||||
require("aioble-peripheral")
|
||||
require("aioble-server")
|
||||
require("aioble-central")
|
||||
require("aioble-client")
|
||||
require("aioble-l2cap")
|
||||
require("aioble-security")
|
||||
|
|
Ładowanie…
Reference in New Issue