Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Fix EIR parsing in evt_le_advertising_report_dump
@ 2011-10-04 22:55 Andre Guedes
  2011-10-10  7:08 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Andre Guedes @ 2011-10-04 22:55 UTC (permalink / raw)
  To: linux-bluetooth

Only the first EIR data structure from the LE advertising report
event is dumped. This patch fix this, so all EIR data structure
present in that event is dumped.
---
 parser/hci.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/parser/hci.c b/parser/hci.c
index 610177b..698a301 100644
--- a/parser/hci.c
+++ b/parser/hci.c
@@ -3534,6 +3534,7 @@ static inline void evt_le_advertising_report_dump(int level, struct frame *frm)
 	while (num_reports--) {
 		char addr[18];
 		le_advertising_info *info = frm->ptr;
+		int offset = 0;
 
 		p_ba2str(&info->bdaddr, addr);
 
@@ -3544,9 +3545,12 @@ static inline void evt_le_advertising_report_dump(int level, struct frame *frm)
 		printf("bdaddr %s (%s)\n", addr,
 					bdaddrtype2str(info->bdaddr_type));
 
-		if (info->length > 0) {
-			ext_inquiry_data_dump(level, frm,
-					((uint8_t *) &info->length) + 1);
+		while (offset < info->length) {
+			int eir_data_len = info->data[offset];
+
+			ext_inquiry_data_dump(level, frm, &info->data[offset]);
+
+			offset += eir_data_len + 1;
 		}
 
 		frm->ptr += LE_ADVERTISING_INFO_SIZE + info->length;
-- 
1.7.5.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix EIR parsing in evt_le_advertising_report_dump
  2011-10-04 22:55 [PATCH] Fix EIR parsing in evt_le_advertising_report_dump Andre Guedes
@ 2011-10-10  7:08 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2011-10-10  7:08 UTC (permalink / raw)
  To: Andre Guedes; +Cc: linux-bluetooth

Hi Andre,

On Tue, Oct 04, 2011, Andre Guedes wrote:
> Only the first EIR data structure from the LE advertising report
> event is dumped. This patch fix this, so all EIR data structure
> present in that event is dumped.
> ---
>  parser/hci.c |   10 +++++++---
>  1 files changed, 7 insertions(+), 3 deletions(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-10  7:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-04 22:55 [PATCH] Fix EIR parsing in evt_le_advertising_report_dump Andre Guedes
2011-10-10  7:08 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox