From: Marcel Holtmann Date: Tue, 20 Aug 2013 06:11:16 +0000 (-0700) Subject: monitor: Return btsnoop type when opening files X-Git-Tag: android-x86-4.4-r3~7762 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=303b8b7757fc5c755ceeabe025cfc92a90bd694b;p=android-x86%2Fexternal-bluetooth-bluez.git monitor: Return btsnoop type when opening files --- diff --git a/monitor/btsnoop.c b/monitor/btsnoop.c index 49d399811..79997c4e0 100644 --- a/monitor/btsnoop.c +++ b/monitor/btsnoop.c @@ -165,7 +165,7 @@ void btsnoop_write(struct timeval *tv, uint16_t index, uint16_t opcode, do_write(tv, flags, data, size); } -int btsnoop_open(const char *path) +int btsnoop_open(const char *path, uint32_t *type) { struct btsnoop_hdr hdr; ssize_t len; @@ -216,6 +216,9 @@ int btsnoop_open(const char *path) break; } + if (type) + *type = btsnoop_type; + return 0; } diff --git a/monitor/btsnoop.h b/monitor/btsnoop.h index 044d1a2a9..cec976158 100644 --- a/monitor/btsnoop.h +++ b/monitor/btsnoop.h @@ -27,7 +27,7 @@ void btsnoop_create(const char *path); void btsnoop_write(struct timeval *tv, uint16_t index, uint16_t opcode, const void *data, uint16_t size); -int btsnoop_open(const char *path); +int btsnoop_open(const char *path, uint32_t *type); int btsnoop_read(struct timeval *tv, uint16_t *index, uint16_t *opcode, void *data, uint16_t *size); void btsnoop_close(void); diff --git a/monitor/control.c b/monitor/control.c index d4085efa1..8db33d685 100644 --- a/monitor/control.c +++ b/monitor/control.c @@ -810,9 +810,10 @@ void control_reader(const char *path) { unsigned char buf[MAX_PACKET_SIZE]; uint16_t index, opcode, pktlen; + uint32_t type; struct timeval tv; - if (btsnoop_open(path) < 0) + if (btsnoop_open(path, &type) < 0) return; open_pager();