diff options
| -rw-r--r-- | tools/hciconfig.c | 18 | ||||
| -rw-r--r-- | tools/hcitool.c | 10 | 
2 files changed, 24 insertions, 4 deletions
| diff --git a/tools/hciconfig.c b/tools/hciconfig.c index 3bf3b292..0d13542d 100644 --- a/tools/hciconfig.c +++ b/tools/hciconfig.c @@ -795,6 +795,7 @@ static void cmd_delkey(int ctl, int hdev, char *opt)  static void cmd_commands(int ctl, int hdev, char *opt)  {  	uint8_t cmds[64]; +	char *str;  	int i, n, dd;  	dd = hci_open_dev(hdev); @@ -823,12 +824,17 @@ static void cmd_commands(int ctl, int hdev, char *opt)  		printf(")\n");  	} +	str = hci_commandstostr(cmds, "\t", 71); +	printf("%s\n", str); +	bt_free(str); +  	hci_close_dev(dd);  }  static void cmd_version(int ctl, int hdev, char *opt)  {  	struct hci_version ver; +	char *hciver, *lmpver;  	int dd;  	dd = hci_open_dev(hdev); @@ -844,13 +850,21 @@ static void cmd_version(int ctl, int hdev, char *opt)  		exit(1);  	} +	hciver = hci_vertostr(ver.hci_ver); +	lmpver = lmp_vertostr(ver.hci_ver); +  	print_dev_hdr(&di);  	printf("\tHCI Ver: %s (0x%x) HCI Rev: 0x%x LMP Ver: %s (0x%x) LMP Subver: 0x%x\n"  		"\tManufacturer: %s (%d)\n", -		hci_vertostr(ver.hci_ver), ver.hci_ver, ver.hci_rev, -		lmp_vertostr(ver.lmp_ver), ver.lmp_ver, ver.lmp_subver, +		hciver ? hciver : "n/a", ver.hci_ver, ver.hci_rev, +		lmpver ? lmpver : "n/a", ver.lmp_ver, ver.lmp_subver,  		bt_compidtostr(ver.manufacturer), ver.manufacturer); +	if (hciver) +		bt_free(hciver); +	if (lmpver) +		bt_free(lmpver); +  	hci_close_dev(dd);  } diff --git a/tools/hcitool.c b/tools/hcitool.c index bc09ea07..2865ec42 100644 --- a/tools/hcitool.c +++ b/tools/hcitool.c @@ -595,12 +595,15 @@ static void cmd_scan(int dev_id, int argc, char **argv)  		if (extinf && handle > 0) {  			if (hci_read_remote_version(dd, handle, &version, 20000) == 0) { +				char *ver = lmp_vertostr(version.lmp_ver);  				printf("Manufacturer:\t%s (%d)\n",  					bt_compidtostr(version.manufacturer),  					version.manufacturer);  				printf("LMP version:\t%s (0x%x) [subver 0x%x]\n", -					lmp_vertostr(version.lmp_ver), +					ver ? ver : "n/a",  					version.lmp_ver, version.lmp_subver); +				if (ver) +					bt_free(ver);  			}  			if (hci_read_remote_features(dd, handle, features, 20000) == 0) { @@ -779,13 +782,16 @@ static void cmd_info(int dev_id, int argc, char **argv)  		printf("\tDevice Name: %s\n", name);  	if (hci_read_remote_version(dd, handle, &version, 20000) == 0) { +		char *ver = lmp_vertostr(version.lmp_ver);  		printf("\tLMP Version: %s (0x%x) LMP Subversion: 0x%x\n"  			"\tManufacturer: %s (%d)\n", -			lmp_vertostr(version.lmp_ver), +			ver ? ver : "n/a",  			version.lmp_ver,  			version.lmp_subver,  			bt_compidtostr(version.manufacturer),  			version.manufacturer); +		if (ver) +			bt_free(ver);  	}  	if (hci_read_remote_features(dd, handle, features, 20000) == 0) { | 
