mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-02 00:24:25 +08:00
Fix the name cache state
This commit is contained in:
parent
304b8bb466
commit
91ec718746
@ -544,7 +544,6 @@ static void cmd_scan(int dev_id, int argc, char **argv)
|
||||
continue;
|
||||
}
|
||||
|
||||
memset(name, 0, sizeof(name));
|
||||
if (hci_read_remote_name_with_clock_offset(dd,
|
||||
&(info+i)->bdaddr,
|
||||
(info+i)->pscan_rep_mode,
|
||||
@ -598,13 +597,15 @@ static void cmd_scan(int dev_id, int argc, char **argv)
|
||||
}
|
||||
|
||||
if (handle > 0 || !nc) {
|
||||
memset(name, 0, sizeof(name));
|
||||
if (hci_read_remote_name_with_clock_offset(dd,
|
||||
&(info+i)->bdaddr,
|
||||
(info+i)->pscan_rep_mode,
|
||||
(info+i)->clock_offset | 0x8000,
|
||||
sizeof(name), name, 100000) < 0)
|
||||
strcpy(name, "n/a");
|
||||
sizeof(name), name, 100000) < 0) {
|
||||
if (!nc)
|
||||
strcpy(name, "n/a");
|
||||
} else
|
||||
nc = 0;
|
||||
}
|
||||
printf("Device name:\t%s%s\n", name, nc ? " [cached]" : "");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user