diff mbox series

[v2,2/3] client: report channel if present in diag message

Message ID 20240223200944.1343893-2-ram.subramanian@getcruise.com (mailing list archive)
State Accepted, archived
Headers show
Series [v2,1/3] station: add channel number to diagnostics message | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

Ram Subramanian Feb. 23, 2024, 8:09 p.m. UTC
---
 client/diagnostic.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/client/diagnostic.c b/client/diagnostic.c
index 6360b7e2..e1bd9784 100644
--- a/client/diagnostic.c
+++ b/client/diagnostic.c
@@ -93,6 +93,7 @@  static const struct diagnostic_dict_mapping diagnostic_mapping[] = {
 	{ "RxMCS", 'y' },
 	{ "TxMCS", 'y' },
 	{ "Frequency", 'u' },
+	{ "Channel", 'q' },
 	{ "Security", 's' },
 	{ NULL }
 };
@@ -109,6 +110,7 @@  void diagnostic_display(struct l_dbus_message_iter *dict,
 	while (l_dbus_message_iter_next_entry(dict, &key, &variant)) {
 		const char *s_value;
 		uint32_t u_value;
+		uint16_t q_value;
 		int16_t n_value;
 		uint8_t y_value;
 		int bytes;
@@ -145,6 +147,14 @@  void diagnostic_display(struct l_dbus_message_iter *dict,
 			bytes = sprintf(display_text, "%u", u_value);
 			break;
 
+		case 'q':
+			if (!l_dbus_message_iter_get_variant(&variant, "q",
+							&q_value))
+				goto parse_error;
+
+			bytes = sprintf(display_text, "%u", q_value);
+			break;
+
 		case 'n':
 			if (!l_dbus_message_iter_get_variant(&variant, "n",
 							&n_value))