From cb7297ac7358543d170a04a6cf662dc7c2b4b5a8 Mon Sep 17 00:00:00 2001
From: Adam Wujek <dev_public@wujek.eu>
Date: Tue, 23 Apr 2024 02:38:00 +0200
Subject: [PATCH] userspace/libwr: remove warning about options field in sfp
 eeprom

Please note, this commit changes the order in which options bytes are
displayed.

Signed-off-by: Adam Wujek <dev_public@wujek.eu>
---
 userspace/libwr/i2c_sfp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/userspace/libwr/i2c_sfp.c b/userspace/libwr/i2c_sfp.c
index fdeb1c5fe..d5a364d16 100644
--- a/userspace/libwr/i2c_sfp.c
+++ b/userspace/libwr/i2c_sfp.c
@@ -336,7 +336,7 @@ void shw_sfp_print_header(struct shw_sfp_header *head)
 		printf("%c", head->vendor_rev[i]);
 	printf("\n");
 	printf("TX Wavelength: %d\n", getSfpTxWaveLength(head));
-	printf("Options: %04X\n", ((uint16_t *) head->options)[0]);
+	printf("Options: 0x%04X\n", head->options[0] << 8 | head->options[1]);
 	printf("Bitrate (MAX): %02X\n", head->br_max);
 	printf("Bitrate (MIN): %02X\n", head->br_min);
 	printf("Vendor Serial: ");
-- 
GitLab