Library: IoT/BtLE
Package: Generated
Header: IoT/BtLE/PeripheralRemoteObject.h
Description
This class provides a high-level interface to a Bluetooth LE peripheral device using the Bluetooth 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, disconnect, event__connected, event__disconnected, event__error, event__indicationReceived, event__notificationReceived, firmwareRevision, handleForDescriptor, hardwareRevision, isConnected, manufacturerName, modelNumber, readBytes, readInt16, readInt32, readInt8, readString, readString0, readUInt16, readUInt32, readUInt8, remoting__enableEvents, remoting__enableRemoteEvents, remoting__hasEvents, remoting__typeId, serialNumber, serviceUUIDForAssignedNumber, services, softwareRevision, writeBytes, writeInt16, writeInt32, writeInt8, writeString, writeUInt16, writeUInt32, writeUInt8
Inherited Functions: address, characteristic, characteristicForAssignedNumber, characteristics, connect, connectAsync, disconnect, duplicate, firmwareRevision, handleForDescriptor, hardwareRevision, isA, isConnected, manufacturerName, modelNumber, mutex, readBytes, readInt16, readInt32, readInt8, readString, readString0, readUInt16, readUInt32, readUInt8, referenceCount, release, remoting__enableEvents, remoting__enableRemoteEvents, remoting__getURI, remoting__hasEvents, remoting__objectId, remoting__setURI, remoting__typeId, serialNumber, serviceUUIDForAssignedNumber, services, softwareRevision, type, writeBytes, writeInt16, writeInt32, writeInt8, writeString, writeUInt16, writeUInt32, writeUInt8
Types Aliases
Ptr
using Ptr = Poco::AutoPtr < PeripheralRemoteObject >;
Constructors
PeripheralRemoteObject
PeripheralRemoteObject(
const Poco::RemotingNG::Identifiable::ObjectId & oid,
Poco::SharedPtr < IoT::BtLE::Peripheral > pServiceObject
);
Creates a PeripheralRemoteObject.
Destructor
~PeripheralRemoteObject
virtual ~PeripheralRemoteObject();
Destroys the PeripheralRemoteObject.
Member Functions
address
virtual std::string address() const;
Returns the address of the device.
See also: IoT::BtLE::IPeripheral::address()
characteristic
IoT::BtLE::Characteristic characteristic(
const std::string & serviceUUID,
const std::string & characteristicUUID
);
Returns the properties and handle for accessing the value of the given characteristic.
See also: IoT::BtLE::IPeripheral::characteristic()
characteristicForAssignedNumber
IoT::BtLE::Characteristic characteristicForAssignedNumber(
const std::string & serviceUUID,
Poco::UInt32 assignedNumber
);
Returns the properties and handle for accessing the value of the given characteristic.
characteristics
virtual std::vector < std::string > characteristics(
const std::string & serviceUUID
);
Returns a vector containing the UUIDs of all available characteristics of the service identified by the given serviceUUID.
connect
virtual void connect();
Connects to the Bluetooth LE peripheral.
Waits for successful connection or error.
See also: IoT::BtLE::IPeripheral::connect()
connectAsync
virtual void connectAsync();
Connects to the Bluetooth LE peripheral.
Successful connection or error will be reported through connected and error events.
See also: IoT::BtLE::IPeripheral::connectAsync()
disconnect
virtual void disconnect();
Disconnects from the Bluetooth LE peripheral.
See also: IoT::BtLE::IPeripheral::disconnect()
firmwareRevision
virtual std::string firmwareRevision();
Returns the peripheral's firmware revision string obtained from the Device Information service.
handleForDescriptor
virtual Poco::UInt16 handleForDescriptor(
const std::string & serviceUUID,
const std::string & descriptorUUID
);
Returns the handle with the given descriptor UUID for the service with the given serviceUUID.
hardwareRevision
virtual std::string hardwareRevision();
Returns the peripheral's hardware revision string obtained from the Device Information service.
isConnected
virtual bool isConnected() const;
Returns true if the device is connected.
See also: IoT::BtLE::IPeripheral::isConnected()
manufacturerName
virtual std::string manufacturerName();
Returns the peripheral's manufacturer name obtained from the Device Information service.
modelNumber
virtual std::string modelNumber();
Returns the peripheral's model number string obtained from the Device Information service.
See also: IoT::BtLE::IPeripheral::modelNumber()
readBytes
virtual std::vector < char > readBytes(
Poco::UInt16 valueHandle
);
Reads a raw byte string from the given value handle.
See also: IoT::BtLE::IPeripheral::readBytes()
readInt16
virtual Poco::Int16 readInt16(
Poco::UInt16 valueHandle
);
Reads a signed 16-bit integer value from the given value handle.
See also: IoT::BtLE::IPeripheral::readInt16()
readInt32
virtual Poco::Int32 readInt32(
Poco::UInt16 valueHandle
);
Reads a signed 32-bit integer value from the given value handle.
See also: IoT::BtLE::IPeripheral::readInt32()
readInt8
virtual Poco::Int8 readInt8(
Poco::UInt16 valueHandle
);
Reads a signed byte value from the given value handle.
See also: IoT::BtLE::IPeripheral::readInt8()
readString
virtual std::string readString(
Poco::UInt16 valueHandle
);
Reads a raw byte string from the given value handle.
See also: IoT::BtLE::IPeripheral::readString()
readString0
virtual std::string readString0(
Poco::UInt16 valueHandle
);
Reads a 0-terminated character string from the given value handle.
See also: IoT::BtLE::IPeripheral::readString0()
readUInt16
virtual Poco::UInt16 readUInt16(
Poco::UInt16 valueHandle
);
Reads an unsigned 16-bit integer value from the given value handle.
See also: IoT::BtLE::IPeripheral::readUInt16()
readUInt32
virtual Poco::UInt32 readUInt32(
Poco::UInt16 valueHandle
);
Reads an unsigned 32-bit integer value from the given value handle.
See also: IoT::BtLE::IPeripheral::readUInt32()
readUInt8
virtual Poco::UInt8 readUInt8(
Poco::UInt16 valueHandle
);
Reads an unsigned byte value from the given value handle.
See also: IoT::BtLE::IPeripheral::readUInt8()
remoting__enableEvents
virtual std::string remoting__enableEvents(
Poco::RemotingNG::Listener::Ptr pListener,
bool enable = bool (true)
);
remoting__enableRemoteEvents
virtual void remoting__enableRemoteEvents(
const std::string & protocol
);
remoting__hasEvents
virtual bool remoting__hasEvents() const;
remoting__typeId
virtual const Poco::RemotingNG::Identifiable::TypeId & remoting__typeId() const;
serialNumber
virtual std::string serialNumber();
Returns the peripheral's serial number string obtained from the Device Information service.
See also: IoT::BtLE::IPeripheral::serialNumber()
serviceUUIDForAssignedNumber
virtual std::string serviceUUIDForAssignedNumber(
Poco::UInt32 assignedNumber
);
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 std::vector < std::string > services();
Returns a vector containing the UUIDs of all available services.
See also: IoT::BtLE::IPeripheral::services()
softwareRevision
virtual std::string softwareRevision();
Returns the peripheral's software revision string obtained from the Device Information service.
writeBytes
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.
See also: IoT::BtLE::IPeripheral::writeBytes()
writeInt16
virtual void writeInt16(
Poco::UInt16 valueHandle,
Poco::Int16 value,
bool withResponse
);
Writes a signed 16-bit integer value to the given value handle.
If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.
See also: IoT::BtLE::IPeripheral::writeInt16()
writeInt32
virtual void writeInt32(
Poco::UInt16 valueHandle,
Poco::UInt32 value,
bool withResponse
);
Writes a signed 32-bit integer value to the given value handle.
If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.
See also: IoT::BtLE::IPeripheral::writeInt32()
writeInt8
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.
See also: IoT::BtLE::IPeripheral::writeInt8()
writeString
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.
See also: IoT::BtLE::IPeripheral::writeString()
writeUInt16
virtual void writeUInt16(
Poco::UInt16 valueHandle,
Poco::UInt16 value,
bool withResponse
);
Writes an unsigned 16-bit integer value to the given value handle.
If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.
See also: IoT::BtLE::IPeripheral::writeUInt16()
writeUInt32
virtual void writeUInt32(
Poco::UInt16 valueHandle,
Poco::UInt32 value,
bool withResponse
);
Writes an unsigned 32-bit integer value to the given value handle.
If withResponse is false, uses a WriteWithoutResponse operation, otherwise a Write operation.
See also: IoT::BtLE::IPeripheral::writeUInt32()
writeUInt8
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.
See also: IoT::BtLE::IPeripheral::writeUInt8()
event__connected
void event__connected();
event__disconnected
void event__disconnected();
event__error
void event__error(
const std::string & data
);
event__indicationReceived
void event__indicationReceived(
const IoT::BtLE::Indication & data
);
event__notificationReceived
void event__notificationReceived(
const IoT::BtLE::Notification & data
);