MCPcopy Create free account
hub / github.com/PowerBroker2/ELMduino / sendCommand_Blocking

Method sendCommand_Blocking

src/ELMduino.cpp:2420–2428  ·  view source on GitHub ↗

obd_rx_states ELM327::sendCommand_Blocking(const char* cmd) Description: ------------ * Sends a command/query and waits for a respoonse (blocking function) Sometimes it's desirable to use a blocking command, e.g when sending an AT command. This function removes the need for the caller to set up a loop waiting for the command to finish. Caller is free to parse the payload

Source from the content-addressed store, hash-verified

2418 * int8_t - the ELM_XXX status of getting the OBD response
2419*/
2420int8_t ELM327::sendCommand_Blocking(const char *cmd)
2421{
2422 sendCommand(cmd);
2423 uint32_t startTime = millis();
2424 while (get_response() == ELM_GETTING_MSG) {
2425 if (millis() - startTime > timeout_ms) break;
2426 }
2427 return nb_rx_state;
2428}
2429
2430/*
2431 obd_rx_states ELM327::get_response(void)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected