Module api

Source
Expand description

The api module contains the traits and types which make up btleplug’s API. These traits have a different implementation for each supported platform, but only one implementation can be found on any given platform. These implementations are in the platform module.

You will may want to import both the traits and their implementations, like:

use btleplug::api::{Central, Manager as _, Peripheral as _};
use btleplug::platform::{Adapter, Manager, Peripheral};

Modules§

bleuuid
Utilities for dealing with BLE UUIDs, converting to and from their short formats.

Structs§

BDAddr
Stores the 6 byte address used to identify Bluetooth devices.
CharPropFlags
A set of properties that indicate what operations are supported by a Characteristic.
Characteristic
A Bluetooth characteristic. Characteristics are the main way you will interact with other bluetooth devices. Characteristics are identified by a UUID which may be standardized (like 0x2803, which identifies a characteristic for reading heart rate measurements) but more often are specific to a particular device. The standard set of characteristics can be found here.
Descriptor
Add doc
PeripheralProperties
The properties of this peripheral, as determined by the advertising reports we’ve received for it.
ScanFilter
The filter used when scanning for BLE devices.
Service
A GATT service. Services are groups of characteristics, which may be standard or device-specific.
ValueNotification
A notification sent from a peripheral due to a change in a value.

Enums§

AddressType
CentralEvent
CentralState
The state of the Central
ParseBDAddrError
An error parsing a BDAddr from a string.
WriteType
The type of write operation to use.

Traits§

Central
Central is the “client” of BLE. It’s able to scan for and establish connections to peripherals. A Central can be obtained from Manager::adapters().
Manager
The Manager is the entry point to the library, providing access to all the Bluetooth adapters on the system. You can obtain an instance from platform::Manager::new().
Peripheral
Peripheral is the device that you would like to communicate with (the “server” of BLE). This struct contains both the current state of the device (its properties, characteristics, etc.) as well as functions for communication.