IoT::BtLE

class GATTPeripheral

File Information

Library: IoT/BtLE
Package: BtLE
Header: IoT/BtLE/GATTPeripheral.h

Description

This class provides a high-level interface to a Bt LE peripheral device using the Bt Generic Attribute Profile (GATT).

Inheritance

Direct Base Classes: Peripheral

All Base Classes: Peripheral

Member Summary

Member Functions: address, characteristic, characteristicForAssignedNumber, characteristics, connect, connectAsync, deviceName, disconnect, expandUUID, firmwareRevision, handleForDescriptor, hardwareRevision, isConnected, manufacturerName, modelNumber, onConnected, onDisconnected, onError, onIndication, onNotification, readBytes, readDeviceInformation, readDouble, readFloat, readInt16, readInt32, readInt64, readInt8, readString, readString0, readUInt16, readUInt32, readUInt64, readUInt8, readValue, serialNumber, serviceUUIDForAssignedNumber, services, softwareRevision, writeBytes, writeDouble, writeFloat, writeInt16, writeInt32, writeInt64, writeInt8, writeString, writeUInt16, writeUInt32, writeUInt64, writeUInt8, writeValue

Inherited Functions: address, characteristic, characteristicForAssignedNumber, characteristics, connect, connectAsync, deviceName, disconnect, expandUUID, firmwareRevision, handleForDescriptor, hardwareRevision, isConnected, manufacturerName, modelNumber, readBytes, readDouble, readFloat, readInt16, readInt32, readInt64, readInt8, readString, readString0, readUInt16, readUInt32, readUInt64, readUInt8, serialNumber, serviceUUIDForAssignedNumber, services, softwareRevision, writeBytes, writeDouble, writeFloat, writeInt16, writeInt32, writeInt64, writeInt8, writeString, writeUInt16, writeUInt32, writeUInt64, writeUInt8

Constructors

GATTPeripheral

GATTPeripheral(
    const std::string & address,
    GATTClient::Ptr pGATTClient
);

Creates the GATTPeripheral.

Destructor

~GATTPeripheral virtual

~GATTPeripheral();

Destroys the GATTPeripheral.

Member Functions

address virtual

std::string address() const;

characteristic virtual

Characteristic characteristic(
    const Poco::UUID & serviceUUID,
    const Poco::UUID & characteristicUUID
);

characteristicForAssignedNumber virtual

Characteristic characteristicForAssignedNumber(
    const Poco::UUID & serviceUUID,
    Poco::UInt32 assignedNumber
);

characteristics virtual

std::vector < Poco::UUID > characteristics(
    const Poco::UUID & serviceUUID
);

connect virtual

void connect();

connectAsync virtual

void connectAsync();

deviceName virtual

std::string deviceName();

disconnect virtual

void disconnect();

expandUUID virtual

Poco::UUID expandUUID(
    Poco::UInt32 uuid
);

firmwareRevision virtual

std::string firmwareRevision();

handleForDescriptor virtual

Handle handleForDescriptor(
    const Poco::UUID & serviceUUID,
    const Poco::UUID & characteristicUUID,
    const Poco::UUID & descriptorUUID
);

hardwareRevision virtual

std::string hardwareRevision();

isConnected virtual

bool isConnected() const;

manufacturerName virtual

std::string manufacturerName();

modelNumber virtual

std::string modelNumber();

readBytes virtual

std::vector < char > readBytes(
    Handle valueHandle
);

readDouble virtual

double readDouble(
    Handle valueHandle
);

readFloat virtual

float readFloat(
    Handle valueHandle
);

readInt16 virtual

Poco::Int16 readInt16(
    Handle valueHandle
);

readInt32 virtual

Poco::Int32 readInt32(
    Handle valueHandle
);

readInt64 virtual

Poco::Int64 readInt64(
    Handle valueHandle
);

readInt8 virtual

Poco::Int8 readInt8(
    Handle valueHandle
);

readString virtual

std::string readString(
    Handle valueHandle
);

readString0 virtual

std::string readString0(
    Handle valueHandle
);

readUInt16 virtual

Poco::UInt16 readUInt16(
    Handle valueHandle
);

readUInt32 virtual

Poco::UInt32 readUInt32(
    Handle valueHandle
);

readUInt64 virtual

Poco::UInt64 readUInt64(
    Handle valueHandle
);

readUInt8 virtual

Poco::UInt8 readUInt8(
    Handle valueHandle
);

serialNumber virtual

std::string serialNumber();

serviceUUIDForAssignedNumber virtual

Poco::UUID serviceUUIDForAssignedNumber(
    Poco::UInt32 assignedNumber
);

services virtual

std::vector < Poco::UUID > services();

softwareRevision virtual

std::string softwareRevision();

writeBytes virtual

void writeBytes(
    Handle valueHandle,
    const std::vector < char > & value,
    bool withResponse
);

writeDouble virtual

void writeDouble(
    Handle valueHandle,
    double value,
    bool withResponse
);

writeFloat virtual

void writeFloat(
    Handle valueHandle,
    float value,
    bool withResponse
);

writeInt16 virtual

void writeInt16(
    Handle valueHandle,
    Poco::Int16 value,
    bool withResponse
);

writeInt32 virtual

void writeInt32(
    Handle valueHandle,
    Poco::Int32 value,
    bool withResponse
);

writeInt64 virtual

void writeInt64(
    Handle valueHandle,
    Poco::Int64 value,
    bool withResponse
);

writeInt8 virtual

void writeInt8(
    Handle valueHandle,
    Poco::Int8 value,
    bool withResponse
);

writeString virtual

void writeString(
    Handle valueHandle,
    const std::string & value,
    bool withResponse
);

writeUInt16 virtual

void writeUInt16(
    Handle valueHandle,
    Poco::UInt16 value,
    bool withResponse
);

writeUInt32 virtual

void writeUInt32(
    Handle valueHandle,
    Poco::UInt32 value,
    bool withResponse
);

writeUInt64 virtual

void writeUInt64(
    Handle valueHandle,
    Poco::UInt64 value,
    bool withResponse
);

writeUInt8 virtual

void writeUInt8(
    Handle valueHandle,
    Poco::UInt8 value,
    bool withResponse
);

onConnected protected

void onConnected();

onDisconnected protected

void onDisconnected();

onError protected

void onError(
    const std::string & error
);

onIndication protected

void onIndication(
    const GATTClient::Indication & ind
);

onNotification protected

void onNotification(
    const GATTClient::Notification & nf
);

readDeviceInformation protected

std::string readDeviceInformation(
    Poco::UInt32 assignedNumber
);

readValue protected

template < typename T > T readValue(
    Handle valueHandle
);

writeValue protected

template < typename T > void writeValue(
    Handle valueHandle,
    T value,
    bool withResponse
);

Securely control IoT edge devices from anywhere   Connect a Device