diff options
| author | Marcel Holtmann <marcel@holtmann.org> | 2004-11-09 22:55:42 +0000 | 
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2004-11-09 22:55:42 +0000 | 
| commit | 1fc62ff85f185eae7f2297648fc9a2846fcb284d (patch) | |
| tree | c495e4ea47902cfc57c9c69c6263b859d7942ad0 /tools/hciconfig.c | |
| parent | 5327e84a4c0f07e44d8c3b23410c355465b094e5 (diff) | |
Use the new AFH functions
Diffstat (limited to 'tools/hciconfig.c')
| -rw-r--r-- | tools/hciconfig.c | 33 | 
1 files changed, 5 insertions, 28 deletions
| diff --git a/tools/hciconfig.c b/tools/hciconfig.c index 0e591e8d..854c8715 100644 --- a/tools/hciconfig.c +++ b/tools/hciconfig.c @@ -670,7 +670,6 @@ void cmd_version(int ctl, int hdev, char *opt)  void cmd_inq_mode(int ctl, int hdev, char *opt)  { -	struct hci_request rq;  	int dd;  	dd = hci_open_dev(hdev); @@ -679,8 +678,6 @@ void cmd_inq_mode(int ctl, int hdev, char *opt)  		exit(1);  	} -	memset(&rq, 0, sizeof(rq)); -  	if (opt) {  		uint8_t mode = atoi(opt); @@ -902,7 +899,6 @@ void cmd_page_to(int ctl, int hdev, char *opt)  void cmd_afh_mode(int ctl, int hdev, char *opt)  { -	struct hci_request rq;  	int dd;  	dd = hci_open_dev(hdev); @@ -911,44 +907,25 @@ void cmd_afh_mode(int ctl, int hdev, char *opt)  		exit(1);  	} -	memset(&rq, 0, sizeof(rq)); -  	if (opt) { -		write_afh_mode_cp cp; - -		cp.mode = atoi(opt); - -		rq.ogf = OGF_HOST_CTL; -		rq.ocf = OCF_WRITE_AFH_MODE; -		rq.cparam = &cp; -		rq.clen = WRITE_AFH_MODE_RP_SIZE; +		uint8_t mode = atoi(opt); -		if (hci_send_req(dd, &rq, 1000) < 0) { +		if (hci_write_afh_mode(dd, mode, 1000) < 0) {  			printf("Can't set AFH mode on hci%d. %s(%d)\n",  						hdev, strerror(errno), errno);  			exit(1);  		}  	} else { -		read_afh_mode_rp rp; - -		rq.ogf = OGF_HOST_CTL; -		rq.ocf = OCF_READ_AFH_MODE; -		rq.rparam = &rp; -		rq.rlen = READ_AFH_MODE_RP_SIZE; +		uint8_t mode; -		if (hci_send_req(dd, &rq, 1000) < 0) { +		if (hci_read_afh_mode(dd, &mode, 1000) < 0) {  			printf("Can't read AFH mode on hci%d. %s(%d)\n",   							hdev, strerror(errno), errno);  			exit(1);  		} -		if (rp.status) { -			printf("Read AFH mode on hci%d returned status %d\n",  -							hdev, rp.status); -			exit(1); -		}  		print_dev_hdr(&di); -		printf("\tAFH mode: %s\n", rp.mode == 1 ? "Enabled" : "Disabled"); +		printf("\tAFH mode: %s\n", mode == 1 ? "Enabled" : "Disabled");  	}  } | 
