From 1abf802aa75163a19b81c8aa1ac82ab6f985f10a Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 25 Apr 2019 11:11:13 +0200 Subject: [PATCH] Bluetooth flash firmware continued --- radio/src/gui/common/stdlcd/radio_sdmanager.cpp | 9 +++++++++ radio/src/sdcard.h | 1 + radio/src/translations.cpp | 1 + radio/src/translations.h | 1 + radio/src/translations/cz.h.txt | 1 + radio/src/translations/de.h.txt | 1 + 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/gui/common/stdlcd/radio_sdmanager.cpp b/radio/src/gui/common/stdlcd/radio_sdmanager.cpp index ad3b21e1e..3295729e2 100644 --- a/radio/src/gui/common/stdlcd/radio_sdmanager.cpp +++ b/radio/src/gui/common/stdlcd/radio_sdmanager.cpp @@ -196,6 +196,10 @@ void onSdManagerMenu(const char * result) DeviceFirmwareUpdate device(SPORT_MODULE); device.flashFile(lfn); } + else if (result == STR_FLASH_BLUETOOTH_MODULE) { + getSelectionFullPath(lfn); + bluetooth.flashFirmware(lfn); + } else if (result == STR_FLASH_RECEIVER_OTA) { getSelectionFullPath(lfn); moduleState[EXTERNAL_MODULE].startBind(&reusableBuffer.sdManager.otaInformation, onUpdateStateChanged); @@ -337,6 +341,11 @@ void menuRadioSdManager(event_t _event) POPUP_MENU_ADD_ITEM(STR_FLASH_RECEIVER_OTA); #endif } +#endif +#if defined(PCBXLITES) + else if (!READ_ONLY() && !strcasecmp(ext, BLUETOOTH_FIRMWARE_EXT)) { + POPUP_MENU_ADD_ITEM(STR_FLASH_BLUETOOTH_MODULE); + } #endif } if (!READ_ONLY()) { diff --git a/radio/src/sdcard.h b/radio/src/sdcard.h index 349b824d8..935e54631 100644 --- a/radio/src/sdcard.h +++ b/radio/src/sdcard.h @@ -68,6 +68,7 @@ const char RADIO_SETTINGS_PATH[] = RADIO_PATH "/radio.bin"; #define FIRMWARE_EXT ".bin" #define EEPROM_EXT ".bin" #define SPORT_FIRMWARE_EXT ".frk" +#define BLUETOOTH_FIRMWARE_EXT ".bin" #define LEN_FILE_EXTENSION_MAX 5 // longest used, including the dot, excluding null term. diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index 1eb99f6ac..df7653ef0 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -576,6 +576,7 @@ const char STR_FIRMWARE_UPDATE_SUCCESS[] = TR_FIRMWARE_UPDATE_SUCCESS; const char STR_WRITING[] = TR_WRITING; const char STR_FLASH_EXTERNAL_DEVICE[] = TR_FLASH_EXTERNAL_DEVICE; const char STR_FLASH_RECEIVER_OTA[] = TR_FLASH_RECEIVER_OTA; +const char STR_FLASH_BLUETOOTH_MODULE[] = TR_FLASH_BLUETOOTH_MODULE; const char STR_CURRENT_VERSION[] = TR_CURRENT_VERSION; const char STR_CONFIRM_FORMAT[] = TR_CONFIRM_FORMAT; const char STR_CONFIRMRESET[] = TR_CONFIRMRESET; diff --git a/radio/src/translations.h b/radio/src/translations.h index 3d1d5473d..c5334cbe7 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -771,6 +771,7 @@ extern const char STR_VIEW_TEXT[]; extern const char STR_FLASH_BOOTLOADER[]; extern const char STR_FLASH_EXTERNAL_DEVICE[]; extern const char STR_FLASH_RECEIVER_OTA[]; +extern const char STR_FLASH_BLUETOOTH_MODULE[]; extern const char STR_CURRENT_VERSION[]; extern const char STR_FLASH_INTERNAL_MODULE[]; extern const char STR_FLASH_EXTERNAL_MODULE[]; diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 39c91afa7..dbfca4474 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -935,6 +935,7 @@ #define TR_FLASH_BOOTLOADER "Flash BootLoaderu" #define TR_FLASH_EXTERNAL_DEVICE TR("Flash ext. port", "Flash externího port") #define TR_FLASH_RECEIVER_OTA "Flash receiver OTA" +#define TR_FLASH_BLUETOOTH_MODULE "Flash Bluetooth module" #define TR_CURRENT_VERSION TR("Current vers. ", "Current version: ") #define TR_FLASH_INTERNAL_MODULE TR("Flash vnitř. modulu", "Flash vnitřního modulu") #define TR_FLASH_EXTERNAL_MODULE TR("Flash ext. modulu", "Flash externího zařízení") diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index 31ca38baf..c51fb146f 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -944,6 +944,7 @@ #define TR_FLASH_BOOTLOADER TR("Flash Bootloader","Flash BootLoader selbst") // #define TR_FLASH_EXTERNAL_DEVICE TR("Flash ext. Gerät","Flash externes Gerät") #define TR_FLASH_RECEIVER_OTA "Flash receiver OTA" +#define TR_FLASH_BLUETOOTH_MODULE "Flash Bluetooth module" #define TR_CURRENT_VERSION TR("Current vers. ", "Current version: ") #define TR_FLASH_INTERNAL_MODULE TR("Flash int. XJT","Flash internes XJT-Modul") #define TR_FLASH_EXTERNAL_MODULE TR("Flash ext. mod","Flash extern module") diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index 4dda51443..78a7aa724 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -938,6 +938,7 @@ #define TR_FLASH_BOOTLOADER "Flash bootLoader" #define TR_FLASH_EXTERNAL_DEVICE TR("Flash S.Port", "Flash S.Port device") #define TR_FLASH_RECEIVER_OTA "Flash receiver OTA" +#define TR_FLASH_BLUETOOTH_MODULE "Flash Bluetooth module" #define TR_CURRENT_VERSION TR("Current vers. ", "Current version: ") #define TR_FLASH_INTERNAL_MODULE TR("Flash int. module", "Flash internal module") #define TR_FLASH_EXTERNAL_MODULE TR("Flash ext. module", "Flash external module") diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index ec5dea407..854bf1183 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -946,6 +946,7 @@ #define TR_FLASH_BOOTLOADER "Flash BootLoader" #define TR_FLASH_EXTERNAL_DEVICE "Flash External Device" #define TR_FLASH_RECEIVER_OTA "Flash receiver OTA" +#define TR_FLASH_BLUETOOTH_MODULE "Flash Bluetooth module" #define TR_CURRENT_VERSION TR("Current vers. ", "Current version: ") #define TR_FLASH_INTERNAL_MODULE "Flash Internal Module" #define TR_FLASH_EXTERNAL_MODULE "Flash external module" diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 92fb73cba..be8914bc0 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -938,6 +938,7 @@ #define TR_FLASH_BOOTLOADER "Flash BootLoader" #define TR_FLASH_EXTERNAL_DEVICE "Flash External Device" #define TR_FLASH_RECEIVER_OTA "Flash receiver OTA" +#define TR_FLASH_BLUETOOTH_MODULE "Flash Bluetooth module" #define TR_CURRENT_VERSION TR("Current vers. ", "Current version: ") #define TR_FLASH_INTERNAL_MODULE "Flash Internal Module" #define TR_FLASH_EXTERNAL_MODULE "Flash external module" diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index edcc99c79..c05c1b28a 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -950,6 +950,7 @@ #define TR_FLASH_BOOTLOADER "Flasher BootLoader" #define TR_FLASH_EXTERNAL_DEVICE TR("Flasher S.Port", "Flasher S.Port externe") #define TR_FLASH_RECEIVER_OTA "Flash receiver OTA" +#define TR_FLASH_BLUETOOTH_MODULE "Flash Bluetooth module" #define TR_CURRENT_VERSION "Version courante :" #define TR_FLASH_INTERNAL_MODULE TR("Flasher module int.", "Flasher module interne") #define TR_FLASH_EXTERNAL_MODULE TR("Flasher module ext.", "Flasher module externe") diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index fcf4068a6..446d1e707 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -940,6 +940,7 @@ #define TR_FLASH_BOOTLOADER "Flash BootLoader" #define TR_FLASH_EXTERNAL_DEVICE "Progr. Dispositivo Esterno" #define TR_FLASH_RECEIVER_OTA "Flash receiver OTA" +#define TR_FLASH_BLUETOOTH_MODULE "Flash Bluetooth module" #define TR_CURRENT_VERSION TR("Current vers. ", "Current version: ") #define TR_FLASH_INTERNAL_MODULE "Progr. Modulo Interno" #define TR_FLASH_EXTERNAL_MODULE "Flash external module" diff --git a/radio/src/translations/nl.h.txt b/radio/src/translations/nl.h.txt index 0a3f4b6d8..d799ebcec 100644 --- a/radio/src/translations/nl.h.txt +++ b/radio/src/translations/nl.h.txt @@ -941,6 +941,7 @@ TR_GYR_VSRCRAW #define TR_FLASH_BOOTLOADER "Flash BootLoader" #define TR_FLASH_EXTERNAL_DEVICE "Flash extern Apparaat" #define TR_FLASH_RECEIVER_OTA "Flash receiver OTA" +#define TR_FLASH_BLUETOOTH_MODULE "Flash Bluetooth module" #define TR_CURRENT_VERSION TR("Current vers. ", "Current version: ") #define TR_FLASH_INTERNAL_MODULE "Flash interne XJT-Module" #define TR_FLASH_EXTERNAL_MODULE "Flash external module" diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 450b12367..0db7f8d24 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -941,6 +941,7 @@ #define TR_FLASH_BOOTLOADER "Flash BootLoader" #define TR_FLASH_EXTERNAL_DEVICE "Sflashuj Moduł Zewnętrzny" #define TR_FLASH_RECEIVER_OTA "Flash receiver OTA" +#define TR_FLASH_BLUETOOTH_MODULE "Flash Bluetooth module" #define TR_CURRENT_VERSION TR("Current vers. ", "Current version: ") #define TR_FLASH_INTERNAL_MODULE "Sflashuj Moduł Wewnętrzny" #define TR_FLASH_EXTERNAL_MODULE "Flash external module" diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index 5879d392e..6ddf9bc61 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -945,6 +945,7 @@ #define TR_FLASH_BOOTLOADER "Flash BootLoader" #define TR_FLASH_EXTERNAL_DEVICE "Flash External Device" #define TR_FLASH_RECEIVER_OTA "Flash receiver OTA" +#define TR_FLASH_BLUETOOTH_MODULE "Flash Bluetooth module" #define TR_CURRENT_VERSION TR("Current vers. ", "Current version: ") #define TR_FLASH_INTERNAL_MODULE "Flash Internal Module" #define TR_FLASH_EXTERNAL_MODULE "Flash external module" diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 355517554..621681810 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -954,6 +954,7 @@ #define TR_FLASH_BOOTLOADER "Skriv BootLoader" #define TR_FLASH_EXTERNAL_DEVICE "Flash External Device" #define TR_FLASH_RECEIVER_OTA "Flash receiver OTA" +#define TR_FLASH_BLUETOOTH_MODULE "Flash Bluetooth module" #define TR_CURRENT_VERSION TR("Current vers. ", "Current version: ") #define TR_FLASH_INTERNAL_MODULE "Flash Internal Module" #define TR_FLASH_EXTERNAL_MODULE "Flash external module"