Need help with BluetoothLinux?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

PureSwift
138 Stars 23 Forks MIT License 515 Commits 2 Opened issues

Description

Pure Swift Linux Bluetooth Stack

Services available

!
?

Need anything else?

Contributors list

BluetoothLinux

Swift Platform Release Build Status License CodeBeat

SPM compatible

Pure Swift Bluetooth Stack for Linux

Does not require BlueZ, communicates directly with the Linux kernel and Bluetooth controller.

Usage

import Bluetooth
import BluetoothLinux

guard let hostController = 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 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

Documentation can be generated with Jazzy.

swift package generate-xcodeproj
jazzy

Read the documentation here. For more information, see the gh-pages branch.

Troubleshooting

Do not test in Parallels or VMware with the built in Bluetooth adapter found in Macs. You can, however, use VMWare or Parallels, with a Linux compatible Bluetooth LE USB adapter plugged in. VirtualBox will work with the builtin adapter on Macs.

For best results, test with Swift 5.1.5 on ARMv7 and a Linux-comptible Bluetooth dongle (e.g. CSR8510 A10).

See Also

  • Bluetooth - Pure Swift Bluetooth Definitions.
  • GATT - Bluetooth Generic Attribute Profile (GATT) for Swift
  • Silica - Pure Swift CoreGraphics (Quartz2D) implementation
  • Predicate - Pure Swift Predicate implementation

License

BluetoothLinux is released under the MIT license. See LICENSE for details.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.