Diff between ab8ae58e9f274990c82f1d551dc3bd2df7db040e and 9cb270ab424dc95cf439050659432b0c8b6cf174

Changed Files

File Additions Deletions Status
tools/parser/obex.c +25 -4 modified

Full Patch

diff --git a/tools/parser/obex.c b/tools/parser/obex.c
index 0cf2994..3d23f5c 100644
--- a/tools/parser/obex.c
+++ b/tools/parser/obex.c
@@ -226,6 +226,24 @@ static void parse_headers(int level, struct frame *frm)
 	}
 }
 
+static void print_status(uint8_t status)
+{
+	switch (status & 0x7f) {
+	case 0x10:
+		printf(" (continue)");
+		break;
+	case 0x20:
+		printf(" (success)");
+		break;
+	case 0x21:
+		printf(" (created)");
+		break;
+	case 0x22:
+		printf(" (accepted)");
+		break;
+	}
+}
+
 static uint8_t last_opcode = 0x00;
 static uint8_t last_status = 0x00;
 
@@ -243,15 +261,13 @@ void obex_dump(int level, struct frame *frm)
 	if ((opcode & 0x70) == 0x00) {
 		printf("OBEX: %s cmd(%c): len %d",
 			opcode2str(opcode), opcode & 0x80 ? 'f' : 'c', length);
-		if (last_status == 0x10)
-			printf(" (continue)");
+		print_status(last_status);
 		last_opcode = opcode;
 	} else {
 		printf("OBEX: %s rsp(%c): status %x%02d len %d",
 			opcode2str(last_opcode), opcode & 0x80 ? 'f' : 'c',
 					status >> 4, status & 0xf, length);
-		if (status == 0x10)
-			printf(" (continue)");
+		print_status(status);
 		opcode = last_opcode;
 	}
 
@@ -276,6 +292,11 @@ void obex_dump(int level, struct frame *frm)
 		printf("\n");
 	}
 
+	if ((status >> 4) > 2 && (parser.flags & DUMP_VERBOSE)) {
+		p_indent(level, frm);
+		printf("Error: %s\n", opcode2str(status));
+	}
+
 	parse_headers(level, frm);
 
 	raw_dump(level, frm);