From 723681ffa3035a55fe3a293add7e26da0e7296bd Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Tue, 8 Apr 2003 13:34:39 +0000 Subject: use constants; report errors --- tools/hcitool.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/hcitool.c b/tools/hcitool.c index 00c84b05..f2ffb891 100644 --- a/tools/hcitool.c +++ b/tools/hcitool.c @@ -428,7 +428,7 @@ static void cmd_info(int dev_id, int argc, char **argv) } if (cc) { - if (hci_create_connection(dd, &bdaddr, 0x0008 | 0x0010, 0, 0, &handle, 25000) < 0) { + if (hci_create_connection(dd, &bdaddr, HCI_DM1 | HCI_DH1, 0, 0, &handle, 25000) < 0) { perror("Can't create connection"); close(dd); exit(1); @@ -467,7 +467,7 @@ static void cmd_info(int dev_id, int argc, char **argv) } if (cc) - hci_disconnect(dd, handle, 0x13, 10000); + hci_disconnect(dd, handle, HCI_OE_USER_ENDED_CONNECTION, 10000); close(dd); } @@ -655,7 +655,8 @@ static void cmd_cc(int dev_id, int argc, char **argv) exit(1); } - hci_create_connection(dd, &bdaddr, ptype, 0, role, &handle, 1000); + if (0 > hci_create_connection(dd, &bdaddr, ptype, 0, role, &handle, 1000)) + perror("Can't create connection"); hci_close_dev(dd); } @@ -718,7 +719,8 @@ static void cmd_dc(int dev_id, int argc, char **argv) exit(1); } - hci_disconnect(dd, cr->conn_info->handle, 0x13, 100); + if (0 > hci_disconnect(dd, cr->conn_info->handle, HCI_OE_USER_ENDED_CONNECTION, 100)) + perror("Disconnect failed"); close(dd); free(cr); -- cgit