commConnected
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user