Giter VIP home page Giter VIP logo

bluetoothlinux's Introduction

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.

bluetoothlinux's People

Contributors

colemancda avatar jmarkstar avatar carlos21 avatar gitter-badger avatar iachievedit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.