diff --git a/src/hci_dump.c b/src/hci_dump.c index 543bf54e2..efdb75373 100644 --- a/src/hci_dump.c +++ b/src/hci_dump.c @@ -107,12 +107,15 @@ void hci_dump_open(const char *filename, hci_dump_format_t format){ dump_file = fileno(stdout); } else { -# ifdef _WIN32 - dump_file = open(filename, O_WRONLY | O_CREAT | O_TRUNC); -# else - dump_file = open(filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); -# endif + int oflags = O_WRONLY | O_CREAT | O_TRUNC; +#ifdef _WIN32 + oflags |= O_BINARY; +#endif + dump_file = open(filename, oflags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ); + if (dump_file < 0){ + printf("hci_dump_open: failed to open file %s\n", filename); + } } #else UNUSED(filename); @@ -143,6 +146,13 @@ static void printf_packet(uint8_t packet_type, uint8_t in, uint8_t * packet, uin printf("ACL => "); } break; + case HCI_SCO_DATA_PACKET: + if (in) { + printf("SCO <= "); + } else { + printf("SCO => "); + } + break; case LOG_MESSAGE_PACKET: printf("LOG -- %s\n", (char*) packet); return;