diff --git a/radio/src/bluetooth.cpp b/radio/src/bluetooth.cpp index f268b180a..ebcd4fa4c 100644 --- a/radio/src/bluetooth.cpp +++ b/radio/src/bluetooth.cpp @@ -311,12 +311,12 @@ void Bluetooth::wakeup(void) uint8_t len = ZLEN(g_eeGeneral.bluetoothName); if (len > 0) { for (int i = 0; i < len; i++) { - *cur++ = zchar2char(g_eeGeneral.bluetoothName[i]); + *cur++ = char2lower(zchar2char(g_eeGeneral.bluetoothName[i])); } *cur = '\0'; } else { - cur = strAppend(cur, "Taranis-X9E"); + cur = strAppend(cur, FLAVOUR); } writeString(command); state = BLUETOOTH_WAIT_TTM; @@ -414,16 +414,12 @@ void Bluetooth::wakeup() uint8_t len = ZLEN(g_eeGeneral.bluetoothName); if (len > 0) { for (int i = 0; i < len; i++) { - *cur++ = zchar2char(g_eeGeneral.bluetoothName[i]); + *cur++ = char2lower(zchar2char(g_eeGeneral.bluetoothName[i])); } *cur = '\0'; } else { -#if defined(PCBHORUS) - cur = strAppend(cur, "Horus"); -#else - cur = strAppend(cur, "Taranis"); -#endif + cur = strAppend(cur, FLAVOUR); } writeString(command); state = BLUETOOTH_STATE_NAME_SENT; diff --git a/radio/src/opentx.h b/radio/src/opentx.h index da3487f9c..f45e254a6 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -433,6 +433,7 @@ extern struct t_inactivity inactivity; char hex2zchar(uint8_t hex); char zchar2char(int8_t idx); +char char2lower(char c); int8_t char2zchar(char c); void str2zchar(char *dest, const char *src, int size); int zchar2str(char *dest, const char *src, int size); diff --git a/radio/src/strhelpers.cpp b/radio/src/strhelpers.cpp index c9a595248..453cb7f91 100644 --- a/radio/src/strhelpers.cpp +++ b/radio/src/strhelpers.cpp @@ -44,6 +44,15 @@ char zchar2char(int8_t idx) return ' '; } +char char2lower(char c) +{ + if(c >= 'A' && c <= 'Z'){ + return c+32; + } + else + return c; +} + int8_t char2zchar(char c) { if (c == '_') return 37;