Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94756491 authored by Katish Paran's avatar Katish Paran Committed by Gerrit - the friendly Code Review server
Browse files

diag: dci: Parse data till the end for events read over smd



Currently while running event stress commands without payload
the parsing for the last event report is not being done. This
leads to less number of events reported. This patch ensures that
the parsing happens till the end, for events with or without
payload.

Change-Id: I785ac431a40327896534b6389ff09c6ffc481546
Signed-off-by: default avatarKatish Paran <kparan@codeaurora.org>
parent 57fb4f72
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1105,8 +1105,12 @@ void extract_dci_events(unsigned char *buf, int len, int data_source, int token)
	/* Move directly to the start of the event series. 1 byte for
	 * event code and 2 bytes for the length field.
	 */
	/* The length field indicates the total length removing the cmd_code
	 * and the lenght field. The event parsing in that case should happen
	 * till the end.
	 */
	temp_len = 3;
	while (temp_len < (length - 1)) {
	while (temp_len < length) {
		event_id_packet = *(uint16_t *)(buf + temp_len);
		event_id = event_id_packet & 0x0FFF; /* extract 12 bits */
		if (event_id_packet & 0x8000) {