diff options
| author | Marcel Holtmann <marcel@holtmann.org> | 2008-08-27 14:47:31 +0200 | 
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2008-08-27 14:47:31 +0200 | 
| commit | ea3f9b2d644e2c1beeccc01591b302f5ed8a77bd (patch) | |
| tree | 935c4a3f17386d51af209403cc485a753963e994 /tools/hcitool.c | |
| parent | 85586b684b630334778a41c942fe8290ca07ca93 (diff) | |
Allow specifying of reason for the disconnect
Diffstat (limited to 'tools/hcitool.c')
| -rw-r--r-- | tools/hcitool.c | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/tools/hcitool.c b/tools/hcitool.c index 7ce3af38..896328c6 100644 --- a/tools/hcitool.c +++ b/tools/hcitool.c @@ -1238,12 +1238,13 @@ static struct option dc_options[] = {  static const char *dc_help =  	"Usage:\n" -	"\tdc <bdaddr>\n"; +	"\tdc <bdaddr> [reason]\n";  static void cmd_dc(int dev_id, int argc, char **argv)  {  	struct hci_conn_info_req *cr;  	bdaddr_t bdaddr; +	uint8_t reason;  	int opt, dd;  	for_each_opt(opt, dc_options, NULL) { @@ -1262,6 +1263,7 @@ static void cmd_dc(int dev_id, int argc, char **argv)  	}  	str2ba(argv[0], &bdaddr); +	reason = (argc > 1) ? atoi(argv[1]) : HCI_OE_USER_ENDED_CONNECTION;  	if (dev_id < 0) {  		dev_id = hci_for_each_dev(HCI_UP, find_conn, (long) &bdaddr); @@ -1291,7 +1293,7 @@ static void cmd_dc(int dev_id, int argc, char **argv)  	}  	if (hci_disconnect(dd, htobs(cr->conn_info->handle), -				HCI_OE_USER_ENDED_CONNECTION, 10000) < 0) +						reason, 10000) < 0)  		perror("Disconnect failed");  	free(cr); | 
