File Information
Library: IoT/BtLE
Package: BtLE
Header: IoT/BtLE/PeripheralManager.h
Description
This class manages Peripheral objects in the service registry.
Given the address of a Bt LE Peripheral device, the findPeripheral() method will return an existing Peripheral object representing that device if it already exists, or otherwise create a new Peripheral object using the PeripheralFactory.
Once a Peripheral is no longer needed, it can be disposed by calling remove().
Inheritance
Known Derived Classes: PeripheralManagerImpl
Member Summary
Member Functions: findPeripheral, removePeripheral
Types Aliases
Ptr
using Ptr = Poco::SharedPtr < PeripheralManager >;
ServiceID
using ServiceID = std::string;
Destructor
~PeripheralManager
virtual ~PeripheralManager();
Destroys the PeripheralFactory.
Member Functions
findPeripheral
virtual ServiceID findPeripheral(
const std::string & address,
const std::string & controller = std::string ()
) = 0;
Returns the service ID of a Peripheral object for the Peripheral with the given address (e.g., "C4:BE:84:72:C5:06"), using the given controller. The controller ID may be empty if there is only one controller on the system.
If such a Peripheral object already exists in the service registry, the existing object's ID will be returned. Otherwise, a new Peripheral object for that address will be created (using the PeripheralFactory for the given interface) and its service ID returned.
The ServiceID can then be used in Poco::OSP::ServiceRegistry::findByName() to obtain a ServiceRef for that service, and subsequently the service instance.
removePeripheral
virtual void removePeripheral(
const ServiceID & serviceID
) = 0;
Removes the Peripheral with the given service ID.