#include <BluetoothGattCharacteristic.hpp>
|
static std::string | java_class () |
|
static BluetoothType | class_type () |
|
static BluetoothType | class_type () |
|
static std::string | java_class () |
|
|
| BluetoothGattCharacteristic (GattCharacteristic1 *object) |
|
bool | start_notify () |
|
bool | stop_notify () |
|
bool | lock () |
|
void | unlock () |
|
|
static std::unique_ptr< BluetoothGattCharacteristic > | make (Object *object, BluetoothType type=BluetoothType::GATT_CHARACTERISTIC, 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::BluetoothGattService |
|
class | tinyb::BluetoothGattDescriptor |
|
class | tinyb::BluetoothManager |
|
class | tinyb::BluetoothEventManager |
|
class | BluetoothNotificationHandler |
|
Provides access to Bluetooth GATT characteristic. 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::BluetoothGattCharacteristic::disable_value_notifications |
( |
| ) |
|
Disables notifications for changes of the value of the characteristic and uninstalls any callback (including BLE level).
bool tinyb::BluetoothGattCharacteristic::enable_value_notifications |
( |
std::function< void(BluetoothGattCharacteristic &characteristic, std::vector< unsigned char > &value, void *userdata)> |
callback, |
|
|
void * |
user_data |
|
) |
| |
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 value callback, if any was installed.
- Parameters
-
callback | A function of the form void(BluetoothGattCharacteristic&, std::vector<unsigned char> &, void *), where BluetoothGattCharacteristic& is the adapter for which the callback was set, bool 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 must be managed by user. |
bool tinyb::BluetoothGattCharacteristic::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::BluetoothGattCharacteristic::get_bluetooth_type |
( |
| ) |
const |
|
virtual |
Returns the BluetoothType of this object
- Returns
- The BluetoothType of this object
Reimplemented from tinyb::BluetoothObject.
virtual std::string tinyb::BluetoothGattCharacteristic::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.
Returns a list of BluetoothGattDescriptors this characteristic exposes.
- Returns
- A list of BluetoothGattDescriptors exposed by this characteristic NULL if an error occurred
std::vector<std::string> tinyb::BluetoothGattCharacteristic::get_flags |
( |
| ) |
|
Returns the flags this characterstic has.
- Returns
- A list of flags for this characteristic.
virtual std::string tinyb::BluetoothGattCharacteristic::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.
bool tinyb::BluetoothGattCharacteristic::get_notifying |
( |
| ) |
|
Returns true if notification for changes of this characteristic are activated.
- Returns
- True if notificatios are activated.
virtual std::string tinyb::BluetoothGattCharacteristic::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.
Returns the service to which this characteristic belongs to.
- Returns
- The service.
std::string tinyb::BluetoothGattCharacteristic::get_uuid |
( |
| ) |
|
Get the UUID of this characteristic.
- Returns
- The 128 byte UUID of this characteristic, NULL if an error occurred
std::vector<unsigned char> tinyb::BluetoothGattCharacteristic::get_value |
( |
| ) |
|
Returns the cached value of this characteristic, if any.
- Returns
- The cached value of this characteristic.
std::vector<unsigned char> tinyb::BluetoothGattCharacteristic::read_value |
( |
uint16_t |
offset = 0 | ) |
|
Reads the value of this characteristic.
- Returns
- A std::vector<unsgined char> containing the value of this characteristic.
bool tinyb::BluetoothGattCharacteristic::write_value |
( |
const std::vector< unsigned char > & |
arg_value, |
|
|
uint16_t |
offset = 0 |
|
) |
| |
Writes the value of this characteristic.
- 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: