From 0cce9097eaf6e810c2d5945d2847c0ae33d70a0d Mon Sep 17 00:00:00 2001 From: WismyYao Date: Wed, 6 Nov 2019 23:23:21 +0800 Subject: [PATCH] Wismy/x10(s) upgrade kit (#7049) Add a popup for auth-failure --- radio/src/pulses/pxx2.h | 2 ++ radio/src/telemetry/frsky_pxx2.cpp | 5 +++++ radio/src/translations.cpp | 2 ++ radio/src/translations.h | 2 ++ radio/src/translations/cz.h.txt | 1 + radio/src/translations/de.h.txt | 2 ++ radio/src/translations/en.h.txt | 1 + radio/src/translations/es.h.txt | 1 + radio/src/translations/fi.h.txt | 1 + radio/src/translations/fr.h.txt | 1 + radio/src/translations/it.h.txt | 1 + radio/src/translations/nl.h.txt | 1 + radio/src/translations/pl.h.txt | 1 + radio/src/translations/pt.h.txt | 1 + radio/src/translations/se.h.txt | 1 + 15 files changed, 23 insertions(+) diff --git a/radio/src/pulses/pxx2.h b/radio/src/pulses/pxx2.h index 23eae9934..6e3274278 100644 --- a/radio/src/pulses/pxx2.h +++ b/radio/src/pulses/pxx2.h @@ -65,6 +65,8 @@ #define SPECTRUM_ANALYSER_POWER_FLOOR -120 /*dBm*/ #endif +#define PXX2_AUTH_REFUSED_FLAG 0xA5 + enum PXX2ModuleModelID { PXX2_MODULE_NONE, PXX2_MODULE_XJT, diff --git a/radio/src/telemetry/frsky_pxx2.cpp b/radio/src/telemetry/frsky_pxx2.cpp index 582e098a4..bff29c315 100644 --- a/radio/src/telemetry/frsky_pxx2.cpp +++ b/radio/src/telemetry/frsky_pxx2.cpp @@ -227,6 +227,11 @@ void processAuthenticationFrame(uint8_t module, uint8_t * frame) uint8_t cryptoType = frame[3]; uint8_t messageDigest[16] = {0}; + if (frame[0] == 4 && PXX2_AUTH_REFUSED_FLAG == frame[4]) { + POPUP_INFORMATION(STR_AUTH_FAILURE); + return; + } + if (INTERNAL_MODULE == module && accessCRL(cryptoType, frame+4, messageDigest)) { moduleState[module].mode = MODULE_MODE_AUTHENTICATION; Pxx2Pulses & pxx2 = intmodulePulsesData.pxx2; diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index 9f7f8247e..8dcd039c1 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -770,3 +770,5 @@ const char STR_ABOUT_PARENTS_1[] = TR_ABOUT_PARENTS_1; const char STR_ABOUT_PARENTS_2[] = TR_ABOUT_PARENTS_2; const char STR_ABOUT_PARENTS_3[] = TR_ABOUT_PARENTS_3; const char STR_ABOUT_PARENTS_4[] = TR_ABOUT_PARENTS_4; + +const char STR_AUTH_FAILURE[] = TR_AUTH_FAILURE; diff --git a/radio/src/translations.h b/radio/src/translations.h index 038c4eea1..b0abe876f 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -910,6 +910,8 @@ extern const char STR_ABOUT_PARENTS_2[]; extern const char STR_ABOUT_PARENTS_3[]; extern const char STR_ABOUT_PARENTS_4[]; +extern const char STR_AUTH_FAILURE[]; + #define CHR_HOUR TR_CHR_HOUR #define CHR_INPUT TR_CHR_INPUT diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 2f0f094f6..556fb876c 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -1152,6 +1152,7 @@ #define TR_MENU_INVERT "Invertovat" #define TR_JITTER_FILTER "ADC Filtr" #define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage") +#define TR_AUTH_FAILURE "Auth-failure" #define ZSTR_RSSI "RSSI" #define ZSTR_R9PW "R9PW" diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index d59842fe6..eca2ec9ec 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -1157,6 +1157,8 @@ #define TR_MENU_INVERT "Invertieren" #define TR_JITTER_FILTER "ADC Filter" #define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage") +#define TR_AUTH_FAILURE "Auth-failure" + // ---------------------------------------------------------------- #define ZSTR_RSSI "RSSI" #define ZSTR_R9PW "R9PW" diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index 0b52f513f..c02d67a91 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -1156,6 +1156,7 @@ #define TR_MENU_INVERT "Invert" #define TR_JITTER_FILTER "ADC filter" #define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage") +#define TR_AUTH_FAILURE "Auth-failure" #define ZSTR_RSSI "RSSI" #define ZSTR_R9PW "R9PW" diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index 07b1d66da..c9afe0d62 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -1177,6 +1177,7 @@ #define TR_MENU_INVERT "Invert" #define TR_JITTER_FILTER "ADC Filter" #define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage") +#define TR_AUTH_FAILURE "Auth-failure" #define ZSTR_RSSI "RSSI" #define ZSTR_R9PW "R9PW" diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 6a80bbb14..92e7d99d2 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -1165,6 +1165,7 @@ #define TR_MENU_INVERT "Invert" #define TR_JITTER_FILTER "ADC Filter" #define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage") +#define TR_AUTH_FAILURE "Auth-failure" #define ZSTR_RSSI "RSSI" #define ZSTR_R9PW "R9PW" diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index 48bdf8114..97f095b43 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -1180,6 +1180,7 @@ #define TR_MENU_INVERT "Inverser" #define TR_JITTER_FILTER "Filtre ADC" #define TR_RTC_CHECK TR("Vérif. RTC", "Vérif. pile RTC") +#define TR_AUTH_FAILURE "Auth-failure" #define ZSTR_RSSI "RSSI" #define ZSTR_R9PW "R9PW" diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index a0e9cdd93..101c81c74 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -1174,6 +1174,7 @@ #define TR_MENU_INVERT "Inverti" #define TR_JITTER_FILTER "Filtro ADC" #define TR_RTC_CHECK TR("Controllo RTC", "Controllo voltaggio RTC") +#define TR_AUTH_FAILURE "Auth-failure" #define ZSTR_RSSI "RSSI" #define ZSTR_R9PW "R9PW" diff --git a/radio/src/translations/nl.h.txt b/radio/src/translations/nl.h.txt index a4ecfb51e..32d79b6c7 100644 --- a/radio/src/translations/nl.h.txt +++ b/radio/src/translations/nl.h.txt @@ -1166,6 +1166,7 @@ #define TR_MENU_INVERT "Inverteer" #define TR_JITTER_FILTER "ADC Filter" #define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage") +#define TR_AUTH_FAILURE "Auth-failure" #define ZSTR_RSSI "RSSI" #define ZSTR_R9PW "R9PW" diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 66e88737f..ec6e0b655 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -1173,6 +1173,7 @@ #define TR_MENU_INVERT "Odwróć" #define TR_JITTER_FILTER "ADC Filter" #define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage") +#define TR_AUTH_FAILURE "Auth-failure" #define ZSTR_RSSI "RSSI" #define ZSTR_R9PW "R9PW" diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index 669c4c4c4..4bfcf0b89 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -1162,6 +1162,7 @@ #define TR_MENU_INVERT "Invert" #define TR_JITTER_FILTER "ADC Filter" #define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage") +#define TR_AUTH_FAILURE "Auth-failure" #define ZSTR_RSSI "RSSI" #define ZSTR_R9PW "R9PW" diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 7164ba97c..a05e6902e 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -1173,6 +1173,7 @@ #define TR_MENU_INVERT "Invertera" #define TR_JITTER_FILTER "ADC Filter" #define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage") +#define TR_AUTH_FAILURE "Auth-failure" #define ZSTR_RSSI "RSSI" #define ZSTR_R9PW "R9PW"