26 #include "BluetoothObject.hpp" 27 #include "BluetoothManager.hpp" 28 #include "BluetoothGattDescriptor.hpp" 35 typedef struct _Object Object;
36 struct _GattCharacteristic1;
37 typedef struct _GattCharacteristic1 GattCharacteristic1;
50 friend class tinyb::BluetoothEventManager;
51 friend class BluetoothNotificationHandler;
54 GattCharacteristic1 *object;
59 static std::unique_ptr<BluetoothGattCharacteristic> make(Object *
object,
60 BluetoothType type = BluetoothType::GATT_CHARACTERISTIC,
61 std::string *name =
nullptr,
62 std::string *identifier =
nullptr,
65 std::function<void(std::vector<unsigned char> &)> value_changed_callback;
72 static std::string java_class() {
73 return std::string(JAVA_PACKAGE
"/BluetoothGattCharacteristic");
75 static BluetoothType class_type() {
return BluetoothType::GATT_CHARACTERISTIC; }
86 std::unique_ptr<BluetoothGattDescriptor> find(
87 std::string *identifier,
88 std::chrono::milliseconds timeout = std::chrono::milliseconds::zero())
108 bool write_value (
const std::vector<unsigned char> &arg_value, uint16_t offset = 0);
135 std::function<
void(std::vector<unsigned char> &value)> callback);
173 std::vector<std::unique_ptr<BluetoothGattDescriptor>>
get_descriptors ();
Definition: BluetoothObject.hpp:63
virtual std::string get_java_class() const
bool write_value(const std::vector< unsigned char > &arg_value, uint16_t offset=0)
static BluetoothManager * get_bluetooth_manager()
std::unique_ptr< T > find(std::string *name, std::string *identifier, BluetoothObject *parent, std::chrono::milliseconds timeout=std::chrono::milliseconds::zero())
Definition: BluetoothManager.hpp:113
std::vector< std::unique_ptr< BluetoothGattDescriptor > > get_descriptors()
std::vector< unsigned char > get_value()
Definition: BluetoothGattService.hpp:41
Definition: BluetoothManager.hpp:31
virtual std::string get_class_name() const
virtual std::string get_object_path() const
BluetoothGattService get_service()
virtual BluetoothGattCharacteristic * clone() const
Definition: BluetoothGattCharacteristic.hpp:44
std::vector< std::string > get_flags()
Definition: BluetoothGattDescriptor.hpp:40
std::vector< unsigned char > read_value(uint16_t offset=0)
virtual BluetoothType get_bluetooth_type() const
bool enable_value_notifications(std::function< void(BluetoothGattCharacteristic &characteristic, std::vector< unsigned char > &value, void *userdata)> callback, void *user_data)
bool disable_value_notifications()