summaryrefslogtreecommitdiffstats
path: root/test/l2test.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-12-26 14:10:24 +0000
committerMarcel Holtmann <marcel@holtmann.org>2004-12-26 14:10:24 +0000
commit9e6e37723b8d8798ed9ba58734fd3022fdf49dc2 (patch)
treefd1be102d4d6d8ae05a505a851b6593c19720ba9 /test/l2test.c
parent84a66abab8579ab01c8715d8564155ad918235a2 (diff)
Update for connection information
Diffstat (limited to 'test/l2test.c')
-rw-r--r--test/l2test.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/l2test.c b/test/l2test.c
index 627d37f1..c36cc3b7 100644
--- a/test/l2test.c
+++ b/test/l2test.c
@@ -176,6 +176,7 @@ int do_connect(char *svr)
{
struct sockaddr_l2 rem_addr, loc_addr;
struct l2cap_options opts;
+ struct l2cap_conninfo conn;
int s, opt;
if ((s = socket(PF_BLUETOOTH, socktype, BTPROTO_L2CAP)) < 0) {
@@ -245,8 +246,17 @@ int do_connect(char *svr)
return -1;
}
- syslog(LOG_INFO, "Connected [imtu %d, omtu %d, flush_to %d]\n",
- opts.imtu, opts.omtu, opts.flush_to);
+ memset(&conn, 0, sizeof(conn));
+ opt = sizeof(conn);
+ if (getsockopt(s, SOL_L2CAP, L2CAP_CONNINFO, &conn, &opt) < 0) {
+ syslog(LOG_ERR, "Can't get L2CAP connection information. %s(%d)", strerror(errno), errno);
+ close(s);
+ return -1;
+ }
+
+ syslog(LOG_INFO, "Connected [imtu %d, omtu %d, flush_to %d, mode %d, handle %d, class 0x%02x%02x%02x]",
+ opts.imtu, opts.omtu, opts.flush_to, opts.mode, conn.hci_handle,
+ conn.dev_class[2], conn.dev_class[1], conn.dev_class[0]);
return s;
}