Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ELM327_Emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ ELM327Emu::ELM327Emu()
*/
void ELM327Emu::setup() {
serialBT.begin(settings.btName);
serialBT.setPin(settings.btPin);
}

void ELM327Emu::setWiFiClient(WiFiClient *client)
Expand Down
8 changes: 7 additions & 1 deletion SerialConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ void SerialConsole::printMenu()

Logger::console("BTMODE=%i - Set mode for Bluetooth (0 = Off, 1 = On)", settings.enableBT);
Logger::console("BTNAME=%s - Set advertised Bluetooth name", settings.btName);
Logger::console("BTPIN=%s - Set advertised Bluetooth pin", settings.btName);
Serial.println();

Logger::console("LAWICEL=%i - Set whether to accept LAWICEL commands (0 = Off, 1 = On)", settings.enableLawicel);
Expand Down Expand Up @@ -333,7 +334,11 @@ void SerialConsole::handleConfigCmd()
Logger::console("Setting Bluetooth Mode to %i", newValue);
settings.enableBT = newValue;
writeEEPROM = true;
} else if (cmdString == String("LAWICEL")) {
} else if (cmdString == String("BTPIN")){
Logger::console("Setting Bluetooth Pin to %s", newString);
strcpy((char *)settings.btPin, newString);
writeEEPROM = true;
}else if (cmdString == String("LAWICEL")) {
if (newValue < 0) newValue = 0;
if (newValue > 1) newValue = 1;
Logger::console("Setting LAWICEL Mode to %i", newValue);
Expand Down Expand Up @@ -420,6 +425,7 @@ void SerialConsole::handleConfigCmd()
nvPrefs.putString("SSID", settings.SSID);
nvPrefs.putString("wpa2Key", settings.WPA2Key);
nvPrefs.putString("btname", settings.btName);
nvPrefs.putString("btpin", settings.SSID);
nvPrefs.end();
}
}
Expand Down
1 change: 1 addition & 0 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ struct EEPROMSettings {

boolean enableBT; //are we enabling bluetooth too?
char btName[32];
char btPin[6];

boolean enableLawicel;

Expand Down