mirror of
https://github.com/opentx/opentx.git
synced 2025-07-16 12:55:12 +03:00
Bsongis/x7 bluetooth (#5068)
* Trainer Bluetooth support added X7S board added (X7 has no bluetooth while X7S has) X10 HAL updated * Bluetooth Telemetry * En fix Add all languages * Temporary test for @bsongis * Missing translations
This commit is contained in:
parent
51be7b000e
commit
8d8fef23c9
51 changed files with 972 additions and 636 deletions
|
@ -858,11 +858,6 @@ void printTaskSwitchLog()
|
|||
else if (audioTaskId == n) {
|
||||
serialPrint("%d: audio", n);
|
||||
}
|
||||
#if defined(BLUETOOTH)
|
||||
else if (btTaskId == n) {
|
||||
serialPrint("%d: BT", n);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
serialCrlf();
|
||||
|
||||
|
@ -1181,7 +1176,7 @@ int cliShowJitter(const char ** argv)
|
|||
int cliGps(const char ** argv)
|
||||
{
|
||||
int baudrate = 0;
|
||||
|
||||
|
||||
if (argv[1][0] == '$') {
|
||||
// send command to GPS
|
||||
gpsSendFrame(argv[1]);
|
||||
|
@ -1206,23 +1201,10 @@ int cliGps(const char ** argv)
|
|||
int cliBlueTooth(const char ** argv)
|
||||
{
|
||||
int baudrate = 0;
|
||||
if (argv[1][0] == '$') {
|
||||
// send command to GPS
|
||||
bluetoothWriteString(argv[1] + 1);
|
||||
bluetoothWriteString("\r\n");
|
||||
serialPrint("bt sent: %s", argv[1] + 1);
|
||||
CoTickDelay(100); // 200ms
|
||||
char buff[100];
|
||||
int len = bluetoothRead(buff, 100);
|
||||
buff[len] = 0;
|
||||
serialPrint("bt read: %s", buff);
|
||||
|
||||
}
|
||||
else if (!strcmp(argv[1], "read")) {
|
||||
char buff[100];
|
||||
int len = bluetoothRead(buff, 100);
|
||||
buff[len] = 0;
|
||||
serialPrint("bt read: %s", buff);
|
||||
if (!strncmp(argv[1], "AT", 2) || !strncmp(argv[1], "TTM", 3)) {
|
||||
char command[32];
|
||||
strAppend(strAppend(command, argv[1]), "\r\n");
|
||||
bluetoothWriteString(command);
|
||||
}
|
||||
else if (toInt(argv, 1, &baudrate) > 0) {
|
||||
if (baudrate > 0) {
|
||||
|
@ -1239,7 +1221,7 @@ int cliBlueTooth(const char ** argv)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
#endif // #if defined(PCBX9E) || defined(PCBHORUS)
|
||||
#endif
|
||||
|
||||
const CliCommand cliCommands[] = {
|
||||
{ "beep", cliBeep, "[<frequency>] [<duration>]" },
|
||||
|
@ -1270,7 +1252,7 @@ const CliCommand cliCommands[] = {
|
|||
{ "gps", cliGps, "<baudrate>|$<command>|trace" },
|
||||
#endif
|
||||
#if defined(BLUETOOTH)
|
||||
{ "bt", cliBlueTooth, "<baudrate>|$<command>|read" },
|
||||
{ "bt", cliBlueTooth, "<baudrate>|<command>" },
|
||||
#endif
|
||||
{ NULL, NULL, NULL } /* sentinel */
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue