All Projects → bluez → bluer

bluez / bluer

Licence: other
BlueR — Official BlueZ Bindings for Rust

Programming Languages

rust
11053 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to bluer

py-bluetooth-utils
Python module containing bluetooth utility functions, in particular for easy BLE scanning and advertising
Stars: ✭ 60 (+39.53%)
Mutual labels:  bluetooth, bluetooth-low-energy, bluez
bluetooth-iot-service-python
This application connects two devices over Bluetooth and allows one to send messages to the other using json. Raspberry Pi Bluetooth interfacing with Linux via RFCOMM BT network
Stars: ✭ 23 (-46.51%)
Mutual labels:  bluetooth, rfcomm, bluez
pybluez-examples
Example Bluetooth tasks using the Python PyBluez module
Stars: ✭ 59 (+37.21%)
Mutual labels:  bluetooth, bluetooth-low-energy, bluez
JDY-08
JDY-08 Bluetooth transparent transmission module, with resource for KiCAD
Stars: ✭ 48 (+11.63%)
Mutual labels:  bluetooth, bluetooth-low-energy
rpi3-bluetooth
Raspberry Pi 3 on-board Bluetooth example
Stars: ✭ 17 (-60.47%)
Mutual labels:  bluetooth, bluetooth-low-energy
bluez-rs
Control Bluetooth on Linux.
Stars: ✭ 36 (-16.28%)
Mutual labels:  bluetooth, bluez
cordova-posprinter-sample
Cordova/Inoic sample for Epson ESC/POS printer
Stars: ✭ 24 (-44.19%)
Mutual labels:  bluetooth, bluetooth-low-energy
bluenet
Bluenet is the in-house firmware on Crownstone hardware. Functions: switching, dimming, energy monitoring, presence detection, indoor localization, switchcraft.
Stars: ✭ 79 (+83.72%)
Mutual labels:  bluetooth, bluetooth-low-energy
blessed-bluez
BLE library using Java and Bluez
Stars: ✭ 32 (-25.58%)
Mutual labels:  bluetooth-low-energy, bluez
IoT-iBeacon
An Ionic app for indoor localization and navigation using BLE iBeacons.
Stars: ✭ 39 (-9.3%)
Mutual labels:  bluetooth, bluetooth-low-energy
BleLab
Bluetooth LE Lab - UWP application for interaction with BLE GATT devices
Stars: ✭ 68 (+58.14%)
Mutual labels:  bluetooth, bluetooth-low-energy
pirowflo
All-in-one data interface for your Waterrower S4 Monitor or Smartrow
Stars: ✭ 73 (+69.77%)
Mutual labels:  bluetooth, bluetooth-low-energy
cannon-bluetooth-remote
Python script to emulate Canon's BR-E1 remote
Stars: ✭ 22 (-48.84%)
Mutual labels:  bluetooth, bluetooth-low-energy
bluetooth-manager
Java Bluetooth Manager. A library/framework for managing bluetooth adapters, bluetooth devices, GATT services and characteristics
Stars: ✭ 75 (+74.42%)
Mutual labels:  bluetooth, bluetooth-low-energy
python-sonicare
Python library to communicate with a Phillips Sonicare toothbrush via Bluetooth Low Energy
Stars: ✭ 46 (+6.98%)
Mutual labels:  bluetooth, bluetooth-low-energy
ble-heart-rate-demo
Web bluetooth heart rate monitor
Stars: ✭ 24 (-44.19%)
Mutual labels:  bluetooth, bluetooth-low-energy
ble-utilities-unreal
This is Unreal Engine plugin that allows to scan for BLE devices with Cycling Power service running, connect to one of them and subscribe for its notifications.
Stars: ✭ 48 (+11.63%)
Mutual labels:  bluetooth, bluetooth-low-energy
IOS-DFU-Library
OTA DFU Library for Mac and iOS, compatible with nRF5x SoCs
Stars: ✭ 400 (+830.23%)
Mutual labels:  bluetooth, bluetooth-low-energy
awesome-bluetooth-security
List of Bluetooth BR/EDR/LE security resources
Stars: ✭ 220 (+411.63%)
Mutual labels:  bluetooth, bluetooth-low-energy
GATT
Bluetooth Generic Attribute Profile (GATT) for Swift (Supports Linux)
Stars: ✭ 48 (+11.63%)
Mutual labels:  bluetooth, bluetooth-low-energy

BlueR — Official BlueZ Bindings for Rust

crates.io page docs.rs page BSD-2-Clause license

This library provides the official Rust interface to the Linux Bluetooth protocol stack (BlueZ). Both publishing local and consuming remote GATT services using idiomatic Rust code is supported. L2CAP and RFCOMM sockets are presented using an API similar to Tokio networking.

The following functionality is provided:

  • Bluetooth adapters
    • enumeration
    • configuration of power, discoverability, name, etc.
    • hot-plug support through change events stream
  • Bluetooth devices
    • discovery
    • querying of address, name, class, signal strength (RSSI), etc.
    • Bluetooth Low Energy advertisements
    • change events stream
    • connecting and pairing
  • consumption of remote GATT services
    • GATT service discovery
    • read, write and notify operations on characteristics
    • read and write operations on characteristic descriptors
    • optional use of low-overhead AsyncRead and AsyncWrite streams for notify and write operations
  • publishing local GATT services
    • read, write and notify operations on characteristics
    • read and write operations on characteristic descriptors
    • two programming models supported
      • callback-based interface
      • low-overhead AsyncRead and AsyncWrite streams
  • sending Bluetooth Low Energy advertisements
  • Bluetooth authorization agent
  • efficient event dispatching
    • not affected by D-Bus match rule count
    • O(1) in number of subscriptions
  • L2CAP sockets
    • support for both classic Bluetooth (BR/EDR) and Bluetooth LE
    • stream oriented
    • sequential packet oriented
    • datagram oriented
    • async IO interface with AsyncRead and AsyncWrite support
  • RFCOMM sockets
    • support for classic Bluetooth (BR/EDR)
    • stream oriented
    • async IO interface with AsyncRead and AsyncWrite support
  • database of assigned numbers
    • manufacturer ids
    • service classes, GATT services, characteristics and descriptors

Currently, some classic Bluetooth (BR/EDR) functionality is missing. However, pull requests and contributions are welcome!

History

This project started as a fork of blurz but has since then become a full rewrite. It was published under the name blez before it was designated the official Rust interface to BlueZ and renamed to BlueR. Documentation has been mostly copied from the BlueZ API specification, but also adapted where it makes sense.

Crate features

All crate features are enabled by default.

  • bluetoothd: Enables all functions requiring a running Bluetooth daemon. For building, D-Bus library headers, provided by libdbus-1-dev on Debian, must be installed.
  • id: Enables database of assigned numbers.
  • l2cap: Enables L2CAP sockets.
  • rfcomm: Enables RFCOMM sockets.

Requirements

This library has been tested with BlueZ 5.60. Older versions might work, but be aware that many bugs related to GATT handling exist. Refer to the official changelog for details.

If any bluetoothd feature is used the Bluetooth daemon must be running and configured for access over D-Bus. On most distributions this should work out of the box.

Configuration

The following options in /etc/bluetooth/main.conf are helpful when working with GATT services.

[GATT]
Cache = no
Channels = 1

This disables the GATT cache to avoid stale data during device discovery.

By only allowing one channel the extended attribute protocol (EATT) is disabled. If EATT is enabled, all GATT commands and notifications are sent over multiple L2CAP channels and can be reordered arbitrarily by lower layers of the protocol stack. This makes sequential data transmission over GATT characteristics more difficult.

Building

When cloning this repository make sure to use the following command. Otherwise the build will fail with file not found errors.

git clone --recursive https://github.com/bluez/bluer.git

D-Bus development headers are required for building.

Troubleshooting

The library returns detailed errors received from BlueZ.

Set the Rust log level to trace to see all D-Bus communications with BlueZ.

In some cases checking the Bluetooth system log might provide further insights. On Debian-based systems it can be displayed by executing journalctl -u bluetooth. Check the bluetoothd man page for increasing the log level.

Sometimes deleting the system Bluetooth cache at /var/lib/bluetooth and restarting bluetoothd fixes persistent issues with device connectivity.

Examples

Refer to the API documentation and examples folder for examples.

The following example applications are provided.

  • discover_devices: Discover Bluetooth devices and print their properties.

  • gatt_client: Simple GATT client that calls read, write and notify on a characteristic.

  • gatt_server_cb: Corresponding GATT server implemented using callback programming model.

  • gatt_server_io: Corresponding GATT server implemented using IO programming model.

  • gatt_echo_client: Simple GATT client that connects to a server and sends and receives test data.

  • gatt_echo_server: Corresponding GATT server that echos received data.

  • l2cap_client: Simple L2CAP socket client that connects to a socket and sends and receives test data.

  • l2cap_server: Corresponding L2CAP socket server that echos received data.

  • le_advertise: Register Bluetooth LE advertisement.

  • list_adapters: List installed Bluetooth adapters and their properties.

Use cargo run --example <name> to run a particular example application.

Tools

See the BlueR tools crate for tools that build on this library.

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].