Direct-BT
2.3.1
Direct-BT - Direct Bluetooth Programming.
|
Go to the documentation of this file.
26 #ifndef BT_GATT_CHARACTERISTIC_HPP_
27 #define BT_GATT_CHARACTERISTIC_HPP_
78 std::weak_ptr<BTGattService> wbr_service;
79 bool enabledNotifyState =
false;
80 bool enabledIndicateState =
false;
82 std::string toShortString()
const noexcept;
144 const bool confirmationSent) = 0;
155 {
return this == &rhs; }
158 {
return !(*
this == rhs); }
198 const PropertyBitVal properties_,
const uint16_t value_handle_, std::unique_ptr<const uuid_t> && value_type_) noexcept
218 std::string
toString() const noexcept override;
339 bool addCharListener(std::shared_ptr<Listener> l,
bool enabledState[2]);
412 {
return lhs.handle == rhs.handle; }
415 {
return !(lhs == rhs); }
449 (void)characteristic;
473 const bool confirmationSent) = 0;
484 {
return this == &rhs; }
487 {
return !(*
this == rhs); }
499 : associatedChar(characteristicMatch) { }
502 if(
nullptr == associatedChar ) {
505 return *associatedChar == characteristic;
virtual void indicationReceived(BTGattCharRef charDecl, const TROOctets &charValue, const uint64_t timestamp, const bool confirmationSent)=0
Called from native BLE stack, initiated by a received indication associated with the given BTGattChar...
static std::string getPropertiesString(const PropertyBitVal properties) noexcept
Returns string values as defined in https://git.kernel.org/pub/scm/bluetooth/bluez....
const_reference at(size_type i) const
Like std::vector::at(size_type), immutable reference.
virtual bool operator==(const BTGattCharListener &rhs) const noexcept
Default comparison operator, merely testing for same memory reference.
AssociatedBTGattCharListener(const BTGattChar *characteristicMatch) noexcept
Passing the associated BTGattChar to filter out non matching events.
bool hasProperties(const PropertyBitVal v) const noexcept
virtual void notificationReceived(BTGattCharRef charDecl, const TROOctets &charValue, const uint64_t timestamp)=0
Called from native BLE stack, initiated by a received notification associated with the given BTGattCh...
virtual bool match(const BTGattChar &characteristic) noexcept
Custom filter for all event methods, which will not be called if this method returns false.
std::shared_ptr< BTGattService > getServiceUnchecked() const noexcept
bool readValue(POctets &res, int expectedLength=-1)
BT Core Spec v5.2: Vol 3, Part G GATT: 4.8.1 Read Characteristic Value.
bool operator!=(const BTGattCharListener &rhs) const noexcept
const uint16_t handle
Characteristic Handle of this instance.
bool operator==(const EUI48Sub &lhs, const EUI48Sub &rhs) noexcept
std::shared_ptr< BTGattService > BTGattServiceRef
static std::string java_class() noexcept
std::shared_ptr< BTGattHandler > getGattHandlerChecked() const
bool addCharListener(std::shared_ptr< Listener > l)
Add the given BTGattChar::Listener to the listener list if not already present.
std::shared_ptr< BTDevice > getDeviceChecked() const
int removeAllAssociatedCharListener(bool disableIndicationNotification)
Disables the notification and/or indication for this characteristic at BLE level if disableIndication...
const uint16_t service_handle
Characteristics's Service Handle - key to service's handle range, retrieved from Characteristics data...
std::shared_ptr< BTGattHandler > getGattHandlerUnchecked() const noexcept
Implementation of a dynamic linear array storage, aka vector.
std::shared_ptr< BTGattChar > BTGattCharRef
virtual ~Listener() noexcept
std::shared_ptr< BTGattService > getServiceChecked() const
BTGattChar event listener for notification and indication events.
bool operator!=(const Listener &rhs) const noexcept
int clientCharConfigIndex
bool match(const BTGattChar &characteristic) noexcept override
Custom filter for all event methods, which will not be called if this method returns false.
static jau::darray< std::unique_ptr< std::string > > getPropertiesStringList(const PropertyBitVal properties) noexcept
virtual bool operator==(const Listener &rhs) const noexcept
Default comparison operator, merely testing for same memory reference.
void clearDescriptors() noexcept
virtual void notificationReceived(BTGattCharRef charDecl, const TROOctets &charValue, const uint64_t timestamp)=0
Called from native BLE stack, initiated by a received notification associated with the given BTGattCh...
virtual ~BTGattCharListener() noexcept
BTGattChar(const BTGattServiceRef &service_, const uint16_t service_handle_, const uint16_t handle_, const PropertyBitVal properties_, const uint16_t value_handle_, std::unique_ptr< const uuid_t > &&value_type_) noexcept
PropertyBitVal
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.1.1 Characteristic Properties.
BTGattDescRef getClientCharConfig() noexcept
virtual void indicationReceived(BTGattCharRef charDecl, const TROOctets &charValue, const uint64_t timestamp, const bool confirmationSent)=0
Called from native BLE stack, initiated by a received indication associated with the given BTGattChar...
std::string toString() const noexcept override
A thread safe GATT handler associated to one device via one L2CAP connection.
Transient read only octet data, i.e.
std::string get_java_class() const noexcept override
bool writeValue(const TROOctets &value)
BT Core Spec v5.2: Vol 3, Part G GATT: 4.9.3 Write Characteristic Value.
bool configNotificationIndication(const bool enableNotification, const bool enableIndication, bool enabledState[2])
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration.
std::unique_ptr< const uuid_t > value_type
bool writeValueNoResp(const TROOctets &value)
BT Core Spec v5.2: Vol 3, Part G GATT: 4.9.1 Write Characteristic Value Without Response.
jau::darray< BTGattDescRef > descriptorList
List of Characteristic Descriptions as shared reference.
const uint16_t value_handle
Characteristics Value Handle.
Persistent octet data, i.e.
bool operator!=(const EUI48Sub &lhs, const EUI48Sub &rhs) noexcept
bool enableNotificationOrIndication(bool enabledState[2])
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration.
std::shared_ptr< BTGattDesc > BTGattDescRef
std::shared_ptr< BTDevice > getDeviceUnchecked() const noexcept
const PropertyBitVal properties
constexpr void clear() noexcept
Like std::vector::clear(), but ending with zero capacity.
BTGattChar event listener for notification and indication events.