#include <BluetoothGattDescriptor.hpp>
|
static std::string | java_class () |
|
static BluetoothType | class_type () |
|
static BluetoothType | class_type () |
|
static std::string | java_class () |
|
|
| BluetoothGattDescriptor (GattDescriptor1 *object) |
|
bool | lock () |
|
void | unlock () |
|
|
static std::unique_ptr< BluetoothGattDescriptor > | make (Object *object, BluetoothType type=BluetoothType::GATT_DESCRIPTOR, std::string *name=nullptr, std::string *identifier=nullptr, BluetoothObject *parent=nullptr) |
|
|
std::function< void(std::vector< unsigned char > &)> | value_changed_callback |
|
std::mutex | lk |
|
std::atomic_bool | valid |
|
|
class | tinyb::BluetoothGattCharacteristic |
|
class | tinyb::BluetoothManager |
|
class | tinyb::BluetoothEventManager |
|
class | tinyb::BluetoothNotificationHandler |
|
Provides access to Bluetooth GATT descriptor. Follows the BlueZ adapter API available at: http://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/gatt-api.txt
Returns a raw pointer to a clone of the object
- Returns
- A raw pointer to a clone of the object
Reimplemented from tinyb::BluetoothObject.
bool tinyb::BluetoothGattDescriptor::enable_value_notifications |
( |
std::function< void(BluetoothGattDescriptor &descriptor, std::vector< unsigned char > &value, void *userdata)> |
callback, |
|
|
void * |
user_data |
|
) |
| |
Enables notifications for changes of the value of the descriptor and triggers the callback when the value changes. Uninstalls the previous value callback, if any was installed.
- Parameters
-
callback | A function of the form void(BluetoothGattDescriptor &, std::vector<unsigned char> &, void *), where BluetoothGattDescriptor& is the adapter for which the callback was set, vector<unsigned char>& will contain the new value of the powered property and void* contains optional, user set data |
userdata | The data which will be delivered to the callback when it is triggered. Memory of this parameter must be managed by user. |
bool tinyb::BluetoothGattDescriptor::enable_value_notifications |
( |
std::function< void(std::vector< unsigned char > &value)> |
callback | ) |
|
Enables notifications (including at BLE level) for changes of the value of the characteristic and triggers the callback when the value changes. Uninstalls the previous powered callback, if any was installed.
- Parameters
-
callback | A function of the form void(std::vector<unsigned char> &), where std::vector<unsigned char>& will contain the new value |
virtual BluetoothType tinyb::BluetoothGattDescriptor::get_bluetooth_type |
( |
| ) |
const |
|
virtual |
Returns the BluetoothType of this object
- Returns
- The BluetoothType of this object
Reimplemented from tinyb::BluetoothObject.
Returns the characteristic to which this descriptor belongs to.
- Returns
- The characteristic.
virtual std::string tinyb::BluetoothGattDescriptor::get_class_name |
( |
| ) |
const |
|
virtual |
Returns the class name of this object
- Returns
- A std::string containing the class name of this object
Reimplemented from tinyb::BluetoothObject.
virtual std::string tinyb::BluetoothGattDescriptor::get_java_class |
( |
| ) |
const |
|
virtual |
Returns the complete Java class of this object
- Returns
- A std::string containing the java class of this object
Reimplemented from tinyb::BluetoothObject.
virtual std::string tinyb::BluetoothGattDescriptor::get_object_path |
( |
| ) |
const |
|
virtual |
Returns the DBus object path of this object
- Returns
- A std::string containing the DBus object path of this object
Reimplemented from tinyb::BluetoothObject.
std::string tinyb::BluetoothGattDescriptor::get_uuid |
( |
| ) |
|
Get the UUID of this descriptor.
- Returns
- The 128 byte UUID of this descriptor, NULL if an error occurred
std::vector<unsigned char> tinyb::BluetoothGattDescriptor::get_value |
( |
| ) |
|
Returns the cached value of this descriptor, if any.
- Returns
- The cached value of this descriptor.
std::vector<unsigned char> tinyb::BluetoothGattDescriptor::read_value |
( |
uint16_t |
offset = 0 | ) |
|
Reads the value of this descriptor
- Returns
- A vector<uchar> containing data from this descriptor
bool tinyb::BluetoothGattDescriptor::write_value |
( |
const std::vector< unsigned char > & |
arg_value, |
|
|
uint16_t |
offset = 0 |
|
) |
| |
Writes the value of this descriptor.
- Parameters
-
[in] | arg_value | The data as vector<uchar> to be written packed in a GBytes struct |
- Returns
- TRUE if value was written succesfully
The documentation for this class was generated from the following file: