26#ifndef BT_GATT_CHARACTERISTIC_HPP_
27#define BT_GATT_CHARACTERISTIC_HPP_
97 std::weak_ptr<BTGattService> wbr_service;
98 bool enabledNotifyState =
false;
99 bool enabledIndicateState =
false;
101 std::string toShortString()
const noexcept;
152 const PropertyBitVal properties_,
const uint16_t value_handle_, std::unique_ptr<const jau::uuid_t> && value_type_) noexcept
153 : wbr_service(service_),
handle(handle_),
177 std::string
toString() const noexcept override;
386 bool readValue(
jau::POctets & res,
int expectedLength=-1) noexcept;
413 {
return lhs.
handle == rhs.handle; }
416 {
return !(lhs == rhs); }
419 return static_cast<uint8_t
>(rhs);
431 return !( lhs == rhs );
458 virtual const char *
type_name()
const noexcept;
480 const bool confirmationSent) = 0;
503 {
return this == &rhs; }
506 {
return !(*
this == rhs); }
#define JAVA_MAIN_PACKAGE
BTDevice represents one remote Bluetooth device.
BTGattChar event listener for notification and indication events.
virtual void notificationReceived(BTGattCharRef charDecl, const jau::TROOctets &charValue, const uint64_t timestamp)=0
Called from native BLE stack, initiated by a received notification associated with the given BTGattCh...
static std::string java_class() noexcept
bool operator!=(const BTGattCharListener &rhs) const noexcept
~BTGattCharListener() noexcept override=default
std::string get_java_class() const noexcept override
virtual bool operator==(const BTGattCharListener &rhs) const noexcept
Default comparison operator, merely testing for same memory reference.
virtual void indicationReceived(BTGattCharRef charDecl, const jau::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...
Representing a Gatt Characteristic object from the GATTRole::Client perspective.
BTGattServiceRef getServiceUnchecked() const noexcept
ssize_type clientCharConfigIndex
std::unique_ptr< const jau::uuid_t > value_type
bool disableIndicationNotification() noexcept
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration.
BTGattHandlerRef getGattHandlerUnchecked() const noexcept
bool addCharListener(const BTGattCharListenerRef &l) noexcept
Add the given BTGattCharListener to the listener list if not already present.
std::string toString() const noexcept override
void clearDescriptors() noexcept
BTGattDescRef getClientCharConfig() const noexcept
Return the Client Characteristic Configuration BTGattDescRef if available or nullptr.
const uint16_t handle
Characteristic Handle of this instance.
std::string get_java_class() const noexcept override
BTDeviceRef getDeviceUnchecked() const noexcept
BTGattDescRef getUserDescription() const noexcept
Return the User Description BTGattDescRef if available or nullptr.
const PropertyBitVal properties
const uint16_t value_handle
Characteristics Value Handle.
ssize_type userDescriptionIndex
bool removeCharListener(const BTGattCharListenerRef &l) noexcept
Remove the given associated BTGattCharListener from the listener list if present.
BTGattChar(const BTGattServiceRef &service_, const uint16_t handle_, const PropertyBitVal properties_, const uint16_t value_handle_, std::unique_ptr< const jau::uuid_t > &&value_type_) noexcept
bool configNotificationIndication(const bool enableNotification, const bool enableIndication, bool enabledState[2]) noexcept
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration.
bool enableNotificationOrIndication(bool enabledState[2]) noexcept
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration.
size_type removeAllAssociatedCharListener(bool shallDisableIndicationNotification) noexcept
Removes all associated BTGattCharListener and and BTGattCharListener from the listener list.
PropertyBitVal
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.1.1 Characteristic Properties.
bool hasProperties(const PropertyBitVal v) const noexcept
std::shared_ptr< BTGattDesc > findGattDesc(const jau::uuid_t &desc_uuid) noexcept
Find a BTGattDesc by its desc_uuid.
bool writeValue(const jau::TROOctets &value) noexcept
BT Core Spec v5.2: Vol 3, Part G GATT: 4.9.3 Write Characteristic Value.
jau::darray< BTGattDescRef > descriptorList
List of Characteristic Descriptions as shared reference.
bool readValue(jau::POctets &res, int expectedLength=-1) noexcept
BT Core Spec v5.2: Vol 3, Part G GATT: 4.8.1 Read Characteristic Value.
bool writeValueNoResp(const jau::TROOctets &value) noexcept
BT Core Spec v5.2: Vol 3, Part G GATT: 4.9.1 Write Characteristic Value Without Response.
static std::string java_class() noexcept
Representing a Gatt Service object from the GATTRole::Client perspective.
Transient read only and endian aware octet data, i.e.
const_reference at(size_type i) const
Like std::vector::at(size_type), immutable reference.
constexpr void clear() noexcept
Like std::vector::clear(), but ending with zero capacity.
Sharing the anonymous Java object (JavaAnon), i.e.
std::string to_string(const endian_t v) noexcept
Return std::string representation of the given endian.
const char * type_name() noexcept
Returns the type name of given type T using template Compile Time Type Information (CTTI) only via RT...
std::shared_ptr< BTGattHandler > BTGattHandlerRef
bool operator==(const BTAdapter &lhs, const BTAdapter &rhs) noexcept
std::shared_ptr< BTDevice > BTDeviceRef
std::string to_string(const DiscoveryPolicy v) noexcept
bool operator!=(const BTAdapter &lhs, const BTAdapter &rhs) noexcept
constexpr uint8_t number(const DiscoveryPolicy rhs) noexcept
std::shared_ptr< BTGattCharListener > BTGattCharListenerRef
std::shared_ptr< BTGattChar > BTGattCharRef
std::shared_ptr< BTGattService > BTGattServiceRef
constexpr BTGattChar::PropertyBitVal operator&(const BTGattChar::PropertyBitVal lhs, const BTGattChar::PropertyBitVal rhs) noexcept
std::shared_ptr< BTGattDesc > BTGattDescRef
constexpr BTGattChar::PropertyBitVal operator|(const BTGattChar::PropertyBitVal lhs, const BTGattChar::PropertyBitVal rhs) noexcept
uint_fast32_t nsize_t
Natural 'size_t' alternative using uint_fast32_t as its natural sized type.
int_fast32_t snsize_t
Natural 'ssize_t' alternative using int_fast32_t as its natural sized type.
__pack(...): Produces MSVC, clang and gcc compatible lead-in and -out macros.