libusb: add USB path to packet log file name

This commit is contained in:
Matthias Ringwald 2016-07-22 17:19:05 +02:00
parent a4c4a5d697
commit 020654536a

View File

@ -123,7 +123,16 @@ int main(int argc, const char * argv[]){
}
// use logger: format HCI_DUMP_PACKETLOGGER, HCI_DUMP_BLUEZ or HCI_DUMP_STDOUT
hci_dump_open("/tmp/hci_dump.pklg", HCI_DUMP_PACKETLOGGER);
char pklg_path[100];
strcpy(pklg_path, "/tmp/hci_dump");
if (usb_path_len){
strcat(pklg_path, "_");
strcat(pklg_path, argv[2]);
}
strcat(pklg_path, ".pklg");
printf("Packet Log: %s\n", pklg_path);
hci_dump_open(pklg_path, HCI_DUMP_PACKETLOGGER);
// init HCI
hci_init(hci_transport_usb_instance(), NULL);