Pixels Plugin for Unity
Enable communications with Pixels dice using Bluetooth Low Energy.
|
A collection of C++ classes that provides a simplified access to Bluetooth Low Energy peripherals. More...
Classes | |
class | AdvertisementData |
Stores an advertisement packet data type and it's associated binary data. More... | |
class | Characteristic |
Represents a service's characteristic of a Bluetooth Low Energy (BLE) peripheral. More... | |
class | ManufacturerData |
Stores a company id and it's associated binary data. More... | |
class | Peripheral |
Represents a Bluetooth Low Energy (BLE) peripheral. More... | |
class | ScannedPeripheral |
Holds the information from advertisement packet(s) received from a peripheral. More... | |
class | Scanner |
Implements scanning of Bluetooth Low Energy (BLE) peripherals. It stores and notifies of discovered peripherals with ScannedPeripheral objects. More... | |
class | Service |
Represents a primary service on a Bluetooth Low Energy (BLE) peripheral. More... | |
class | ServiceData |
Stores a company id and it's associated binary data. More... | |
Typedefs | |
using | bluetooth_address_t = std::uint64_t |
Type for a Bluetooth address. | |
Functions | |
std::future< BleAdapterState > | getAdapterStateAsync () |
Returns the default Bluetooth adapter state. | |
std::future< bool > | subscribeAdapterStateChangedAsync (const std::function< void(BleAdapterState)> &onStateChanged) |
Subscribe to the default Bluetooth adapter radio state events. | |
A collection of C++ classes that provides a simplified access to Bluetooth Low Energy peripherals.
WinRT APIs are used to access Bluetooth. It allows communicating with devices without needing to first add them in Windows' Bluetooth devices manager.
Requires at least Windows 10 version 1709 (Fall Creators Update).
The Scanner class enables scanning for Bluetooth Low Energy peripherals. It stores and notifies of discovered peripherals with ScannedPeripheral objects.
The Peripheral class implements the most used BLE operation for communicating with BLE peripherals. After a successful connection, services and characteristics are discovered and made accessible through the Service and Characteristic classes.
Below is a diagram of the main classes of this library:
|
strong |
Bluetooth adapter states.
|
strong |
Peripheral requests statuses.
Standard BLE values for characteristic properties, those are flags that can be combined.
Enumerator | |
---|---|
Broadcast | Characteristic is broadcastable. |
Read | Characteristic is readable. |
WriteWithoutResponse | Characteristic can be written without response. |
Write | Characteristic can be written. |
Notify | Characteristic supports notification. |
Indicate | Characteristic supports indication. |
SignedWrite | Characteristic supports write with signature. |
ExtendedProperties | Characteristic has extended properties. |
NotifyEncryptionRequired | Characteristic notification uses encryption. |
IndicateEncryptionRequired | Characteristic indication uses encryption. |
|
strong |
Peripheral connection events.
|
strong |
Peripheral connection event reasons.
Enumerator | |
---|---|
Unknown | The disconnect happened for an unknown reason. |
Success | The disconnect was initiated by user. |
Canceled | Connection attempt canceled by user. |
NotSupported | Peripheral doesn't have all required services. |
Timeout | Peripheral didn't responded in time. |
LinkLoss | Peripheral was disconnected while in "auto connect" mode. |
AdpaterOff | The local device Bluetooth adapter is off. |
Peripheral | Disconnection was initiated by peripheral. |
std::future< BleAdapterState > Systemic::BluetoothLE::getAdapterStateAsync | ( | ) |
Returns the default Bluetooth adapter state.
std::future< bool > Systemic::BluetoothLE::subscribeAdapterStateChangedAsync | ( | const std::function< void(BleAdapterState)> & | onStateChanged | ) |
Subscribe to the default Bluetooth adapter radio state events.
onStateChanged | Called when the radio state changes |