Lines Matching refs:device
56 #include "device.h"
92 struct btd_device *device;
112 GSList *oor_devices; /* out of range device list */
242 error("Can't open device hci%d: %s (%d)",
253 error("Can't write class of device: %s (%d)",
275 error("Can't open device hci%d: %s (%d)",
287 error("Can't write class of device: %s (%d)",
930 struct btd_device *device;
941 device = l->data;
943 return device;
952 struct btd_device *device = l->data;
954 if (device_has_connection(device, handle))
955 return device;
984 struct btd_device *device;
989 device = device_create(conn, adapter, address);
990 if (!device)
993 device_set_temporary(device, TRUE);
995 adapter->devices = g_slist_append(adapter->devices, device);
997 path = device_get_path(device);
1005 return device;
1009 struct btd_device *device)
1011 const gchar *dev_path = device_get_path(device);
1014 adapter->devices = g_slist_remove(adapter->devices, device);
1015 adapter->connections = g_slist_remove(adapter->connections, device);
1024 agent = device_get_agent(device);
1028 if (agent && device_is_authorizing(device))
1031 agent = device_get_agent(device);
1035 device_set_agent(device, NULL);
1038 device_remove(device, conn, TRUE);
1045 struct btd_device *device;
1052 device = adapter_find_device(adapter, address);
1053 if (device)
1054 return device;
1388 struct btd_device *device = l->data;
1390 dev_path = device_get_path(device);
1406 struct btd_device *device;
1415 device = adapter_find_device(adapter, address);
1416 if (!device || !device_is_creating(device, NULL))
1419 "Device creation not in progress");
1421 if (!device_is_creating(device, sender))
1424 device_set_temporary(device, TRUE);
1426 if (device_is_connected(device)) {
1427 device_request_disconnect(device, msg);
1431 adapter_remove_device(conn, adapter, device);
1440 struct btd_device *device;
1453 "Device already exists");
1457 device = adapter_create_device(conn, adapter, address);
1458 if (!device)
1461 device_browse(device, conn, msg, NULL, FALSE);
1485 struct btd_device *device;
1501 error("Refusing adapter agent usage as device specific one");
1509 device = adapter_get_device(conn, adapter, address);
1510 if (!device)
1513 "Unable to create a new device object");
1515 return device_create_bonding(device, conn, msg, agent_path, cap);
1518 static gint device_path_cmp(struct btd_device *device, const gchar *path)
1520 const gchar *dev_path = device_get_path(device);
1529 struct btd_device *device;
1542 "Device does not exist");
1543 device = l->data;
1545 if (device_is_temporary(device) || device_is_busy(device))
1548 "Device creation in progress");
1550 device_set_temporary(device, TRUE);
1552 if (!device_is_connected(device)) {
1553 adapter_remove_device(conn, adapter, device);
1557 device_request_disconnect(device, msg);
1565 struct btd_device *device;
1580 "Device does not exist");
1582 device = l->data;
1588 dev_path = device_get_path(device);
1769 struct btd_device *device;
1786 "Device does not exist");
1787 device = l->data;
1796 htobs(device_get_handle(device)), htobs(num_slots), 1000);
1881 error("Can't open device hci%d: %s (%d)",
1910 error("Can't open device hci%d: %s (%d)", adapter->dev_id,
1973 struct btd_device *device;
1983 device = device_create(connection, adapter, key);
1984 if (!device)
1987 device_set_temporary(device, FALSE);
1988 adapter->devices = g_slist_append(adapter->devices, device);
1990 device_get_address(device, &dst);
1993 device_probe_drivers(device, uuids);
2003 struct btd_device *device;
2009 device = device_create(connection, adapter, key);
2010 if (device) {
2011 device_set_temporary(device, FALSE);
2012 adapter->devices = g_slist_append(adapter->devices, device);
2083 struct btd_device *device;
2087 device = adapter_get_device(connection, adapter, address);
2088 if (device)
2089 adapter_add_connection(adapter, device, ci->handle);
2322 struct btd_device *device = l->data;
2324 if (device_is_bonding(device, NULL))
2325 device_cancel_bonding(device,
2376 struct btd_device *device = adapter->connections->data;
2377 adapter_remove_connection(adapter, device, 0);
2437 will be written to the device */
2709 struct btd_device *device;
2719 device = adapter_find_device(adapter, paddr);
2720 if (device)
2721 paired = device_is_paired(device);
2912 struct btd_device *device, uint16_t handle)
2914 if (g_slist_find(adapter->connections, device)) {
2919 device_add_connection(device, connection, handle);
2921 adapter->connections = g_slist_append(adapter->connections, device);
2925 struct btd_device *device, uint16_t handle)
2929 if (!g_slist_find(adapter->connections, device)) {
2934 device_remove_connection(device, connection, handle);
2936 adapter->connections = g_slist_remove(adapter->connections, device);
2939 device_get_address(device, &bdaddr);
2942 if (device_is_authenticating(device))
2943 device_cancel_authentication(device, TRUE);
2945 if (device_is_temporary(device)) {
2946 const char *path = device_get_path(device);
2948 debug("Removing temporary device %s", path);
2949 adapter_remove_device(connection, adapter, device);
2986 device_set_authorizing(auth->device, FALSE);
2997 struct btd_device *device;
3005 device = adapter_find_device(adapter, address);
3006 if (!device)
3009 /* Device connected? */
3010 if (!g_slist_find(adapter->connections, device))
3020 device = adapter_find_device(adapter, address);
3021 if (!device)
3024 agent = device_get_agent(device);
3038 auth->device = device;
3040 dev_path = device_get_path(device);
3045 device_set_authorizing(device, TRUE);
3087 struct btd_device *device;
3096 device = adapter_find_device(adapter, address);
3097 if (!device)
3105 agent = device_get_agent(device);
3116 device_set_authorizing(device, FALSE);