summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2021-08-16 17:35:18 +0200
committerMarcel Holtmann <marcel@holtmann.org>2021-08-16 17:36:00 +0200
commit7a6b68050f29050e90d717f1ccdb91e907454416 (patch)
treec77b5e6170bbb3a1b0c97b7cebf712cf6b2861e2
parentf71feab36538a02d9b4dbed549e52dcaa75384c9 (diff)
downloadbluez-7a6b68050f29050e90d717f1ccdb91e907454416.tar.gz
monitor: Store MSFT extension event prefix
-rw-r--r--monitor/msft.c2
-rw-r--r--monitor/packet.c8
-rw-r--r--monitor/packet.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/monitor/msft.c b/monitor/msft.c
index fcbd05777..46e765489 100644
--- a/monitor/msft.c
+++ b/monitor/msft.c
@@ -54,6 +54,8 @@ static void read_supported_features_rsp(const void *data, uint16_t size)
packet_print_features_msft(data);
print_field("Event prefix length: %u", evt_prefix_len);
packet_hexdump(data + 9, size - 9);
+
+ packet_set_msft_evt_prefix(data + 9, evt_prefix_len);
}
static void le_monitor_advertisement_cmd(const void *data, uint16_t size)
diff --git a/monitor/packet.c b/monitor/packet.c
index 9e849acc0..fce2b7684 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -266,6 +266,8 @@ struct index_data {
uint8_t bdaddr[6];
uint16_t manufacturer;
uint16_t msft_opcode;
+ uint8_t msft_evt_prefix[8];
+ uint8_t msft_evt_len;
size_t frame;
};
@@ -281,6 +283,12 @@ void packet_set_fallback_manufacturer(uint16_t manufacturer)
fallback_manufacturer = manufacturer;
}
+void packet_set_msft_evt_prefix(const uint8_t *prefix, uint8_t len)
+{
+ if (index_current < MAX_INDEX && len < 8)
+ memcpy(index_list[index_current].msft_evt_prefix, prefix, len);
+}
+
static void print_packet(struct timeval *tv, struct ucred *cred, char ident,
uint16_t index, const char *channel,
const char *color, const char *label,
diff --git a/monitor/packet.h b/monitor/packet.h
index 34f988e86..8a11bc714 100644
--- a/monitor/packet.h
+++ b/monitor/packet.h
@@ -31,6 +31,7 @@ void packet_del_filter(unsigned long filter);
void packet_set_priority(const char *priority);
void packet_select_index(uint16_t index);
void packet_set_fallback_manufacturer(uint16_t manufacturer);
+void packet_set_msft_evt_prefix(const uint8_t *prefix, uint8_t len);
void packet_hexdump(const unsigned char *buf, uint16_t len);
void packet_print_error(const char *label, uint8_t error);