commConnected

This commit is contained in:
Lubos Petrovic
2020-12-23 10:35:50 +01:00
parent b660007964
commit a53cccace0
4 changed files with 8 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ class MyClientCallback : public BLEClientCallbacks {
// On BLE disconnect
void onDisconnect(BLEClient* pclient) {
//connected = false;
liveDataObj->commConnected = false;
Serial.println("onDisconnect");
boardObj->displayMessage("BLE disconnected", "");
@@ -323,7 +323,7 @@ void CommObd2Ble4::mainLoop() {
liveData->pServerAddress = new BLEAddress(liveData->settings.obdMacAddress);
if (connectToServer(*liveData->pServerAddress)) {
liveData->bleConnected = true;
liveData->commConnected = true;
liveData->bleConnect = false;
Serial.println("We are now connected to the BLE device.");
@@ -354,7 +354,7 @@ void CommObd2Ble4::mainLoop() {
void CommObd2Ble4::executeCommand(String cmd) {
String tmpStr = cmd + "\r";
if (liveData->bleConnected) {
if (liveData->commConnected) {
liveData->pRemoteCharacteristicWrite->writeValue(tmpStr.c_str(), tmpStr.length());
}
}