IoT::BtLE

class PeripheralRemoteObject

File Information

Library: IoT/BtLE
Package: Generated
Header: IoT/BtLE/PeripheralRemoteObject.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: IPeripheral, Poco::RemotingNG::RemoteObject

All Base Classes: IPeripheral, Poco::OSP::Service, Poco::RefCountedObject, Poco::RemotingNG::Identifiable, Poco::RemotingNG::RemoteObject

Member Summary

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

Inherited Functions: address, characteristic, characteristicForAssignedNumber, characteristics, connect, connectAsync, deviceName, disconnect, duplicate, expandUUID, firmwareRevision, handleForDescriptor, hardwareRevision, isA, isConnected, manufacturerName, modelNumber, mutex, readBytes, readDouble, readFloat, readInt16, readInt32, readInt64, readInt8, readString, readString0, readUInt16, readUInt32, readUInt64, readUInt8, referenceCount, release, remoting__enableEvents, remoting__enableRemoteEvents, remoting__getURI, remoting__hasEvents, remoting__objectId, remoting__setURI, remoting__typeId, serialNumber, serviceUUIDForAssignedNumber, services, softwareRevision, type, writeBytes, writeDouble, writeFloat, writeInt16, writeInt32, writeInt64, writeInt8, writeString, writeUInt16, writeUInt32, writeUInt64, writeUInt8

Types Aliases

Ptr

using Ptr = Poco::AutoPtr < PeripheralRemoteObject >;

Constructors

PeripheralRemoteObject

PeripheralRemoteObject(
    const Poco::RemotingNG::Identifiable::ObjectId & oid,
    Poco::SharedPtr < IoT::BtLE::Peripheral > pServiceObject
);

Destructor

~PeripheralRemoteObject virtual

virtual ~PeripheralRemoteObject();

Destroys the PeripheralRemoteObject.

Member Functions

address virtual inline

virtual std::string address() const;

Returns the address of the device.

characteristic virtual inline

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

Returns the properties and handle for accessing the value of the given characteristic.

characteristicForAssignedNumber virtual inline

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

Returns the properties and handle for accessing the value of the given characteristic.

characteristics virtual inline

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

Returns a vector containing the UUIDs of all available characteristics of the service identified by the given serviceUUID.

connect virtual inline

virtual void connect();

Connects to the Bt LE peripheral.

Waits for successful connection or error.

connectAsync virtual inline

virtual void connectAsync();

Connects to the Bt LE peripheral.

Successful connection or error will be reported through connected and error events.

deviceName virtual inline

virtual std::string deviceName();

Returns the peripheral's device name obtained from the Generic Access Profile.

disconnect virtual inline

virtual void disconnect();

Disconnects from the Bt LE peripheral.

expandUUID virtual inline

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

Expands the given 16-bit or 32-bit UUID to a full UUID.

firmwareRevision virtual inline

virtual std::string firmwareRevision();

Returns the peripheral's firmware revision string obtained from the Device Information service.

handleForDescriptor virtual inline

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

Returns the handle with the given descriptor UUID for given characteristic and service.

hardwareRevision virtual inline

virtual std::string hardwareRevision();

Returns the peripheral's hardware revision string obtained from the Device Information service.

isConnected virtual inline

virtual bool isConnected() const;

Returns true if the device is connected.

manufacturerName virtual inline

virtual std::string manufacturerName();

Returns the peripheral's manufacturer name obtained from the Device Information service.

modelNumber virtual inline

virtual std::string modelNumber();

Returns the peripheral's model number string obtained from the Device Information service.

readBytes virtual inline

std::vector < char > readBytes(
    Poco::UInt16 valueHandle
);

Reads a raw byte string from the given value handle.

readDouble virtual inline

virtual double readDouble(
    Poco::UInt16 valueHandle
);

Reads a 64-bit double value (little endian) from the given value handle.

readFloat virtual inline

virtual float readFloat(
    Poco::UInt16 valueHandle
);

Reads a 32-bit float value (little endian) from the given value handle.

readInt16 virtual inline

virtual Poco::Int16 readInt16(
    Poco::UInt16 valueHandle
);

Reads a signed 16-bit integer value (little endian) from the given value handle.

readInt32 virtual inline

virtual Poco::Int32 readInt32(
    Poco::UInt16 valueHandle
);

Reads a signed 32-bit integer value (little endian) from the given value handle.

readInt64 virtual inline

virtual Poco::Int64 readInt64(
    Poco::UInt16 valueHandle
);

Reads a signed 64-bit integer value (little endian) from the given value handle.

readInt8 virtual inline

virtual Poco::Int8 readInt8(
    Poco::UInt16 valueHandle
);

Reads a signed byte value from the given value handle.

readString virtual inline

virtual std::string readString(
    Poco::UInt16 valueHandle
);

Reads a raw byte string from the given value handle.

readString0 virtual inline

virtual std::string readString0(
    Poco::UInt16 valueHandle
);

Reads a 0-terminated character string from the given value handle.

readUInt16 virtual inline

virtual Poco::UInt16 readUInt16(
    Poco::UInt16 valueHandle
);

Reads an unsigned 16-bit integer value (little endian) from the given value handle.

readUInt32 virtual inline

virtual Poco::UInt32 readUInt32(
    Poco::UInt16 valueHandle
);

Reads an unsigned 32-bit integer value (little endian) from the given value handle.

readUInt64 virtual inline

virtual Poco::UInt64 readUInt64(
    Poco::UInt16 valueHandle
);

Reads an unsigned 64-bit integer value (little endian) from the given value handle.

readUInt8 virtual inline

virtual Poco::UInt8 readUInt8(
    Poco::UInt16 valueHandle
);

Reads an unsigned byte value from the given value handle.

remoting__enableEvents virtual

virtual std::string remoting__enableEvents(
    Poco::RemotingNG::Listener::Ptr pListener,
    bool enable = bool (true)
);

remoting__enableRemoteEvents virtual

virtual void remoting__enableRemoteEvents(
    const std::string & protocol
);

remoting__hasEvents virtual

virtual bool remoting__hasEvents() const;

remoting__typeId virtual inline

virtual const Poco::RemotingNG::Identifiable::TypeId & remoting__typeId() const;

serialNumber virtual inline

virtual std::string serialNumber();

Returns the peripheral's serial number string obtained from the Device Information service.

serviceUUIDForAssignedNumber virtual inline

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

Returns the UUID of the service with the given 32-bit assigned number, or null UUID if no such service is available.

services virtual inline

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

Returns a vector containing the UUIDs of all available services.

softwareRevision virtual inline

virtual std::string softwareRevision();

Returns the peripheral's software revision string obtained from the Device Information service.

writeBytes virtual inline

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

Writes a raw byte string to the given value handle.

If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.

writeDouble virtual inline

virtual void writeDouble(
    Poco::UInt16 valueHandle,
    double value,
    bool withResponse
);

Writes a signed 64-bit double value (little endian) to the given value handle.

If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.

writeFloat virtual inline

virtual void writeFloat(
    Poco::UInt16 valueHandle,
    float value,
    bool withResponse
);

Writes a signed 32-bit float value (little endian) to the given value handle.

If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.

writeInt16 virtual inline

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

Writes a signed 16-bit integer value (little endian) to the given value handle.

If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.

writeInt32 virtual inline

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

Writes a signed 32-bit integer value (little endian) to the given value handle.

If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.

writeInt64 virtual inline

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

Writes a signed 32-bit integer value (little endian) to the given value handle.

If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.

writeInt8 virtual inline

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

Writes a signed byte value to the given value handle.

If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.

writeString virtual inline

virtual void writeString(
    Poco::UInt16 valueHandle,
    const std::string & value,
    bool withResponse
);

Writes a raw byte string to the given value handle.

If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.

writeUInt16 virtual inline

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

Writes an unsigned 16-bit integer value (little endian) to the given value handle.

If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.

writeUInt32 virtual inline

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

Writes an unsigned 32-bit integer value (little endian) to the given value handle.

If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.

writeUInt64 virtual inline

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

Writes an unsigned 32-bit integer value (little endian) to the given value handle.

If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.

writeUInt8 virtual inline

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

Writes an unsigned byte value to the given value handle.

If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.

event__connected protected

void event__connected();

event__disconnected protected

void event__disconnected();

event__error protected

void event__error(
    const std::string & data
);

event__indicationReceived protected

void event__indicationReceived(
    const IoT::BtLE::Indication & data
);

event__notificationReceived protected

void event__notificationReceived(
    const IoT::BtLE::Notification & data
);

Securely control IoT edge devices from anywhere   Connect a Device