pureswift/bluetoothlinux
Pure Swift Bluetooth Stack for Linux
Usage
import Bluetooth
import BluetoothLinux
guard let hostController = await BluetoothLinux.HostController.default
else { fatalError("No Bluetooth adapters found") }
let uuid = UUID(rawValue: "E2C56DB5-DFFB-48D2-B060-D0F5A71096E0")!
let beacon = AppleBeacon(uuid: uuid, major: 1, minor: 1, rssi: -29)
do { try await hostController.iBeacon(beacon) }
catch { print("Error enabling iBeacon: \(error)") }Installation
Swift Package Manager
import PackageDescription
let package = Package(
dependencies: [
.package(
url: "https://github.com/PureSwift/BluetoothLinux.git",
.branch("master")
)
]
)Documentation
Read the documentation here. Documentation can be generated with DocC.
See Also
- Bluetooth - Pure Swift Bluetooth Definitions.
- GATT - Bluetooth Generic Attribute Profile (GATT) for Swift.
- Netlink - Swift library for communicating with Linux Kernel Netlink subsystem.
License
BluetoothLinux is released under the MIT license. See LICENSE for details.
[swift-badge]: https://img.shields.io/badge/Swift-6.0-orange.svg?style=flat [swift-url]: https://swift.org [platform-badge]: https://img.shields.io/badge/platform-linux-lightgrey.svg [platform-url]: https://swift.org [mit-badge]: https://img.shields.io/badge/License-MIT-blue.svg?style=flat [mit-url]: https://tldrlegal.com/license/mit-license [release-badge]: https://img.shields.io/github/release/PureSwift/BluetoothLinux.svg [release-url]: https://github.com/PureSwift/BluetoothLinux/releases
Package Metadata
Repository: pureswift/bluetoothlinux
Default branch: master
README: README.md