Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/9875


Change subject: sniffer: display F and D values frim PPS
......................................................................

sniffer: display F and D values frim PPS

Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0
---
M firmware/libcommon/include/iso7816_fidi.h
M firmware/libcommon/source/iso7816_fidi.c
M firmware/libcommon/source/sniffer.c
3 files changed, 9 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/75/9875/1

diff --git a/firmware/libcommon/include/iso7816_fidi.h 
b/firmware/libcommon/include/iso7816_fidi.h
index e4690a5..3b4b451 100644
--- a/firmware/libcommon/include/iso7816_fidi.h
+++ b/firmware/libcommon/include/iso7816_fidi.h
@@ -2,5 +2,11 @@

 #include <stdint.h>

+/* Table 7 of ISO 7816-3:2006 */
+extern const uint16_t fi_table[];
+
+/* Table 8 from ISO 7816-3:2006 */
+extern const uint8_t di_table[];
+
 /* compute the F/D ratio based on Fi and Di values */
 int compute_fidi_ratio(uint8_t fi, uint8_t di);
diff --git a/firmware/libcommon/source/iso7816_fidi.c 
b/firmware/libcommon/source/iso7816_fidi.c
index b35f068..bdccd55 100644
--- a/firmware/libcommon/source/iso7816_fidi.c
+++ b/firmware/libcommon/source/iso7816_fidi.c
@@ -24,13 +24,13 @@
 #include "iso7816_fidi.h"

 /* Table 7 of ISO 7816-3:2006 */
-static const uint16_t fi_table[] = {
+const uint16_t fi_table[] = {
        372, 372, 558, 744, 1116, 1488, 1860, 0,
        0, 512, 768, 1024, 1536, 2048, 0, 0
 };

 /* Table 8 from ISO 7816-3:2006 */
-static const uint8_t di_table[] = {
+const uint8_t di_table[] = {
        0, 1, 2, 4, 8, 16, 32, 64,
        12, 20, 2, 4, 8, 16, 32, 64,
 };
diff --git a/firmware/libcommon/source/sniffer.c 
b/firmware/libcommon/source/sniffer.c
index 88ac84f..fbf0022 100644
--- a/firmware/libcommon/source/sniffer.c
+++ b/firmware/libcommon/source/sniffer.c
@@ -566,7 +566,7 @@
                                        fn = 1;
                                        dn = 1;
                                }
-                               TRACE_INFO("PPS negotiation successful: Fn=%u 
Dn=%u\n\r", fn, dn);
+                               TRACE_INFO("PPS negotiation successful: Fn=%u 
Dn=%u\n\r", fi_table[fn], di_table[dn]);
                                update_fidi(sniff_usart.base, pps_cur[2]);
                                usb_send_fidi(pps_cur[2]); /* send Fi/Di change 
notification to host software over USB */
                        } else { /* checksum is invalid */

--
To view, visit https://gerrit.osmocom.org/9875
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0
Gerrit-Change-Number: 9875
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon <[email protected]>

Reply via email to