summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
Diffstat (limited to 'hcid')
-rw-r--r--hcid/adapter.c32
-rw-r--r--hcid/adapter.h8
-rw-r--r--hcid/agent.c8
-rw-r--r--hcid/agent.h8
-rw-r--r--hcid/dbus-hci.c36
-rw-r--r--hcid/dbus-service.c4
-rw-r--r--hcid/device.c83
-rw-r--r--hcid/device.h38
8 files changed, 103 insertions, 114 deletions
diff --git a/hcid/adapter.c b/hcid/adapter.c
index 029823f4..117536b6 100644
--- a/hcid/adapter.c
+++ b/hcid/adapter.c
@@ -251,7 +251,7 @@ static int auth_info_agent_cmp(const void *a, const void *b)
static void device_agent_removed(struct agent *agent, void *user_data)
{
- struct device *device = user_data;
+ struct btd_device *device = user_data;
struct pending_auth_info *auth;
GSList *l;
struct adapter *adapter;
@@ -276,7 +276,7 @@ static struct bonding_request_info *bonding_request_new(DBusConnection *conn,
uint8_t capability)
{
struct bonding_request_info *bonding;
- struct device *device;
+ struct btd_device *device;
const char *name = dbus_message_get_sender(msg);
const gchar *destination;
struct agent *agent;
@@ -621,9 +621,9 @@ static void reply_authentication_failure(struct bonding_request_info *bonding)
}
}
-struct device *adapter_find_device(struct adapter *adapter, const char *dest)
+struct btd_device *adapter_find_device(struct adapter *adapter, const char *dest)
{
- struct device *device;
+ struct btd_device *device;
GSList *l;
if (!adapter)
@@ -639,10 +639,10 @@ struct device *adapter_find_device(struct adapter *adapter, const char *dest)
return device;
}
-struct device *adapter_create_device(DBusConnection *conn,
+struct btd_device *adapter_create_device(DBusConnection *conn,
struct adapter *adapter, const char *address)
{
- struct device *device;
+ struct btd_device *device;
debug("adapter_create_device(%s)", address);
@@ -661,7 +661,7 @@ static DBusMessage *remove_bonding(DBusConnection *conn, DBusMessage *msg,
const char *address, void *data)
{
struct adapter *adapter = data;
- struct device *device;
+ struct btd_device *device;
char filename[PATH_MAX + 1];
char *str;
bdaddr_t src, dst;
@@ -745,7 +745,7 @@ done:
void adapter_remove_device(DBusConnection *conn, struct adapter *adapter,
- struct device *device)
+ struct btd_device *device)
{
bdaddr_t src;
const gchar *destination = device_get_address(device);
@@ -777,10 +777,10 @@ void adapter_remove_device(DBusConnection *conn, struct adapter *adapter,
device_remove(conn, device);
}
-struct device *adapter_get_device(DBusConnection *conn,
+struct btd_device *adapter_get_device(DBusConnection *conn,
struct adapter *adapter, const gchar *address)
{
- struct device *device;
+ struct btd_device *device;
debug("adapter_get_device(%s)", address);
@@ -796,7 +796,7 @@ struct device *adapter_get_device(DBusConnection *conn,
void remove_pending_device(struct adapter *adapter)
{
- struct device *device;
+ struct btd_device *device;
char address[18];
ba2str(&adapter->bonding->bdaddr, address);
@@ -1559,7 +1559,7 @@ static DBusMessage *list_devices(DBusConnection *conn,
DBUS_TYPE_OBJECT_PATH_AS_STRING, &array_iter);
for (l = adapter->devices; l; l = l->next) {
- struct device *device = l->data;
+ struct btd_device *device = l->data;
if (device_is_temporary(device))
continue;
@@ -1579,7 +1579,7 @@ static DBusMessage *create_device(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct adapter *adapter = data;
- struct device *device;
+ struct btd_device *device;
const gchar *address;
if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &address,
@@ -1646,7 +1646,7 @@ static DBusMessage *create_paired_device(DBusConnection *conn,
return create_bonding(conn, msg, address, agent_path, cap, data);
}
-static gint device_path_cmp(struct device *device, const gchar *path)
+static gint device_path_cmp(struct btd_device *device, const gchar *path)
{
const gchar *dev_path = device_get_path(device);
@@ -1657,7 +1657,7 @@ static DBusMessage *remove_device(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct adapter *adapter = data;
- struct device *device;
+ struct btd_device *device;
const char *path;
GSList *l;
@@ -1687,7 +1687,7 @@ static DBusMessage *find_device(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct adapter *adapter = data;
- struct device *device;
+ struct btd_device *device;
DBusMessage *reply;
const gchar *address;
GSList *l;
diff --git a/hcid/adapter.h b/hcid/adapter.h
index 5488c105..772f3599 100644
--- a/hcid/adapter.h
+++ b/hcid/adapter.h
@@ -122,14 +122,14 @@ dbus_bool_t adapter_init(DBusConnection *conn,
dbus_bool_t adapter_cleanup(DBusConnection *conn, const char *path);
-struct device *adapter_get_device(DBusConnection *conn,
+struct btd_device *adapter_get_device(DBusConnection *conn,
struct adapter *adapter, const gchar *address);
-struct device *adapter_find_device(struct adapter *adapter, const char *dest);
+struct btd_device *adapter_find_device(struct adapter *adapter, const char *dest);
void adapter_remove_device(DBusConnection *conn, struct adapter *adapter,
- struct device *device);
-struct device *adapter_create_device(DBusConnection *conn,
+ struct btd_device *device);
+struct btd_device *adapter_create_device(DBusConnection *conn,
struct adapter *adapter, const char *address);
const char *mode2str(uint8_t mode);
diff --git a/hcid/agent.c b/hcid/agent.c
index a2b04be2..3a46043c 100644
--- a/hcid/agent.c
+++ b/hcid/agent.c
@@ -437,7 +437,7 @@ done:
agent_request_free(req);
}
-int agent_request_pincode(struct agent *agent, struct device *device,
+int agent_request_pincode(struct agent *agent, struct btd_device *device,
agent_pincode_cb cb, void *user_data)
{
struct agent_request *req;
@@ -590,7 +590,7 @@ done:
agent_request_free(req);
}
-int agent_request_passkey(struct agent *agent, struct device *device,
+int agent_request_passkey(struct agent *agent, struct btd_device *device,
agent_passkey_cb cb, void *user_data)
{
struct agent_request *req;
@@ -650,7 +650,7 @@ static DBusPendingCall *confirmation_request_new(struct agent *agent,
return call;
}
-int agent_request_confirmation(struct agent *agent, struct device *device,
+int agent_request_confirmation(struct agent *agent, struct btd_device *device,
uint32_t passkey, agent_cb cb,
void *user_data)
{
@@ -681,7 +681,7 @@ failed:
return -1;
}
-int agent_display_passkey(struct agent *agent, struct device *device,
+int agent_display_passkey(struct agent *agent, struct btd_device *device,
uint32_t passkey)
{
DBusMessage *message;
diff --git a/hcid/agent.h b/hcid/agent.h
index 37ee5edd..291e7a15 100644
--- a/hcid/agent.h
+++ b/hcid/agent.h
@@ -44,20 +44,20 @@ int agent_destroy(struct agent *agent, gboolean exited);
int agent_authorize(struct agent *agent, const char *path,
const char *uuid, agent_cb cb, void *user_data);
-int agent_request_pincode(struct agent *agent, struct device *device,
+int agent_request_pincode(struct agent *agent, struct btd_device *device,
agent_pincode_cb cb, void *user_data);
int agent_confirm_mode_change(struct agent *agent, const char *new_mode,
agent_cb cb, void *user_data);
-int agent_request_passkey(struct agent *agent, struct device *device,
+int agent_request_passkey(struct agent *agent, struct btd_device *device,
agent_passkey_cb cb, void *user_data);
-int agent_request_confirmation(struct agent *agent, struct device *device,
+int agent_request_confirmation(struct agent *agent, struct btd_device *device,
uint32_t passkey, agent_cb cb,
void *user_data);
-int agent_display_passkey(struct agent *agent, struct device *device,
+int agent_display_passkey(struct agent *agent, struct btd_device *device,
uint32_t passkey);
int agent_cancel(struct agent *agent);
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index 389a0b56..4dbbdf34 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -60,7 +60,7 @@ static DBusConnection *connection = NULL;
void bonding_request_free(struct bonding_request_info *bonding)
{
- struct device *device;
+ struct btd_device *device;
char address[18];
struct agent *agent;
@@ -363,7 +363,7 @@ static void reply_pending_requests(const char *path, struct adapter *adapter)
static void do_unregister(gpointer data, gpointer user_data)
{
DBusConnection *conn = user_data;
- struct device *device = data;
+ struct btd_device *device = data;
device_remove(conn, device);
}
@@ -504,7 +504,7 @@ static void create_stored_device_from_profiles(char *key, char *value,
{
struct adapter *adapter = user_data;
GSList *uuids = bt_string2list(value);
- struct device *device;
+ struct btd_device *device;
device = device_create(connection, adapter, key);
if (device) {
@@ -519,7 +519,7 @@ static void create_stored_device_from_linkkeys(char *key, char *value,
void *user_data)
{
struct adapter *adapter = user_data;
- struct device *device;
+ struct btd_device *device;
if (g_slist_find_custom(adapter->devices,
key, (GCompareFunc) device_address_cmp))
@@ -721,7 +721,7 @@ int hcid_dbus_stop_device(uint16_t id)
}
static void pincode_cb(struct agent *agent, DBusError *err, const char *pincode,
- struct device *device)
+ struct btd_device *device)
{
struct adapter *adapter = device_get_adapter(device);
pin_code_reply_cp pr;
@@ -775,7 +775,7 @@ int hcid_dbus_request_pin(int dev, bdaddr_t *sba, struct hci_conn_info *ci)
{
char addr[18];
struct adapter *adapter;
- struct device *device;
+ struct btd_device *device;
struct agent *agent;
int ret;
@@ -819,7 +819,7 @@ int hcid_dbus_request_pin(int dev, bdaddr_t *sba, struct hci_conn_info *ci)
static void confirm_cb(struct agent *agent, DBusError *err, void *user_data)
{
- struct device *device = user_data;
+ struct btd_device *device = user_data;
struct adapter *adapter = device_get_adapter(device);
user_confirm_reply_cp cp;
int dd;
@@ -859,7 +859,7 @@ static void confirm_cb(struct agent *agent, DBusError *err, void *user_data)
static void passkey_cb(struct agent *agent, DBusError *err, uint32_t passkey,
void *user_data)
{
- struct device *device = user_data;
+ struct btd_device *device = user_data;
struct adapter *adapter = device_get_adapter(device);
user_passkey_reply_cp cp;
bdaddr_t dba;
@@ -939,7 +939,7 @@ static int get_auth_requirements(bdaddr_t *local, bdaddr_t *remote,
int hcid_dbus_user_confirm(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
{
struct adapter *adapter;
- struct device *device;
+ struct btd_device *device;
struct agent *agent;
char addr[18];
uint8_t type;
@@ -1019,7 +1019,7 @@ int hcid_dbus_user_confirm(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
int hcid_dbus_user_passkey(bdaddr_t *sba, bdaddr_t *dba)
{
struct adapter *adapter;
- struct device *device;
+ struct btd_device *device;
struct agent *agent;
char addr[18];
struct pending_auth_info *auth;
@@ -1059,7 +1059,7 @@ int hcid_dbus_user_passkey(bdaddr_t *sba, bdaddr_t *dba)
int hcid_dbus_user_notify(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
{
struct adapter *adapter;
- struct device *device;
+ struct btd_device *device;
struct agent *agent;
char addr[18];
struct pending_auth_info *auth;
@@ -1102,7 +1102,7 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer,
char peer_addr[18];
const char *paddr = peer_addr;
DBusMessage *reply;
- struct device *device;
+ struct btd_device *device;
struct bonding_request_info *bonding;
gboolean paired = TRUE;
struct pending_auth_info *auth;
@@ -1671,7 +1671,7 @@ void hcid_dbus_remote_class(bdaddr_t *local, bdaddr_t *peer, uint32_t class)
uint32_t old_class = 0;
struct adapter *adapter;
GSList *l;
- struct device *device;
+ struct btd_device *device;
const gchar *dev_path;
read_remote_class(local, peer, &old_class);
@@ -1718,7 +1718,7 @@ void hcid_dbus_remote_name(bdaddr_t *local, bdaddr_t *peer, uint8_t status,
ba2str(peer, peer_addr);
if (!status) {
- struct device *device;
+ struct btd_device *device;
device = adapter_find_device(adapter, paddr);
if (device) {
@@ -1803,7 +1803,7 @@ void hcid_dbus_conn_complete(bdaddr_t *local, uint8_t status, uint16_t handle,
if (adapter->bonding)
adapter->bonding->hci_status = status;
} else {
- struct device *device;
+ struct btd_device *device;
gboolean connected = TRUE;
device = adapter_find_device(adapter, paddr);
@@ -1829,7 +1829,7 @@ void hcid_dbus_disconn_complete(bdaddr_t *local, uint8_t status,
char peer_addr[18];
const char *paddr = peer_addr;
struct adapter *adapter;
- struct device *device;
+ struct btd_device *device;
struct active_conn_info *dev;
GSList *l;
gboolean connected = FALSE;
@@ -2184,7 +2184,7 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote,
uint8_t *cap, uint8_t *auth)
{
struct adapter *adapter;
- struct device *device;
+ struct btd_device *device;
struct agent *agent;
char addr[18];
@@ -2227,7 +2227,7 @@ int hcid_dbus_set_io_cap(bdaddr_t *local, bdaddr_t *remote,
uint8_t cap, uint8_t auth)
{
struct adapter *adapter;
- struct device *device;
+ struct btd_device *device;
char addr[18];
adapter = manager_find_adapter(local);
diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c
index 66575d33..b6a13573 100644
--- a/hcid/dbus-service.c
+++ b/hcid/dbus-service.c
@@ -75,7 +75,7 @@ int service_req_auth(const bdaddr_t *src, const bdaddr_t *dst,
{
struct service_auth *auth;
struct adapter *adapter;
- struct device *device;
+ struct btd_device *device;
struct agent *agent;
char address[18];
gboolean trusted;
@@ -125,7 +125,7 @@ int service_req_auth(const bdaddr_t *src, const bdaddr_t *dst,
int service_cancel_auth(const bdaddr_t *src, const bdaddr_t *dst)
{
struct adapter *adapter = manager_find_adapter(src);
- struct device *device;
+ struct btd_device *device;
struct agent *agent;
char address[18];
diff --git a/hcid/device.c b/hcid/device.c
index 966d9ec0..be34eda8 100644
--- a/hcid/device.c
+++ b/hcid/device.c
@@ -68,8 +68,7 @@
#define DEVICE_INTERFACE "org.bluez.Device"
-struct device {
- struct btd_device dev;
+struct btd_device {
gchar *address;
gchar *path;
struct adapter *adapter;
@@ -90,7 +89,7 @@ struct device {
struct browse_req {
DBusConnection *conn;
DBusMessage *msg;
- struct device *device;
+ struct btd_device *device;
GSList *uuids_added;
GSList *uuids_removed;
int search_uuid;
@@ -110,7 +109,7 @@ static uint16_t uuid_list[] = {
static void device_free(gpointer user_data)
{
- struct device *device = user_data;
+ struct btd_device *device = user_data;
if (device->agent)
agent_destroy(device->agent, FALSE);
@@ -126,7 +125,7 @@ static void device_free(gpointer user_data)
g_free(device);
}
-static gboolean device_is_paired(struct device *device)
+static gboolean device_is_paired(struct btd_device *device)
{
struct adapter *adapter = device->adapter;
char filename[PATH_MAX + 1], *str;
@@ -141,7 +140,7 @@ static gboolean device_is_paired(struct device *device)
return ret;
}
-static char *device_get_name(struct device *device)
+static char *device_get_name(struct btd_device *device)
{
struct adapter *adapter = device->adapter;
char filename[PATH_MAX + 1];
@@ -153,7 +152,7 @@ static char *device_get_name(struct device *device)
static DBusMessage *get_properties(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
- struct device *device = user_data;
+ struct btd_device *device = user_data;
struct adapter *adapter = device->adapter;
DBusMessage *reply;
DBusMessageIter iter;
@@ -262,7 +261,7 @@ static int remove_device_alias(const char *source, const char *destination)
static DBusMessage *set_alias(DBusConnection *conn, DBusMessage *msg,
const char *alias, void *data)
{
- struct device *device = data;
+ struct btd_device *device = data;
struct adapter *adapter = device->adapter;
bdaddr_t bdaddr;
int ecode;
@@ -298,7 +297,7 @@ static DBusMessage *set_alias(DBusConnection *conn, DBusMessage *msg,
static DBusMessage *set_trust(DBusConnection *conn, DBusMessage *msg,
dbus_bool_t value, void *data)
{
- struct device *device = data;
+ struct btd_device *device = data;
struct adapter *adapter = device->adapter;
bdaddr_t local;
@@ -363,7 +362,7 @@ static DBusMessage *set_property(DBusConnection *conn,
static void discover_services_req_exit(void *user_data)
{
- struct device *device = user_data;
+ struct btd_device *device = user_data;
struct adapter *adapter = device->adapter;
bdaddr_t src, dst;
@@ -378,7 +377,7 @@ static void discover_services_req_exit(void *user_data)
static DBusMessage *discover_services(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
- struct device *device = user_data;
+ struct btd_device *device = user_data;
const char *pattern;
int err;
@@ -415,7 +414,7 @@ fail:
static DBusMessage *cancel_discover(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
- struct device *device = user_data;
+ struct btd_device *device = user_data;
struct adapter *adapter = device->adapter;
bdaddr_t src, dst;
@@ -444,7 +443,7 @@ static DBusMessage *cancel_discover(DBusConnection *conn,
static gboolean disconnect_timeout(gpointer user_data)
{
- struct device *device = user_data;
+ struct btd_device *device = user_data;
struct active_conn_info *ci;
GSList *l;
disconnect_cp cp;
@@ -480,7 +479,7 @@ fail:
static DBusMessage *disconnect(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
- struct device *device = user_data;
+ struct btd_device *device = user_data;
GSList *l;
bdaddr_t bda;
@@ -518,13 +517,13 @@ static GDBusSignalTable device_signals[] = {
{ }
};
-struct device *device_create(DBusConnection *conn, struct adapter *adapter,
+struct btd_device *device_create(DBusConnection *conn, struct adapter *adapter,
const gchar *address)
{
gchar *address_up;
- struct device *device;
+ struct btd_device *device;
- device = g_try_malloc0(sizeof(struct device));
+ device = g_try_malloc0(sizeof(struct btd_device));
if (device == NULL)
return NULL;
@@ -546,14 +545,10 @@ struct device *device_create(DBusConnection *conn, struct adapter *adapter,
device->address = g_strdup(address);
device->adapter = adapter;
- device->dev.path = device->path;
- str2ba(device->address, &device->dev.dst);
- str2ba(adapter->address, &device->dev.src);
-
return device;
}
-void device_remove(DBusConnection *conn, struct device *device)
+void device_remove(DBusConnection *conn, struct btd_device *device)
{
GSList *list;
struct btd_device_driver *driver;
@@ -564,7 +559,7 @@ void device_remove(DBusConnection *conn, struct device *device)
for (list = device->drivers; list; list = list->next) {
driver = (struct btd_device_driver *) list->data;
- driver->remove(&device->dev);
+ driver->remove(device);
}
g_dbus_unregister_interface(conn, path, DEVICE_INTERFACE);
@@ -572,7 +567,7 @@ void device_remove(DBusConnection *conn, struct device *device)
g_free(path);
}
-gint device_address_cmp(struct device *device, const gchar *address)
+gint device_address_cmp(struct btd_device *device, const gchar *address)
{
return strcasecmp(device->address, address);
}
@@ -584,7 +579,7 @@ static int cmp_by_name(const void *data, const void *user_data)
return (strcmp(dev_driver->name, driver->name));
}
-void device_probe_drivers(struct device *device, GSList *uuids)
+void device_probe_drivers(struct btd_device *device, GSList *uuids)
{
GSList *list;
const char **uuid;
@@ -608,7 +603,7 @@ void device_probe_drivers(struct device *device, GSList *uuids)
if (do_probe == TRUE && !g_slist_find_custom(device->drivers,
driver, (GCompareFunc) cmp_by_name)) {
- err = driver->probe(&device->dev);
+ err = driver->probe(device);
if (err < 0) {
error("probe failed for driver %s",
driver->name);
@@ -625,7 +620,7 @@ void device_probe_drivers(struct device *device, GSList *uuids)
list->data, (GCompareFunc) strcmp);
}
-void device_remove_drivers(struct device *device, GSList *uuids)
+void device_remove_drivers(struct btd_device *device, GSList *uuids)
{
GSList *list;
@@ -642,7 +637,7 @@ void device_remove_drivers(struct device *device, GSList *uuids)
if (!match)
continue;
- driver->remove(&device->dev);
+ driver->remove(device);
device->drivers = g_slist_remove(device->drivers,
driver);
}
@@ -746,7 +741,7 @@ static void discover_device_reply(struct browse_req *req, sdp_list_t *recs)
static void services_changed(struct browse_req *req)
{
- struct device *device = req->device;
+ struct btd_device *device = req->device;
char **uuids;
GSList *l;
int i;
@@ -764,7 +759,7 @@ static void services_changed(struct browse_req *req)
static void update_services(struct browse_req *req, sdp_list_t *recs)
{
- struct device *device = req->device;
+ struct btd_device *device = req->device;
sdp_list_t *seq;
for (seq = recs; seq; seq = seq->next) {
@@ -799,7 +794,7 @@ static void update_services(struct browse_req *req, sdp_list_t *recs)
}
}
-static void store(struct device *device)
+static void store(struct btd_device *device)
{
struct adapter *adapter = device->adapter;
bdaddr_t src, dst;
@@ -821,7 +816,7 @@ static void store(struct device *device)
static void browse_cb(sdp_list_t *recs, int err, gpointer user_data)
{
struct browse_req *req = user_data;
- struct device *device = req->device;
+ struct btd_device *device = req->device;
struct adapter *adapter = device->adapter;
bdaddr_t src, dst;
uuid_t uuid;
@@ -906,7 +901,7 @@ cleanup:
g_free(req);
}
-int device_browse(struct device *device, DBusConnection *conn,
+int device_browse(struct btd_device *device, DBusConnection *conn,
DBusMessage *msg, uuid_t *search)
{
struct adapter *adapter = device->adapter;
@@ -947,7 +942,7 @@ int device_browse(struct device *device, DBusConnection *conn,
return bt_search_service(&src, &dst, &uuid, browse_cb, req, NULL);
}
-struct adapter *device_get_adapter(struct device *device)
+struct adapter *device_get_adapter(struct btd_device *device)
{
if (!device)
return NULL;
@@ -955,7 +950,7 @@ struct adapter *device_get_adapter(struct device *device)
return device->adapter;
}
-const gchar *device_get_address(struct device *device)
+const gchar *device_get_address(struct btd_device *device)
{
if (!device)
return NULL;
@@ -963,7 +958,7 @@ const gchar *device_get_address(struct device *device)
return device->address;
}
-const gchar *device_get_path(struct device *device)
+const gchar *device_get_path(struct btd_device *device)
{
if (!device)
return NULL;
@@ -971,7 +966,7 @@ const gchar *device_get_path(struct device *device)
return device->path;
}
-struct agent *device_get_agent(struct device *device)
+struct agent *device_get_agent(struct btd_device *device)
{
if (!device)
return NULL;
@@ -979,7 +974,7 @@ struct agent *device_get_agent(struct device *device)
return device->agent;
}
-void device_set_agent(struct device *device, struct agent *agent)
+void device_set_agent(struct btd_device *device, struct agent *agent)
{
if (!device)
return;
@@ -987,17 +982,17 @@ void device_set_agent(struct device *device, struct agent *agent)
device->agent = agent;
}
-gboolean device_is_busy(struct device *device)
+gboolean device_is_busy(struct btd_device *device)
{
return device->discov_active ? TRUE : FALSE;
}
-gboolean device_is_temporary(struct device *device)
+gboolean device_is_temporary(struct btd_device *device)
{
return device->temporary;
}
-void device_set_temporary(struct device *device, gboolean temporary)
+void device_set_temporary(struct btd_device *device, gboolean temporary)
{
if (!device)
return;
@@ -1005,7 +1000,7 @@ void device_set_temporary(struct device *device, gboolean temporary)
device->temporary = temporary;
}
-void device_set_cap(struct device *device, uint8_t cap)
+void device_set_cap(struct btd_device *device, uint8_t cap)
{
if (!device)
return;
@@ -1013,7 +1008,7 @@ void device_set_cap(struct device *device, uint8_t cap)
device->cap = cap;
}
-void device_set_auth(struct device *device, uint8_t auth)
+void device_set_auth(struct btd_device *device, uint8_t auth)
{
if (!device)
return;
@@ -1021,7 +1016,7 @@ void device_set_auth(struct device *device, uint8_t auth)
device->auth = auth;
}
-uint8_t device_get_auth(struct device *device)
+uint8_t device_get_auth(struct btd_device *device)
{
return device->auth;
}
diff --git a/hcid/device.h b/hcid/device.h
index 841ad866..0e6944b3 100644
--- a/hcid/device.h
+++ b/hcid/device.h
@@ -24,30 +24,24 @@
#define DEVICE_INTERFACE "org.bluez.Device"
-struct btd_device {
- char *path;
- bdaddr_t src;
- bdaddr_t dst;
-};
-
-struct device *device_create(DBusConnection *conn, struct adapter *adapter,
+struct btd_device *device_create(DBusConnection *conn, struct adapter *adapter,
const gchar *address);
-void device_remove(DBusConnection *conn, struct device *device);
-gint device_address_cmp(struct device *device, const gchar *address);
-int device_browse(struct device *device, DBusConnection *conn,
+void device_remove(DBusConnection *conn, struct btd_device *device);
+gint device_address_cmp(struct btd_device *device, const gchar *address);
+int device_browse(struct btd_device *device, DBusConnection *conn,
DBusMessage *msg, uuid_t *search);
-void device_probe_drivers(struct device *device, GSList *uuids);
-struct adapter *device_get_adapter(struct device *device);
-const gchar *device_get_address(struct device *device);
-const gchar *device_get_path(struct device *device);
-struct agent *device_get_agent(struct device *device);
-void device_set_agent(struct device *device, struct agent *agent);
-gboolean device_is_busy(struct device *device);
-gboolean device_is_temporary(struct device *device);
-void device_set_temporary(struct device *device, gboolean temporary);
-void device_set_cap(struct device *device, uint8_t cap);
-void device_set_auth(struct device *device, uint8_t auth);
-uint8_t device_get_auth(struct device *device);
+void device_probe_drivers(struct btd_device *device, GSList *uuids);
+struct adapter *device_get_adapter(struct btd_device *device);
+const gchar *device_get_address(struct btd_device *device);
+const gchar *device_get_path(struct btd_device *device);
+struct agent *device_get_agent(struct btd_device *device);
+void device_set_agent(struct btd_device *device, struct agent *agent);
+gboolean device_is_busy(struct btd_device *device);
+gboolean device_is_temporary(struct btd_device *device);
+void device_set_temporary(struct btd_device *device, gboolean temporary);
+void device_set_cap(struct btd_device *device, uint8_t cap);
+void device_set_auth(struct btd_device *device, uint8_t auth);
+uint8_t device_get_auth(struct btd_device *device);
#define BTD_UUIDS(args...) ((const char *[]) { args, NULL } )