void ELM327::sendCommand(const char *cmd) Description: ------------ * Sends a command/query for Non-Blocking PID queries Inputs: ------- * const char *cmd - Command/query to send to ELM327 Return: ------- * void */
| 2373 | * void |
| 2374 | */ |
| 2375 | void ELM327::sendCommand(const char *cmd) |
| 2376 | { |
| 2377 | // clear payload buffer |
| 2378 | memset(payload, '\0', PAYLOAD_LEN + 1); |
| 2379 | |
| 2380 | // reset input serial buffer and number of received bytes |
| 2381 | recBytes = 0; |
| 2382 | flushInputBuff(); |
| 2383 | connected = false; |
| 2384 | |
| 2385 | // Reset the receive state ready to start receiving a response message |
| 2386 | nb_rx_state = ELM_GETTING_MSG; |
| 2387 | |
| 2388 | if (debugMode) |
| 2389 | { |
| 2390 | Serial.print(F("Sending the following command/query: ")); |
| 2391 | Serial.println(cmd); |
| 2392 | } |
| 2393 | |
| 2394 | elm_port->print(cmd); |
| 2395 | elm_port->print('\r'); |
| 2396 | |
| 2397 | // prime the timeout timer |
| 2398 | previousTime = millis(); |
| 2399 | currentTime = previousTime; |
| 2400 | } |
| 2401 | |
| 2402 | /* |
| 2403 | obd_rx_states ELM327::sendCommand_Blocking(const char* cmd) |
nothing calls this directly
no outgoing calls
no test coverage detected