Firmware support or user instructions for jdy-33 #3944
This commit is contained in:
parent
f91a555139
commit
22eb5a8073
|
@ -239,12 +239,18 @@ void bluetoothStart(SerialTsChannelBase *btChan, bluetooth_module_e moduleType,
|
||||||
chsnprintf(cmdName, sizeof(cmdName), "AT+NAME%s", name);
|
chsnprintf(cmdName, sizeof(cmdName), "AT+NAME%s", name);
|
||||||
chsnprintf(cmdPin, sizeof(cmdPin), "AT+PIN%s", pinCode);
|
chsnprintf(cmdPin, sizeof(cmdPin), "AT+PIN%s", pinCode);
|
||||||
break;
|
break;
|
||||||
case BLUETOOTH_SPP:
|
case BLUETOOTH_BK3231:
|
||||||
chsnprintf(cmdHello, sizeof(cmdHello), "AT\r\n");
|
chsnprintf(cmdHello, sizeof(cmdHello), "AT\r\n");
|
||||||
chsnprintf(cmdBaud, sizeof(cmdBaud), "AT+BAUD%c\r\n", '0' + setBaudIdx);
|
chsnprintf(cmdBaud, sizeof(cmdBaud), "AT+BAUD%c\r\n", '0' + setBaudIdx);
|
||||||
chsnprintf(cmdName, sizeof(cmdName), "AT+NAME%s\r\n", name);
|
chsnprintf(cmdName, sizeof(cmdName), "AT+NAME%s\r\n", name);
|
||||||
chsnprintf(cmdPin, sizeof(cmdPin), "AT+PIN%s\r\n", pinCode);
|
chsnprintf(cmdPin, sizeof(cmdPin), "AT+PIN%s\r\n", pinCode);
|
||||||
break;
|
break;
|
||||||
|
case BLUETOOTH_JDY_3x:
|
||||||
|
chsnprintf(cmdHello, sizeof(cmdHello), "AT+VERSION\r\n");
|
||||||
|
chsnprintf(cmdBaud, sizeof(cmdBaud), "AT+BAUD%c\r\n", '0' + setBaudIdx);
|
||||||
|
chsnprintf(cmdName, sizeof(cmdName), "AT+NAME%s\r\n", name);
|
||||||
|
chsnprintf(cmdPin, sizeof(cmdPin), "AT+PIN%s\r\n", pinCode);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// todo: add support for other BT module types
|
// todo: add support for other BT module types
|
||||||
efiPrintf("This Bluetooth module is currently not supported!");
|
efiPrintf("This Bluetooth module is currently not supported!");
|
||||||
|
|
|
@ -21,7 +21,11 @@
|
||||||
typedef enum {
|
typedef enum {
|
||||||
BLUETOOTH_HC_05,
|
BLUETOOTH_HC_05,
|
||||||
BLUETOOTH_HC_06,
|
BLUETOOTH_HC_06,
|
||||||
BLUETOOTH_SPP,
|
/**
|
||||||
|
* See https://rusefi.com/forum/viewtopic.php?f=13&t=1999
|
||||||
|
*/
|
||||||
|
BLUETOOTH_BK3231,
|
||||||
|
BLUETOOTH_JDY_3x,
|
||||||
} bluetooth_module_e;
|
} bluetooth_module_e;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -134,24 +134,6 @@ static void setTsSpeed(int value) {
|
||||||
printTsStats();
|
printTsStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EFI_BLUETOOTH_SETUP
|
|
||||||
|
|
||||||
// Bluetooth HC-05 module initialization start (it waits for disconnect and then communicates to the module)
|
|
||||||
static void bluetoothHC05(const char *baudRate, const char *name, const char *pinCode) {
|
|
||||||
bluetoothStart(getBluetoothChannel(), BLUETOOTH_HC_05, baudRate, name, pinCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bluetooth HC-06 module initialization start (it waits for disconnect and then communicates to the module)
|
|
||||||
static void bluetoothHC06(const char *baudRate, const char *name, const char *pinCode) {
|
|
||||||
bluetoothStart(getBluetoothChannel(), BLUETOOTH_HC_06, baudRate, name, pinCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bluetooth SPP-C module initialization start (it waits for disconnect and then communicates to the module)
|
|
||||||
static void bluetoothSPP(const char *baudRate, const char *name, const char *pinCode) {
|
|
||||||
bluetoothStart(getBluetoothChannel(), BLUETOOTH_SPP, baudRate, name, pinCode);
|
|
||||||
}
|
|
||||||
#endif /* EFI_BLUETOOTH_SETUP */
|
|
||||||
|
|
||||||
#endif // EFI_TUNER_STUDIO
|
#endif // EFI_TUNER_STUDIO
|
||||||
|
|
||||||
void tunerStudioDebug(TsChannelBase* tsChannel, const char *msg) {
|
void tunerStudioDebug(TsChannelBase* tsChannel, const char *msg) {
|
||||||
|
@ -842,11 +824,22 @@ void startTunerStudioConnectivity(void) {
|
||||||
addConsoleActionI("set_ts_speed", setTsSpeed);
|
addConsoleActionI("set_ts_speed", setTsSpeed);
|
||||||
|
|
||||||
#if EFI_BLUETOOTH_SETUP
|
#if EFI_BLUETOOTH_SETUP
|
||||||
|
// module initialization start (it waits for disconnect and then communicates to the module)
|
||||||
// Usage: "bluetooth_hc06 <baud> <name> <pincode>"
|
// Usage: "bluetooth_hc06 <baud> <name> <pincode>"
|
||||||
// Example: "bluetooth_hc06 38400 rusefi 1234"
|
// Example: "bluetooth_hc06 38400 rusefi 1234"
|
||||||
addConsoleActionSSS("bluetooth_hc05", bluetoothHC05);
|
// bluetooth_jdy 115200 alphax 1234
|
||||||
addConsoleActionSSS("bluetooth_hc06", bluetoothHC06);
|
addConsoleActionSSS("bluetooth_hc05", [](const char *baudRate, const char *name, const char *pinCode) {
|
||||||
addConsoleActionSSS("bluetooth_spp", bluetoothSPP);
|
bluetoothStart(getBluetoothChannel(), BLUETOOTH_HC_05, baudRate, name, pinCode);
|
||||||
|
});
|
||||||
|
addConsoleActionSSS("bluetooth_hc06", [](const char *baudRate, const char *name, const char *pinCode) {
|
||||||
|
bluetoothStart(getBluetoothChannel(), BLUETOOTH_HC_06, baudRate, name, pinCode);
|
||||||
|
});
|
||||||
|
addConsoleActionSSS("bluetooth_bk", [](const char *baudRate, const char *name, const char *pinCode) {
|
||||||
|
bluetoothStart(getBluetoothChannel(), BLUETOOTH_BK3231, baudRate, name, pinCode);
|
||||||
|
});
|
||||||
|
addConsoleActionSSS("bluetooth_jdy", [](const char *baudRate, const char *name, const char *pinCode) {
|
||||||
|
bluetoothStart(getBluetoothChannel(), BLUETOOTH_JDY_3x, baudRate, name, pinCode);
|
||||||
|
});
|
||||||
addConsoleAction("bluetooth_cancel", bluetoothCancel);
|
addConsoleAction("bluetooth_cancel", bluetoothCancel);
|
||||||
#endif /* EFI_BLUETOOTH_SETUP */
|
#endif /* EFI_BLUETOOTH_SETUP */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue