Skip to contentSkip to conversation

Improve input server connect log messages

PATCH Applied Peter Hurley 2 participants 2 messages Jul 2, 2011 – Jul 3, 2011 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Improve input server connect log messages

Added error log message for connection refusals and added remote device BDADDR to existing debug messages.

---
 input/server.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
input/server.c +10 -2
index 7fd00f2..cea08d1 100644
@@ -62,6 +62,7 @@ static void connect_event_cb(GIOChannel *chan, GError *err, gpointer data)
 {
 	uint16_t psm;
 	bdaddr_t src, dst;
+	char address[18];
 	GError *gerr = NULL;
 	int ret;
 
@@ -82,12 +83,15 @@ static void connect_event_cb(GIOChannel *chan, GError *err, gpointer data)
 		return;
 	}
 
-	DBG("Incoming connection on PSM %d", psm);
+	ba2str(&dst, address);
+	DBG("Incoming connection from %s on PSM %d", address, psm);
 
 	ret = input_device_set_channel(&src, &dst, psm, chan);
 	if (ret == 0)
 		return;
 
+	error("Refusing input device connect: %s (%d)", strerror(-ret), -ret);
+
 	/* Send unplug virtual cable to unknown devices */
 	if (ret == -ENOENT && psm == L2CAP_PSM_HIDP_CTRL) {
 		unsigned char unplug = 0x15;
@@ -157,7 +161,11 @@ static void confirm_event_cb(GIOChannel *chan, gpointer user_data)
 	}
 
 	if (server->confirm) {
-		error("Refusing connection: setup in progress");
+		char address[18];
+
+		ba2str(&dst, address);
+		error("Refusing connection from %s: setup in progress",
+								address);
 		goto drop;
 	}
 
Signature · 1 line
1.7.4.1
#1 lore raw

Hi Peter,

Quoted 5 lines · Peter Hurley

Added error log message for connection refusals and added remote device BDADDR to existing debug messages.

---
 input/server.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

Applied. Thanks.

Johan