Swiftpack.co - PureSwift/BluetoothLinux as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by PureSwift.
PureSwift/BluetoothLinux 5.0.4
Pure Swift Linux Bluetooth Stack
⭐️ 158
🕓 2 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/PureSwift/BluetoothLinux.git", from: "5.0.4")

BluetoothLinux

Swift Platform Release License

Pure Swift Bluetooth Stack for Linux

Does not require BlueZ userland library, communicates directly with the Linux kernel Bluetooth subsystem.

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.

GitHub

link
Stars: 158
Last commit: 4 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

v5.0.4
2 weeks ago
  • 0126c17a4049bd59cc0dbb45bca801099acd7349 Build as dynamic library

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics