uint16_t handle)
{
if (device->handle) {
- error("%s: Unable to add connection %u, %u already exist)",
- device->path, handle, device->handle);
+ char addr[18];
+ ba2str(&device->bdaddr, addr);
+ error("%s: Unable to add connection %u, %u already exist",
+ addr, handle, device->handle);
return;
}
uint16_t handle)
{
if (handle && device->handle != handle) {
- error("%s: Unable to remove connection %u, handle mismatch (%u)",
- device->path, handle, device->handle);
+ char addr[18];
+ ba2str(&device->bdaddr, addr);
+ error("%s: connection handle mismatch %u != %u",
+ addr, handle, device->handle);
return;
}
void device_probe_drivers(struct btd_device *device, GSList *profiles)
{
GSList *list;
+ char addr[18];
int err;
+ ba2str(&device->bdaddr, addr);
+
if (device->blocked) {
- DBG("Skipping drivers for blocked device %s", device->path);
+ DBG("Skipping drivers for blocked device %s", addr);
goto add_uuids;
}
- DBG("Probe drivers for %s", device->path);
+ DBG("Probing drivers for %s", addr);
for (list = device_drivers; list; list = list->next) {
struct btd_device_driver *driver = list->data;
err = driver->probe(device, probe_uuids);
if (err < 0) {
- error("probe failed with driver %s for device %s",
- driver->name, device->path);
-
+ error("%s driver probe failed for device %s",
+ driver->name, addr);
g_free(driver_data);
g_slist_free(probe_uuids);
continue;
records = read_records(&src, &device->bdaddr);
- DBG("Remove drivers for %s", device->path);
+ DBG("Removing drivers for %s", dstaddr);
for (list = device->drivers; list; list = next) {
struct btd_driver_data *driver_data = list->data;
{
struct browse_req *req = user_data;
struct btd_device *device = req->device;
+ char addr[18];
+
+ ba2str(&device->bdaddr, addr);
if (err < 0) {
error("%s: error updating services: %s (%d)",
- device->path, strerror(-err), -err);
+ addr, strerror(-err), -err);
goto send_reply;
}
req->records = NULL;
if (!req->profiles_added && !req->profiles_removed) {
- DBG("%s: No service update", device->path);
+ DBG("%s: No service update", addr);
goto send_reply;
}
struct bonding_req *bonding;
const char *name = dbus_message_get_sender(msg);
struct agent *agent;
+ char addr[18];
- DBG("%s: requesting bonding", device->path);
+ ba2str(&device->bdaddr, addr);
+ DBG("Requesting bonding for %s", addr);
if (!agent_path)
goto proceed;
device->agent = agent;
DBG("Temporary agent registered for %s at %s:%s",
- device->path, name, agent_path);
+ addr, name, agent_path);
proceed:
bonding = g_new0(struct bonding_req, 1);
static void create_bond_req_exit(DBusConnection *conn, void *user_data)
{
struct btd_device *device = user_data;
+ char addr[18];
- DBG("%s: requestor exited before bonding was completed", device->path);
+ ba2str(&device->bdaddr, addr);
+ DBG("%s: requestor exited before bonding was completed", addr);
if (device->authr)
device_cancel_authentication(device, FALSE);
{
struct bonding_req *bonding = device->bonding;
DBusMessage *reply;
+ char addr[18];
if (!bonding)
return;
- DBG("%s: canceling bonding request", device->path);
+ ba2str(&device->bdaddr, addr);
+ DBG("Canceling bonding request for %s", addr);
if (device->authr)
device_cancel_authentication(device, FALSE);
{
struct authentication_req *auth;
struct agent *agent;
+ char addr[18];
int err;
+ ba2str(&device->bdaddr, addr);
+ DBG("Requesting agent authentication for %s", addr);
+
if (device->authr) {
- error("%s: authentication already requested", device->path);
+ error("Authentication already requested for %s", addr);
return -EALREADY;
}
- DBG("%s: requesting agent authentication", device->path);
-
agent = device_get_agent(device);
if (!agent) {
- error("No agent available for %u request", type);
+ error("No agent available for request type %d", type);
return -EPERM;
}
void device_cancel_authentication(struct btd_device *device, gboolean aborted)
{
struct authentication_req *auth = device->authr;
+ char addr[18];
if (!auth)
return;
- DBG("%s: canceling authentication request", device->path);
+ ba2str(&device->bdaddr, addr);
+ DBG("Canceling authentication request for %s", addr);
if (auth->agent)
agent_cancel(auth->agent);