Peripheral represents the device you want to connect to. Peripherals can be found through either searching for a local name or searching for a vector of uuids it contains. A peripheral can have many services.
Currently, if your peripheral has a local name and you search for a peripheral by its uuids,
then it will not automatically find its name. To fix this, call the set_name() method after
successfully connecting to your peripheral. If you search by name, you’re good.
bluetooth::Peripheral¶represents a peripheral device.
Public Functions
find_service(const std::string &service_uuid)¶Find advertised service given the service_uuid. Return the service if found, otherwise returns nullptr.
the service or nullptr.
service_uuid: service uuid.
service(const std::string &service_uuid)¶Returns the discovered service. If the service has not been found and connected via find_service() yet, then this will return nullptr.
service matching the service_uuid or nullptr.
service_uuid: service uuid.
disconnect()¶Disconnect the peripheral.
not blocking.
name()¶Get the name of your peripheral. Will return empty if you discovered your peripheral via UUID.
the name of your peripheral.