6 #include <Poco/Mutex.h>
7 #include <Poco/SharedPtr.h>
8 #include <Poco/Timespan.h>
11 #include "bluetooth/GlibPtr.h"
12 #include "bluetooth/HciConnection.h"
13 #include "bluetooth/org-bluez-device1.h"
14 #include "bluetooth/org-bluez-gattcharacteristic1.h"
15 #include "net/MACAddress.h"
16 #include "util/Loggable.h"
28 typedef Poco::SharedPtr<DBusHciConnection> Ptr;
31 const std::string& hciName,
33 const Poco::Timespan& timeout);
40 std::vector<unsigned char>
read(
const Poco::UUID& uuid)
override;
47 const Poco::UUID& uuid,
48 const std::vector<unsigned char>& value)
override;
59 const Poco::UUID& notifyUuid,
60 const Poco::UUID& writeUuid,
61 const std::vector<unsigned char>& value,
62 const Poco::Timespan& notifyTimeout)
override;
65 static gboolean onDeviceServicesResolved(
66 OrgBluezDevice1* device,
68 const gchar*
const* invalidatedProperties,
71 static gboolean onCharacteristicValueChanged(
72 OrgBluezGattCharacteristic1*,
87 void resolveServices();
94 const Poco::UUID& uuid,
95 const std::vector<unsigned char>& value);
102 const Poco::UUID& uuid);
109 const std::string& path);
112 std::string m_hciName;
115 Poco::Timespan m_timeout;
117 Poco::FastMutex m_writeMutex;
std::vector< unsigned char > read(const Poco::UUID &uuid) override
Reads value from the GATT characteristic defined by UUID.
Definition: DBusHciConnection.cpp:47
Definition: MACAddress.h:8
The interface class represents connection with BLE device.
Definition: HciConnection.h:16
void write(const Poco::UUID &uuid, const std::vector< unsigned char > &value) override
Writes value to the GATT characteristic defined by UUID.
Definition: DBusHciConnection.cpp:77
The class represents connection with Bluetooth Low energy device. It allows sending read/write reques...
Definition: DBusHciConnection.h:24
std::vector< unsigned char > notifiedWrite(const Poco::UUID ¬ifyUuid, const Poco::UUID &writeUuid, const std::vector< unsigned char > &value, const Poco::Timespan ¬ifyTimeout) override
The method starts notifying the characteristic given by notifyUuid. The callback is connected to sign...
Definition: DBusHciConnection.cpp:91
Definition: Loggable.h:19