This commit is contained in:
Lubos Petrovic
2020-12-20 17:14:56 +01:00
parent 5f1fd5350e
commit 09440f686b
2 changed files with 25 additions and 22 deletions

View File

@@ -332,7 +332,7 @@ void CommObd2Ble4::mainLoop() {
board->displayMessage(" > Processing init AT cmds", "");
// Serve first command (ATZ)
doNextAtCommand();
doNextQueueCommand();
} else {
Serial.println("We have failed to connect to the server; there is nothing more we will do.");

View File

@@ -11,18 +11,21 @@ void CommObd2Can::connectDevice() {
Serial.println("CAN connectDevice");
// Initialize MCP2515 running at 16MHz with a baudrate of 500kb/s and the masks and filters disabled.
/* if (CAN.begin(MCP_STDEXT, CAN_500KBPS, MCP_8MHZ) == CAN_OK) {
Serial.println("MCP2515 Initialized Successfully!");
board->displayMessage(" > CAN init OK", "");
} else {
Serial.println("Error Initializing MCP2515...");
board->displayMessage(" > CAN init failed", "");
return;
}
/* if (CAN.begin(MCP_STDEXT, CAN_500KBPS, MCP_8MHZ) == CAN_OK) {
Serial.println("MCP2515 Initialized Successfully!");
board->displayMessage(" > CAN init OK", "");
} else {
Serial.println("Error Initializing MCP2515...");
board->displayMessage(" > CAN init failed", "");
return;
}
CAN.setMode(MCP_NORMAL); // Set operation mode to normal so the MCP2515 sends acks to received data.
pinMode(pinCanInt, INPUT); // Configuring pin for /INT input
*/
CAN.setMode(MCP_NORMAL); // Set operation mode to normal so the MCP2515 sends acks to received data.
pinMode(pinCanInt, INPUT); // Configuring pin for /INT input
// Serve first command (ATZ)
doNextQueueCommand();
*/
Serial.println("init_can() done");
}
@@ -51,16 +54,16 @@ void CommObd2Can::mainLoop() {
}
/**
* Send command to CAN bus
*/
void executeCommand(String cmd) {
Send command to CAN bus
*/
void CommObd2Can::executeCommand(String cmd) {
/**
* Serial.println("BMS 220101");
sendPID(0x00, 0x00);
delay(delayTxRx);
byte b = receivePID(0);
if (b == 0x10) {
Serial.println("BMS 220101");
sendPID(0x00, 0x00);
delay(delayTxRx);
byte b = receivePID(0);
if (b == 0x10) {
Serial.println("CONTINUE");
sendPID(0x01, 0x00);
delay(10);
@@ -68,5 +71,5 @@ void executeCommand(String cmd) {
receivePID(0);
delay(10);
}
}*/
}*/
}