diff options
| author | Marcel Holtmann <marcel@holtmann.org> | 2004-07-29 09:16:53 +0000 | 
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2004-07-29 09:16:53 +0000 | 
| commit | e6d6d06c733bf8055dfdc0f9b585585cc4e450a4 (patch) | |
| tree | 138fede6c72179d163fbef623459cc1438f69df3 | |
| parent | 560a2768ee675ed0abd685f062eef1eab58a304f (diff) | |
Show flags of connected devices
| -rw-r--r-- | hidd/main.c | 19 | 
1 files changed, 17 insertions, 2 deletions
diff --git a/hidd/main.c b/hidd/main.c index 9965d30b..78501fea 100644 --- a/hidd/main.c +++ b/hidd/main.c @@ -255,6 +255,20 @@ static char *hidp_state[] = {  	"closed"  }; +static char *hidp_flagstostr(uint32_t flags) +{ +	static char str[100] = ""; + +	strcat(str, "["); + +	if (flags & (1 << HIDP_BOOT_PROTOCOL_MODE)) +		strcat(str, "boot-protocol"); + +	strcat(str, "]"); + +	return str; +} +  static void do_show(int ctl)  {  	struct hidp_connlist_req req; @@ -273,8 +287,9 @@ static void do_show(int ctl)  	for (i = 0; i < req.cnum; i++) {  		ba2str(&ci[i].bdaddr, addr); -		printf("%s %s [%04x:%04x] %s\n", addr, ci[i].name, -			ci[i].vendor, ci[i].product, hidp_state[ci[i].state]); +		printf("%s %s [%04x:%04x] %s %s\n", addr, ci[i].name, +			ci[i].vendor, ci[i].product, hidp_state[ci[i].state], +			ci[i].flags ? hidp_flagstostr(ci[i].flags) : "");  	}  }  | 
