Pixels Plugin for Unity
Enable communications with Pixels dice using Bluetooth Low Energy.
Loading...
Searching...
No Matches
Systemic::BluetoothLE::Service Class Reference

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 Peripheralperipheral () const
 Gets the peripheral to which the service belongs.
 
std::shared_ptr< Peripheralperipheral ()
 Gets the peripheral to which the service belongs.
 
Characteristics access
std::shared_ptr< CharacteristicgetCharacteristic (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.
 

Detailed Description

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.

Member Function Documentation

◆ copyCharacteristics()

void Systemic::BluetoothLE::Service::copyCharacteristics ( std::vector< std::shared_ptr< Characteristic > > &  outCharacteristics)

Copy the discovered characteristics to the given std::vector.

Parameters
outCharacteristicsA std::vector to which the discovered characteristics are copied (appended).

◆ getCharacteristic()

std::shared_ptr< Characteristic > Systemic::BluetoothLE::Service::getCharacteristic ( const winrt::guid &  uuid)

Gets the first Characteristic instance with the given UUID.

Parameters
uuidThe UUID of the Characteristic.
Returns
The Characteristic instance.

◆ getCharacteristics()

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.

Parameters
uuidThe UUID of the Characteristic.
Returns
The Characteristic instances.

◆ handle()

std::uint16_t Systemic::BluetoothLE::Service::handle ( ) const

Gets the 16 bits handle of the BLE service.

Returns
The 16 bits handle of the service.

◆ peripheral() [1/2]

std::shared_ptr< Peripheral > Systemic::BluetoothLE::Service::peripheral ( )

Gets the peripheral to which the service belongs.

Returns
The peripheral for the service.

◆ peripheral() [2/2]

std::shared_ptr< const Peripheral > Systemic::BluetoothLE::Service::peripheral ( ) const

Gets the peripheral to which the service belongs.

Returns
The peripheral for the service.

◆ uuid()

winrt::guid Systemic::BluetoothLE::Service::uuid ( ) const

Gets the UUID of the service.

Returns
The UUID of the service.

The documentation for this class was generated from the following file: