struct Core::Bluetooth::IGattCentralDevice

Overview

#include <coregattcentral.h>

struct IGattCentralDevice
{
    // enums

    enum ConnectionMode;

    // methods

    virtual CStringPtr getIdentifier () const = 0;
    virtual CStringPtr getName () const = 0;
    virtual CStringPtr getManufacturerData () const = 0;
    virtual tbool isConnected () const = 0;
    virtual ErrorCode setConnectionMode (ConnectionMode connectionMode) = 0;
    virtual ErrorCode getServicesAsync () = 0;
    virtual void addObserver (IGattCentralDeviceObserver* observer) = 0;
    virtual void removeObserver (IGattCentralDeviceObserver* observer) = 0;
};

Detailed Documentation

Methods

virtual CStringPtr getIdentifier () const = 0

Get a unique string for this device.

virtual CStringPtr getName () const = 0

Get the user-facing name that the device included in its advertisement.

virtual CStringPtr getManufacturerData () const = 0

Get the manufacturer-specific string that the device included in its advertisement.

virtual tbool isConnected () const = 0

Check if this device is (still) connected.

Connections are handled by the IGattCentral interface, not the device. This is set to true after onConnectCompleted() returns with no error. This is set to false after onDisconnectCompleted() returns.

virtual ErrorCode setConnectionMode (ConnectionMode connectionMode) = 0

Increase performance at the cost of energy efficiency or vice versa.

virtual ErrorCode getServicesAsync () = 0

Retrieve all services of this device.

This function may only be called if the device is connected.

virtual void addObserver (IGattCentralDeviceObserver* observer) = 0

Start receiving callbacks.

virtual void removeObserver (IGattCentralDeviceObserver* observer) = 0

Stop receiving callbacks.