btleplug 0.12.0

A Cross-Platform Rust Bluetooth Low Energy (BLE) GATT library.
Documentation
[workspace]
exclude = ["tests/android/rust"]

[package]
name = "btleplug"
version = "0.12.0"
authors = ["Nonpolynomial, LLC <kyle@nonpolynomial.com>"]
license = "MIT/Apache-2.0/BSD-3-Clause"
repository = "https://github.com/deviceplug/btleplug"
homepage = "https://github.com/deviceplug/btleplug"
edition = "2024"
description = """
A Cross-Platform Rust Bluetooth Low Energy (BLE) GATT
library.
"""
readme = "README.md"
keywords = ["bluetooth", "BLE", "bluez", "uwp", "corebluetooth"]
categories = ["hardware-support"]

[lib]
name = "btleplug"
path = "src/lib.rs"

[features]
serde = ["uuid/serde", "serde_cr", "serde_bytes"]
jni-host-tests = ["jni/invocation", "once_cell"]

[dependencies]
async-trait = "0.1.89"
log = "0.4.29"
bitflags = "2.11.0"
thiserror = "2.0.18"
uuid = "1.22.0"
serde_cr = { package = "serde", version = "1.0.228", features = ["derive"], default-features = false, optional = true }
serde_bytes = { version = "0.11.19", optional = true }
dashmap = "6.1.0"
futures = "0.3.32"
static_assertions = "1.1.0"
# rt feature needed for block_on in macOS internal thread
tokio = { version = "1.50.0", features = ["sync", "rt", "time"] }
tokio-stream = { version = "0.1.18", features = ["sync"] }

[target.'cfg(target_os = "linux")'.dependencies]
dbus = "0.9.10"
bluez-async = "0.8.2"

[target.'cfg(target_os = "android")'.dependencies]
jni = "0.19.0"
once_cell = "1.21.3"

[target.'cfg(not(target_os = "android"))'.dependencies]
jni = { version = "0.19.0", optional = true }
once_cell = { version = "1.21.3", optional = true }

[target.'cfg(target_vendor = "apple")'.dependencies]
objc2 = "0.5.2"
objc2-foundation = { version = "0.2.2", default-features = false, features = [
    "std",
    "block2",
    "NSArray",
    "NSData",
    "NSDictionary",
    "NSEnumerator",
    "NSError",
    "NSObject",
    "NSString",
    "NSUUID",
    "NSValue",
] }
objc2-core-bluetooth = { version = "0.2.2", default-features = false, features = [
    "std",
    "CBAdvertisementData",
    "CBAttribute",
    "CBCentralManager",
    "CBCentralManagerConstants",
    "CBCharacteristic",
    "CBDescriptor",
    "CBManager",
    "CBPeer",
    "CBPeripheral",
    "CBService",
    "CBUUID",
] }

[target.'cfg(target_os = "windows")'.dependencies]
windows = { version = "0.62", features = ["Devices_Bluetooth", "Devices_Bluetooth_GenericAttributeProfile", "Devices_Bluetooth_Advertisement", "Devices_Radios", "Foundation_Collections", "Foundation", "Storage_Streams"] }
windows-future = "0.3.2"

[dev-dependencies]
rand = "0.10"
pretty_env_logger = "0.5.0"
tokio = { version = "1.50.0", features = ["macros", "rt", "rt-multi-thread"] }
serde_json = "1.0.149"
toml = "1.0.6"
anyhow = "1"
lazy_static = "1.5.0"