All Projects → PureSwift → GATT

PureSwift / GATT

Licence: MIT license
Bluetooth Generic Attribute Profile (GATT) for Swift (Supports Linux)

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to GATT

SwiftyTeeth
A simple, lightweight library intended to take away some of the cruft and tediousness of using CoreBluetooth
Stars: ✭ 21 (-56.25%)
Mutual labels:  bluetooth, bluetooth-low-energy, corebluetooth
bluetooth-manager
Java Bluetooth Manager. A library/framework for managing bluetooth adapters, bluetooth devices, GATT services and characteristics
Stars: ✭ 75 (+56.25%)
Mutual labels:  bluetooth, bluetooth-low-energy, gatt
coBlue
Use Bluetooth Low Energy for remote commands, file transfer, Based on bluez Bluetooth protocol stack (BLE Terminal)
Stars: ✭ 41 (-14.58%)
Mutual labels:  bluetooth, corebluetooth, gatt
redux-bluetooth
Redux middleware to dispatch actions via bluetooth to a peripheral store
Stars: ✭ 17 (-64.58%)
Mutual labels:  bluetooth, bluetooth-low-energy
theheraldproject.github.io
Herald - Proximity Detection Protocol and research documentation, including the Fair Efficacy Formula
Stars: ✭ 17 (-64.58%)
Mutual labels:  bluetooth, bluetooth-low-energy
ble2mqtt
A BLE to MQTT bridge
Stars: ✭ 60 (+25%)
Mutual labels:  bluetooth, gatt
daydream-node
Quick Node.js module to connect to the Daydream controller and receive all the data
Stars: ✭ 17 (-64.58%)
Mutual labels:  bluetooth, bluetooth-low-energy
ESP32BleAdvertise
Simple library for BLE advertise using ESP32 in Arduino
Stars: ✭ 39 (-18.75%)
Mutual labels:  bluetooth, bluetooth-low-energy
IOS-CoreBluetooth-Mock
Mocking library for CoreBluetooth framework.
Stars: ✭ 142 (+195.83%)
Mutual labels:  bluetooth-low-energy, corebluetooth
awesome-bluetooth-security
List of Bluetooth BR/EDR/LE security resources
Stars: ✭ 220 (+358.33%)
Mutual labels:  bluetooth, bluetooth-low-energy
pyrinas-ble-client
nRF52 SDK(v16) based OS for use with Particle Xenon and other nRF52840 boards.
Stars: ✭ 15 (-68.75%)
Mutual labels:  bluetooth, bluetooth-low-energy
SmartSpin2k
Transform your spin bike into a Smart Trainer!
Stars: ✭ 88 (+83.33%)
Mutual labels:  bluetooth, bluetooth-low-energy
react-native-easybluetooth-classic
⚛ A Library for easy implementation of Serial Bluetooth Classic on React Native (Android Only).
Stars: ✭ 44 (-8.33%)
Mutual labels:  bluetooth, bluetooth-low-energy
pycalima
Python interface for Pax Calima Fan via Bluetooth LE
Stars: ✭ 34 (-29.17%)
Mutual labels:  bluetooth, bluetooth-low-energy
mijia-homie
A Homie MQTT bridge for the Xiaomi Mijia 2 hygrometer-thermometer. This repo also serves as the monorepo for a handful of helper crates related to Homie and Bluetooth.
Stars: ✭ 40 (-16.67%)
Mutual labels:  bluetooth, bluetooth-low-energy
Bluetooth-ble-beamer-and-scanner-for-tracing-corona-virus-infected-individual
Bluetooth ble beacon beamer and scanner for tracing corona virus infected person similar to Trace Together app
Stars: ✭ 26 (-45.83%)
Mutual labels:  bluetooth, bluetooth-low-energy
gpedal
Virtually ride indoors with Google Street View and bluetooth bike power meters (Web Bluetooth API)
Stars: ✭ 83 (+72.92%)
Mutual labels:  bluetooth-low-energy, gatt
ios
CoThings's iOS application. CoThings is a realtime counter for shared things.
Stars: ✭ 13 (-72.92%)
Mutual labels:  bluetooth, bluetooth-low-energy
DroneJS
A Node.js based library for controlling a Parrot minidrone. This library also provides the feature to take pictures from the drone, download them all at a time and delete them whenever required.
Stars: ✭ 19 (-60.42%)
Mutual labels:  bluetooth, bluetooth-low-energy
BLE
No description or website provided.
Stars: ✭ 25 (-47.92%)
Mutual labels:  bluetooth, bluetooth-low-energy

GATT

Swift Platform Release License

Bluetooth Generic Attribute Profile (GATT) for Swift

Usage

Peripheral

import Bluetooth
#if canImport(Darwin)
import DarwinGATT
#elseif os(Linux)
import BluetoothLinux
#endif

#if os(Linux)
typealias LinuxPeripheral = GATTPeripheral<BluetoothLinux.HostController, BluetoothLinux.L2CAPSocket>
guard let hostController = await HostController.default else {
    fatalError("No Bluetooth hardware connected")
}
let serverOptions = GATTPeripheralOptions(
    maximumTransmissionUnit: .max,
    maximumPreparedWrites: 1000
)
let peripheral = LinuxPeripheral(
    hostController: hostController,
    options: serverOptions,
    socket: BluetoothLinux.L2CAPSocket.self
)
#elseif canImport(Darwin)
let peripheral = DarwinPeripheral()
#else
#error("Unsupported platform")
#endif

// start advertising
try await peripheral.start()

Central

import Bluetooth
#if canImport(Darwin)
import DarwinGATT
#elseif os(Linux)
import BluetoothLinux
#endif

#if os(Linux)
typealias LinuxCentral = GATTCentral<BluetoothLinux.HostController, BluetoothLinux.L2CAPSocket>
let hostController = await HostController.default
let central = LinuxCentral(
    hostController: hostController,
    socket: BluetoothLinux.L2CAPSocket.self
)
#elseif canImport(Darwin)
let central = DarwinCentral()
#else
#error("Unsupported platform")
#endif

// start scanning
let stream = try await central.scan(filterDuplicates: true)
for try await scanData in stream {
    print(scanData)
    stream.stop()
}

Documentation

Read the documentation here. Documentation can be generated with DocC.

See Also

  • Bluetooth - Pure Swift Bluetooth Definitions
  • BluetoothLinux - Pure Swift Linux Bluetooth Stack
  • Netlink - Swift library for communicating with Linux Kernel Netlink subsystem (Linux Only)

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].