OSDN Git Service

monitor: Set default index filter in control handler
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 20 Aug 2013 22:52:20 +0000 (15:52 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 20 Aug 2013 22:52:20 +0000 (15:52 -0700)
monitor/btsnoop.c
monitor/control.c

index bcff317..9cd5282 100644 (file)
@@ -205,17 +205,6 @@ int btsnoop_open(const char *path, uint32_t *type)
 
        btsnoop_type = ntohl(hdr.type);
 
-       switch (btsnoop_type) {
-       case BTSNOOP_TYPE_HCI:
-       case BTSNOOP_TYPE_UART:
-               packet_del_filter(PACKET_FILTER_SHOW_INDEX);
-               break;
-
-       case BTSNOOP_TYPE_EXTENDED_HCI:
-               packet_add_filter(PACKET_FILTER_SHOW_INDEX);
-               break;
-       }
-
        if (type)
                *type = btsnoop_type;
 
index 8db33d6..bd67a0e 100644 (file)
@@ -816,6 +816,17 @@ void control_reader(const char *path)
        if (btsnoop_open(path, &type) < 0)
                return;
 
+       switch (type) {
+       case BTSNOOP_TYPE_HCI:
+       case BTSNOOP_TYPE_UART:
+               packet_del_filter(PACKET_FILTER_SHOW_INDEX);
+               break;
+
+       case BTSNOOP_TYPE_EXTENDED_HCI:
+               packet_add_filter(PACKET_FILTER_SHOW_INDEX);
+               break;
+       }
+
        open_pager();
 
        while (1) {