Pixels Plugin for Unity
Enable communications with Pixels dice using Bluetooth Low Energy.
|
Represents a primary service on a Bluetooth Low Energy (BLE) peripheral. More...
#include <Service.h>
Public Member Functions | |
Destructor | |
~Service () | |
Closes and destroys the Service instance. | |
Getters | |
std::uint16_t | handle () const |
Gets the 16 bits handle of the BLE service. | |
winrt::guid | uuid () const |
Gets the UUID of the service. | |
std::shared_ptr< const Peripheral > | peripheral () const |
Gets the peripheral to which the service belongs. | |
std::shared_ptr< Peripheral > | peripheral () |
Gets the peripheral to which the service belongs. | |
Characteristics access | |
std::shared_ptr< Characteristic > | getCharacteristic (const winrt::guid &uuid) |
Gets the first Characteristic instance with the given UUID. | |
const std::vector< std::shared_ptr< Characteristic > > | getCharacteristics (const winrt::guid &uuid) |
Gets the all the Characteristic instances with the given UUID. | |
void | copyCharacteristics (std::vector< std::shared_ptr< Characteristic > > &outCharacteristics) |
Copy the discovered characteristics to the given std::vector. | |
Represents a primary service on a Bluetooth Low Energy (BLE) peripheral.
A specific Characteristic may be retrieved by its UUID with getCharacteristic().
The Service class internally stores a WinRT's GattDeviceService
object.
void Systemic::BluetoothLE::Service::copyCharacteristics | ( | std::vector< std::shared_ptr< Characteristic > > & | outCharacteristics | ) |
Copy the discovered characteristics to the given std::vector.
outCharacteristics | A std::vector to which the discovered characteristics are copied (appended). |
std::shared_ptr< Characteristic > Systemic::BluetoothLE::Service::getCharacteristic | ( | const winrt::guid & | uuid | ) |
Gets the first Characteristic instance with the given UUID.
uuid | The UUID of the Characteristic. |
const std::vector< std::shared_ptr< Characteristic > > Systemic::BluetoothLE::Service::getCharacteristics | ( | const winrt::guid & | uuid | ) |
Gets the all the Characteristic instances with the given UUID.
Characteristics are always returned in the same order.
uuid | The UUID of the Characteristic. |
std::uint16_t Systemic::BluetoothLE::Service::handle | ( | ) | const |
Gets the 16 bits handle of the BLE service.
std::shared_ptr< Peripheral > Systemic::BluetoothLE::Service::peripheral | ( | ) |
Gets the peripheral to which the service belongs.
std::shared_ptr< const Peripheral > Systemic::BluetoothLE::Service::peripheral | ( | ) | const |
Gets the peripheral to which the service belongs.
winrt::guid Systemic::BluetoothLE::Service::uuid | ( | ) | const |
Gets the UUID of the service.