26 #include "BluetoothObject.hpp" 27 #include "BluetoothAdapter.hpp" 28 #include "BluetoothGattService.hpp" 29 #include "BluetoothManager.hpp" 37 typedef struct _Object Object;
39 typedef struct _Device1 Device1;
49 friend class tinyb::BluetoothEventManager;
52 friend class tinyb::BluetoothNotificationHandler;
60 static std::unique_ptr<BluetoothDevice> make(Object *
object,
61 BluetoothType type = BluetoothType::DEVICE,
62 std::string *name =
nullptr,
63 std::string *identifier =
nullptr,
66 std::function<void(int16_t)> rssi_callback;
67 std::function<void(bool)> trusted_callback;
68 std::function<void(bool)> paired_callback;
69 std::function<void(bool)> connected_callback;
70 std::function<void(bool)> blocked_callback;
71 std::function<void(std::map<uint16_t, std::vector<uint8_t>> &)> mfg_callback;
72 std::function<void(std::map<std::string, std::vector<uint8_t>> &)> service_callback;
73 std::function<void(bool)> services_resolved_callback;
77 static std::string java_class() {
78 return std::string(JAVA_PACKAGE
"/BluetoothDevice");
80 static BluetoothType class_type() {
return BluetoothType::DEVICE; }
91 std::unique_ptr<BluetoothGattService> find(
92 std::string *identifier,
93 std::chrono::milliseconds timeout = std::chrono::milliseconds::zero())
121 const std::string &arg_UUID
129 const std::string &arg_UUID
155 std::vector<std::unique_ptr<BluetoothGattService>>
get_services (
176 void set_alias (
const std::string &value);
191 std::unique_ptr<std::string>
get_icon ();
209 std::function<
void(
BluetoothDevice &device,
bool paired,
void *userdata)> callback,
219 std::function<
void(
bool paired)> callback);
246 std::function<
void(
BluetoothDevice &device,
bool trusted,
void *userdata)> callback,
256 std::function<
void(
bool trusted)> callback);
283 std::function<
void(
BluetoothDevice &device,
bool blocked,
void *userdata)> callback,
293 std::function<
void(
bool blocked)> callback);
322 std::function<
void(
BluetoothDevice &device, int16_t rssi,
void *userdata)> callback,
323 void *userdata =
nullptr);
332 std::function<
void(int16_t rssi)> callback);
355 std::function<
void(
BluetoothDevice &device,
bool connected,
void *userdata)> callback,
365 std::function<
void(
bool connected)> callback);
404 std::function<
void(
BluetoothDevice &device, std::map<uint16_t, std::vector<uint8_t>> &mfgdata,
void *userdata)> callback,
414 std::function<
void(std::map<uint16_t, std::vector<uint8_t>> &mfgdata)> callback);
438 std::function<
void(
BluetoothDevice &device, std::map<std::string, std::vector<uint8_t>> &servicedata,
void *userdata)> callback,
448 std::function<
void(std::map<std::string, std::vector<uint8_t>> &servicedata)> callback);
475 std::function<
void(
BluetoothDevice &device,
bool services_resolved,
void *userdata)> callback,
485 std::function<
void(
bool connec)> callback);
void enable_trusted_notifications(std::function< void(BluetoothDevice &device, bool trusted, void *userdata)> callback, void *userdata)
void disable_blocked_notifications()
Definition: BluetoothObject.hpp:63
std::unique_ptr< std::string > get_icon()
void enable_rssi_notifications(std::function< void(BluetoothDevice &device, int16_t rssi, void *userdata)> callback, void *userdata=nullptr)
void enable_service_data_notifications(std::function< void(BluetoothDevice &device, std::map< std::string, std::vector< uint8_t >> &servicedata, void *userdata)> callback, void *userdata)
BluetoothAdapter get_adapter()
std::vector< std::string > get_uuids()
Definition: BluetoothAdapter.hpp:41
std::map< uint16_t, std::vector< uint8_t > > get_manufacturer_data()
void disable_services_resolved_notifications()
void enable_manufacturer_data_notifications(std::function< void(BluetoothDevice &device, std::map< uint16_t, std::vector< uint8_t >> &mfgdata, void *userdata)> callback, void *userdata)
void enable_services_resolved_notifications(std::function< void(BluetoothDevice &device, bool services_resolved, void *userdata)> callback, void *userdata)
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
bool connect_profile(const std::string &arg_UUID)
bool get_services_resolved()
void disable_service_data_notifications()
void enable_connected_notifications(std::function< void(BluetoothDevice &device, bool connected, void *userdata)> callback, void *userdata)
void disable_manufacturer_data_notifications()
virtual std::string get_class_name() const
Definition: BluetoothGattService.hpp:41
Definition: BluetoothManager.hpp:31
void disable_rssi_notifications()
std::unique_ptr< std::string > get_modalias()
std::map< std::string, std::vector< uint8_t > > get_service_data()
std::string get_address()
void disable_connected_notifications()
std::vector< std::unique_ptr< BluetoothGattService > > get_services()
virtual BluetoothDevice * clone() const
bool get_legacy_pairing()
virtual std::string get_java_class() const
void disable_paired_notifications()
void set_blocked(bool value)
Definition: BluetoothDevice.hpp:45
void set_trusted(bool value)
virtual BluetoothType get_bluetooth_type() const
void set_alias(const std::string &value)
bool disconnect_profile(const std::string &arg_UUID)
void disable_trusted_notifications()
void enable_blocked_notifications(std::function< void(BluetoothDevice &device, bool blocked, void *userdata)> callback, void *userdata)
void enable_paired_notifications(std::function< void(BluetoothDevice &device, bool paired, void *userdata)> callback, void *userdata)
virtual std::string get_object_path() const
uint16_t get_appearance()