Blame src/device.h

Packit 34410b
/*
Packit 34410b
 *
Packit 34410b
 *  BlueZ - Bluetooth protocol stack for Linux
Packit 34410b
 *
Packit 34410b
 *  Copyright (C) 2006-2010  Nokia Corporation
Packit 34410b
 *  Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
Packit 34410b
 *
Packit 34410b
 *
Packit 34410b
 *  This program is free software; you can redistribute it and/or modify
Packit 34410b
 *  it under the terms of the GNU General Public License as published by
Packit 34410b
 *  the Free Software Foundation; either version 2 of the License, or
Packit 34410b
 *  (at your option) any later version.
Packit 34410b
 *
Packit 34410b
 *  This program is distributed in the hope that it will be useful,
Packit 34410b
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 34410b
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 34410b
 *  GNU General Public License for more details.
Packit 34410b
 *
Packit 34410b
 *  You should have received a copy of the GNU General Public License
Packit 34410b
 *  along with this program; if not, write to the Free Software
Packit 34410b
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
Packit 34410b
 *
Packit 34410b
 */
Packit 34410b
Packit 34410b
#define DEVICE_INTERFACE	"org.bluez.Device1"
Packit 34410b
Packit 34410b
struct btd_device;
Packit 34410b
Packit 34410b
struct btd_device *device_create(struct btd_adapter *adapter,
Packit 34410b
				const bdaddr_t *address, uint8_t bdaddr_type);
Packit 34410b
struct btd_device *device_create_from_storage(struct btd_adapter *adapter,
Packit 34410b
				const char *address, GKeyFile *key_file);
Packit 34410b
char *btd_device_get_storage_path(struct btd_device *device,
Packit 34410b
				const char *filename);
Packit 34410b
Packit 34410b
void btd_device_device_set_name(struct btd_device *device, const char *name);
Packit 34410b
void device_store_cached_name(struct btd_device *dev, const char *name);
Packit 34410b
void device_get_name(struct btd_device *device, char *name, size_t len);
Packit 34410b
bool device_name_known(struct btd_device *device);
Packit 34410b
void device_set_class(struct btd_device *device, uint32_t class);
Packit 34410b
void device_update_addr(struct btd_device *device, const bdaddr_t *bdaddr,
Packit 34410b
							uint8_t bdaddr_type);
Packit 34410b
void device_set_bredr_support(struct btd_device *device);
Packit 34410b
void device_set_le_support(struct btd_device *device, uint8_t bdaddr_type);
Packit 34410b
void device_update_last_seen(struct btd_device *device, uint8_t bdaddr_type);
Packit 34410b
void device_merge_duplicate(struct btd_device *dev, struct btd_device *dup);
Packit 34410b
uint32_t btd_device_get_class(struct btd_device *device);
Packit 34410b
uint16_t btd_device_get_vendor(struct btd_device *device);
Packit 34410b
uint16_t btd_device_get_vendor_src(struct btd_device *device);
Packit 34410b
uint16_t btd_device_get_product(struct btd_device *device);
Packit 34410b
uint16_t btd_device_get_version(struct btd_device *device);
Packit 34410b
void device_remove(struct btd_device *device, gboolean remove_stored);
Packit 34410b
int device_address_cmp(gconstpointer a, gconstpointer b);
Packit 34410b
int device_bdaddr_cmp(gconstpointer a, gconstpointer b);
Packit 34410b
Packit 34410b
/* Struct used by device_addr_type_cmp() */
Packit 34410b
struct device_addr_type {
Packit 34410b
	bdaddr_t bdaddr;
Packit 34410b
	uint8_t bdaddr_type;
Packit 34410b
};
Packit 34410b
Packit 34410b
int device_addr_type_cmp(gconstpointer a, gconstpointer b);
Packit 34410b
GSList *btd_device_get_uuids(struct btd_device *device);
Packit 34410b
void device_probe_profiles(struct btd_device *device, GSList *profiles);
Packit 34410b
Packit 34410b
void btd_device_set_record(struct btd_device *device, const char *uuid,
Packit 34410b
							const char *record);
Packit 34410b
const sdp_record_t *btd_device_get_record(struct btd_device *device,
Packit 34410b
						const char *uuid);
Packit 34410b
struct gatt_primary *btd_device_get_primary(struct btd_device *device,
Packit 34410b
							const char *uuid);
Packit 34410b
GSList *btd_device_get_primaries(struct btd_device *device);
Packit 34410b
struct gatt_db *btd_device_get_gatt_db(struct btd_device *device);
Packit 34410b
struct bt_gatt_client *btd_device_get_gatt_client(struct btd_device *device);
Packit 34410b
struct bt_gatt_server *btd_device_get_gatt_server(struct btd_device *device);
Packit 34410b
void *btd_device_get_attrib(struct btd_device *device);
Packit 34410b
void btd_device_gatt_set_service_changed(struct btd_device *device,
Packit 34410b
						uint16_t start, uint16_t end);
Packit 34410b
bool device_attach_att(struct btd_device *dev, GIOChannel *io);
Packit 34410b
void btd_device_add_uuid(struct btd_device *device, const char *uuid);
Packit 34410b
void device_add_eir_uuids(struct btd_device *dev, GSList *uuids);
Packit 34410b
void device_set_manufacturer_data(struct btd_device *dev, GSList *list,
Packit 34410b
							bool duplicate);
Packit 34410b
void device_set_service_data(struct btd_device *dev, GSList *list,
Packit 34410b
							bool duplicate);
Packit 34410b
void device_set_data(struct btd_device *dev, GSList *list,
Packit 34410b
							bool duplicate);
Packit 34410b
void device_probe_profile(gpointer a, gpointer b);
Packit 34410b
void device_remove_profile(gpointer a, gpointer b);
Packit 34410b
struct btd_adapter *device_get_adapter(struct btd_device *device);
Packit 34410b
const bdaddr_t *device_get_address(struct btd_device *device);
Packit 34410b
uint8_t device_get_le_address_type(struct btd_device *device);
Packit 34410b
const char *device_get_path(const struct btd_device *device);
Packit 34410b
gboolean device_is_temporary(struct btd_device *device);
Packit 34410b
bool device_is_connectable(struct btd_device *device);
Packit 34410b
bool device_is_paired(struct btd_device *device, uint8_t bdaddr_type);
Packit 34410b
bool device_is_bonded(struct btd_device *device, uint8_t bdaddr_type);
Packit 34410b
gboolean device_is_trusted(struct btd_device *device);
Packit 34410b
void device_set_paired(struct btd_device *dev, uint8_t bdaddr_type);
Packit 34410b
void device_set_unpaired(struct btd_device *dev, uint8_t bdaddr_type);
Packit 34410b
void btd_device_set_temporary(struct btd_device *device, bool temporary);
Packit 34410b
void btd_device_set_trusted(struct btd_device *device, gboolean trusted);
Packit 34410b
void device_set_bonded(struct btd_device *device, uint8_t bdaddr_type);
Packit 34410b
void device_set_legacy(struct btd_device *device, bool legacy);
Packit 34410b
void device_set_rssi_with_delta(struct btd_device *device, int8_t rssi,
Packit 34410b
							int8_t delta_threshold);
Packit 34410b
void device_set_rssi(struct btd_device *device, int8_t rssi);
Packit 34410b
void device_set_tx_power(struct btd_device *device, int8_t tx_power);
Packit 34410b
void device_set_flags(struct btd_device *device, uint8_t flags);
Packit 34410b
bool btd_device_is_connected(struct btd_device *dev);
Packit 34410b
uint8_t btd_device_get_bdaddr_type(struct btd_device *dev);
Packit 34410b
bool device_is_retrying(struct btd_device *device);
Packit 34410b
void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type,
Packit 34410b
							uint8_t status);
Packit 34410b
gboolean device_is_bonding(struct btd_device *device, const char *sender);
Packit 34410b
void device_bonding_attempt_failed(struct btd_device *device, uint8_t status);
Packit 34410b
void device_bonding_failed(struct btd_device *device, uint8_t status);
Packit 34410b
struct btd_adapter_pin_cb_iter *device_bonding_iter(struct btd_device *device);
Packit 34410b
int device_bonding_attempt_retry(struct btd_device *device);
Packit 34410b
long device_bonding_last_duration(struct btd_device *device);
Packit 34410b
void device_bonding_restart_timer(struct btd_device *device);
Packit 34410b
int device_request_pincode(struct btd_device *device, gboolean secure);
Packit 34410b
int device_request_passkey(struct btd_device *device, uint8_t type);
Packit 34410b
int device_confirm_passkey(struct btd_device *device, uint8_t type,
Packit 34410b
					int32_t passkey, uint8_t confirm_hint);
Packit 34410b
int device_notify_passkey(struct btd_device *device, uint8_t type,
Packit 34410b
					uint32_t passkey, uint8_t entered);
Packit 34410b
int device_notify_pincode(struct btd_device *device, gboolean secure,
Packit 34410b
							const char *pincode);
Packit 34410b
void device_cancel_authentication(struct btd_device *device, gboolean aborted);
Packit 34410b
gboolean device_is_authenticating(struct btd_device *device);
Packit 34410b
void device_add_connection(struct btd_device *dev, uint8_t bdaddr_type);
Packit 34410b
void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type);
Packit 34410b
void device_request_disconnect(struct btd_device *device, DBusMessage *msg);
Packit 34410b
bool device_is_disconnecting(struct btd_device *device);
Packit 34410b
void device_set_ltk_enc_size(struct btd_device *device, uint8_t enc_size);
Packit 34410b
Packit 34410b
void device_store_svc_chng_ccc(struct btd_device *device, uint8_t bdaddr_type,
Packit 34410b
								uint16_t value);
Packit 34410b
void device_load_svc_chng_ccc(struct btd_device *device, uint16_t *ccc_le,
Packit 34410b
							uint16_t *ccc_bredr);
Packit 34410b
Packit 34410b
typedef void (*disconnect_watch) (struct btd_device *device, gboolean removal,
Packit 34410b
					void *user_data);
Packit 34410b
Packit 34410b
guint device_add_disconnect_watch(struct btd_device *device,
Packit 34410b
				disconnect_watch watch, void *user_data,
Packit 34410b
				GDestroyNotify destroy);
Packit 34410b
void device_remove_disconnect_watch(struct btd_device *device, guint id);
Packit 34410b
int device_get_appearance(struct btd_device *device, uint16_t *value);
Packit 34410b
void device_set_appearance(struct btd_device *device, uint16_t value);
Packit 34410b
Packit 34410b
struct btd_device *btd_device_ref(struct btd_device *device);
Packit 34410b
void btd_device_unref(struct btd_device *device);
Packit 34410b
Packit 34410b
int device_block(struct btd_device *device, gboolean update_only);
Packit 34410b
int device_unblock(struct btd_device *device, gboolean silent,
Packit 34410b
							gboolean update_only);
Packit 34410b
void btd_device_set_pnpid(struct btd_device *device, uint16_t source,
Packit 34410b
			uint16_t vendor, uint16_t product, uint16_t version);
Packit 34410b
Packit 34410b
int device_connect_le(struct btd_device *dev);
Packit 34410b
Packit 34410b
typedef void (*device_svc_cb_t) (struct btd_device *dev, int err,
Packit 34410b
							void *user_data);
Packit 34410b
Packit 34410b
unsigned int device_wait_for_svc_complete(struct btd_device *dev,
Packit 34410b
							device_svc_cb_t func,
Packit 34410b
							void *user_data);
Packit 34410b
bool device_remove_svc_complete_callback(struct btd_device *dev,
Packit 34410b
							unsigned int id);
Packit 34410b
Packit 34410b
struct btd_service *btd_device_get_service(struct btd_device *dev,
Packit 34410b
						const char *remote_uuid);
Packit 34410b
Packit 34410b
int device_discover_services(struct btd_device *device);
Packit 34410b
int btd_device_connect_services(struct btd_device *dev, GSList *services);
Packit 34410b
Packit 34410b
void btd_device_init(void);
Packit 34410b
void btd_device_cleanup(void);