IoT::BtLE

class IPeripheral

File Information

Library: IoT/BtLE
Package: Generated
Header: IoT/BtLE/IPeripheral.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: Poco::OSP::Service

All Base Classes: Poco::OSP::Service, Poco::RefCountedObject

Known Derived Classes: PeripheralRemoteObject

Member Summary

Member Functions: address, characteristic, characteristicForAssignedNumber, characteristics, connect, connectAsync, disconnect, firmwareRevision, handleForDescriptor, hardwareRevision, isA, isConnected, manufacturerName, modelNumber, readBytes, readInt16, readInt32, readInt8, readString, readString0, readUInt16, readUInt32, readUInt8, remoting__enableEvents, remoting__typeId, serialNumber, serviceUUIDForAssignedNumber, services, softwareRevision, type, writeBytes, writeInt16, writeInt32, writeInt8, writeString, writeUInt16, writeUInt32, writeUInt8

Inherited Functions: duplicate, isA, referenceCount, release, type

Types Aliases

Ptr

using Ptr = Poco::AutoPtr < IPeripheral >;

Constructors

IPeripheral

IPeripheral();

Creates a IPeripheral.

Destructor

~IPeripheral virtual

virtual ~IPeripheral();

Destroys the IPeripheral.

Member Functions

address virtual

virtual std::string address() const = 0;

Returns the address of the device.

characteristic virtual

virtual IoT::BtLE::Characteristic characteristic(
    const std::string & serviceUUID,
    const std::string & characteristicUUID
) = 0;

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

characteristicForAssignedNumber virtual

virtual IoT::BtLE::Characteristic characteristicForAssignedNumber(
    const std::string & serviceUUID,
    Poco::UInt32 assignedNumber
) = 0;

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

characteristics virtual

virtual std::vector < std::string > characteristics(
    const std::string & serviceUUID
) = 0;

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

connect virtual

virtual void connect() = 0;

Connects to the Bt LE peripheral.

Waits for successful connection or error.

connectAsync virtual

virtual void connectAsync() = 0;

Connects to the Bt LE peripheral.

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

disconnect virtual

virtual void disconnect() = 0;

Disconnects from the Bt LE peripheral.

firmwareRevision virtual

virtual std::string firmwareRevision() = 0;

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

handleForDescriptor virtual

virtual Poco::UInt16 handleForDescriptor(
    const std::string & serviceUUID,
    const std::string & descriptorUUID
) = 0;

Returns the handle with the given descriptor UUID for the service with the given serviceUUID.

hardwareRevision virtual

virtual std::string hardwareRevision() = 0;

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

isA virtual

bool isA(
    const std::type_info & otherType
) const;

Returns true if the class is a subclass of the class given by otherType.

isConnected virtual

virtual bool isConnected() const = 0;

Returns true if the device is connected.

manufacturerName virtual

virtual std::string manufacturerName() = 0;

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

modelNumber virtual

virtual std::string modelNumber() = 0;

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

readBytes virtual

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

Reads a raw byte string from the given value handle.

readInt16 virtual

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

Reads a signed 16-bit integer value from the given value handle.

readInt32 virtual

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

Reads a signed 32-bit integer value from the given value handle.

readInt8 virtual

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

Reads a signed byte value from the given value handle.

readString virtual

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

Reads a raw byte string from the given value handle.

readString0 virtual

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

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

readUInt16 virtual

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

Reads an unsigned 16-bit integer value from the given value handle.

readUInt32 virtual

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

Reads an unsigned 32-bit integer value from the given value handle.

readUInt8 virtual

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

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)
) = 0;

Enable or disable delivery of remote events.

The given Listener instance must implement the Poco::RemotingNG::EventListener interface, otherwise this method will fail with a RemotingException.

This method is only used with Proxy objects; calling this method on a RemoteObject will do nothing.

remoting__typeId static

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

Returns the TypeId of the class.

serialNumber virtual

virtual std::string serialNumber() = 0;

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

serviceUUIDForAssignedNumber virtual

virtual std::string serviceUUIDForAssignedNumber(
    Poco::UInt32 assignedNumber
) = 0;

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

services virtual

virtual std::vector < std::string > services() = 0;

Returns a vector containing the UUIDs of all available services.

softwareRevision virtual

virtual std::string softwareRevision() = 0;

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

type virtual

const std::type_info & type() const;

Returns the type information for the object's class.

writeBytes virtual

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

Writes a raw byte string to the given value handle.

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

writeInt16 virtual

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

Writes a signed 16-bit integer value to the given value handle.

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

writeInt32 virtual

virtual void writeInt32(
    Poco::UInt16 valueHandle,
    Poco::UInt32 value,
    bool withResponse
) = 0;

Writes a signed 32-bit integer value to the given value handle.

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

writeInt8 virtual

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

Writes a signed byte value to the given value handle.

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

writeString virtual

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

Writes a raw byte string to the given value handle.

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

writeUInt16 virtual

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

Writes an unsigned 16-bit integer value to the given value handle.

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

writeUInt32 virtual

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

Writes an unsigned 32-bit integer value to the given value handle.

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

writeUInt8 virtual

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

Writes an unsigned byte value to the given value handle.

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

Variables

connected

Poco::BasicEvent < void > connected;

disconnected

Poco::BasicEvent < void > disconnected;

error

Poco::BasicEvent < const std::string > error;

indicationReceived

Poco::BasicEvent < const IoT::BtLE::Indication > indicationReceived;

notificationReceived

Poco::BasicEvent < const IoT::BtLE::Notification > notificationReceived;

Securely control IoT edge devices from anywhere   Connect a Device