Crate bluer[][src]

Expand description

BlueR - Official BlueZ Bindings for Rust

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 sockets are presented using an API similar to Tokio networking.

This library depends on the tokio asynchronous runtime.

The following functionality is provided.

Currently, classic Bluetooth functionality is mostly unimplemented except for device discovery. However, pull requests and contributions are welcome!

Crate features

All crate features are enabled by default.

  • bluetoothd: Enables all functions requiring a running Bluetooth daemon.
  • id: Enables database of assigned numbers.
  • l2cap: Enables L2CAP sockets.

Basic usage

Create a Session using Session::new; this establishes a connection to the Bluetooth daemon. Then obtain a Bluetooth adapter using Session::adapter. From there on you can access most of the functionality using the methods provided by Adapter.

L2CAP sockets

Refer to the l2cap module. No Session and therefore no running Bluetooth daemon is required.

Modules

advbluetoothd

Bluetooth LE advertising.

agentbluetoothd

Bluetooth authorization agent.

gattbluetoothd

Local and remote GATT services.

idid

Manufacturer ids and assigned UUIDs for GATT services, GATT characteristics and GATT descriptors.

l2capl2cap

Logical Link Control and Adaptation Protocol (L2CAP) sockets.

Structs

Adapterbluetoothd

Interface to a Bluetooth adapter.

Bluetooth address.

Devicebluetoothd

Interface to a Bluetooth device.

Errorbluetoothd

Bluetooth error.

Invalid Bluetooth address error.

Modaliasbluetoothd

Linux kernel modalias information.

Sessionbluetoothd

Bluetooth session.

A Universally Unique Identifier (UUID).

Enums

AdapterEventbluetoothd

Bluetooth adapter event.

AdapterPropertybluetoothd

Bluetooth adapter property.

Bluetooth device address type.

DeviceEventbluetoothd

Bluetooth device event.

DevicePropertybluetoothd

Bluetooth device property.

ErrorKindbluetoothd

Bluetooth error kind.

Internal Bluetooth error kind.

SessionEventbluetoothd

Bluetooth session event.

Traits

UUID extension trait to convert to and from Bluetooth short UUIDs.

Type Definitions

Resultbluetoothd

Bluetooth result.