[PATCH] monitor: Fix LE Set Extended Advertising Parameters TX power decoding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



TX power of 127 has special meaning for this command.
---
 monitor/packet.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/monitor/packet.c b/monitor/packet.c
index 96cacddd5..7f4d6b1ea 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -1115,7 +1115,7 @@ static void print_power_level(int8_t level, const char *type)
 {
 	print_field("TX power%s%s%s: %d dbm (0x%2.2x)",
 		type ? " (" : "", type ? type : "", type ? ")" : "",
-								level, level);
+							level, (uint8_t) level);
 }
 
 static void print_host_flow_control(uint8_t enable)
@@ -6944,7 +6944,10 @@ static void le_set_ext_adv_params_cmd(const void *data, uint8_t size)
 	print_peer_addr_type("Peer address type", cmd->peer_addr_type);
 	print_addr("Peer address", cmd->peer_addr, cmd->peer_addr_type);
 	print_adv_filter_policy("Filter policy", cmd->filter_policy);
-	print_power_level(cmd->tx_power, NULL);
+	if (cmd->tx_power == 0xff)
+		print_field("TX power: Host has no preference (0xff)");
+	else
+		print_power_level(cmd->tx_power, NULL);
 
 	switch (cmd->primary_phy) {
 	case 0x01:
-- 
2.20.1




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux