monitor: Update RSSI printing function
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 2 Apr 2021 05:42:09 +0000 (07:42 +0200)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:35 +0000 (19:08 +0530)
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
monitor/broadcom.c
monitor/packet.c
monitor/packet.h

index 93fe5ed..cf8d5ac 100644 (file)
@@ -42,7 +42,7 @@ static void print_handle(uint16_t handle)
 
 static void print_rssi(int8_t rssi)
 {
-       packet_print_rssi(rssi);
+       packet_print_rssi("RSSI", rssi);
 }
 
 static void print_sco_routing(uint8_t routing)
index 81c9459..f21423e 100755 (executable)
@@ -2184,10 +2184,7 @@ static void print_adv_filter_policy(const char *label, uint8_t value)
 
 static void print_rssi(int8_t rssi)
 {
-       if ((uint8_t) rssi == 0x99 || rssi == 127)
-               print_field("RSSI: invalid (0x%2.2x)", (uint8_t) rssi);
-       else
-               print_field("RSSI: %d dBm (0x%2.2x)", rssi, (uint8_t) rssi);
+       packet_print_rssi("RSSI", rssi);
 }
 
 static void print_slot_625(const char *label, uint16_t value)
@@ -3797,9 +3794,13 @@ void packet_print_handle(uint16_t handle)
        print_handle_native(handle);
 }
 
-void packet_print_rssi(int8_t rssi)
+void packet_print_rssi(const char *label, int8_t rssi)
 {
-       print_rssi(rssi);
+       if ((uint8_t) rssi == 0x99 || rssi == 127)
+               print_field("%s: invalid (0x%2.2x)", label, (uint8_t) rssi);
+       else
+               print_field("%s: %d dBm (0x%2.2x)", label, rssi,
+                                                       (uint8_t) rssi);
 }
 
 void packet_print_ad(const void *data, uint8_t size)
index b257032..42a1a32 100755 (executable)
@@ -39,7 +39,7 @@ void packet_print_version(const char *label, uint8_t version,
 void packet_print_company(const char *label, uint16_t company);
 void packet_print_addr(const char *label, const void *data, bool random);
 void packet_print_handle(uint16_t handle);
-void packet_print_rssi(int8_t rssi);
+void packet_print_rssi(const char *label, int8_t rssi);
 void packet_print_ad(const void *data, uint8_t size);
 void packet_print_features_lmp(const uint8_t *features, uint8_t page);
 void packet_print_features_ll(const uint8_t *features);