Skip to content

Commit

Permalink
Merge pull request #214 from jimwhitelaw/211-update
Browse files Browse the repository at this point in the history
Update for fix for #211
  • Loading branch information
PowerBroker2 authored Jan 5, 2024
2 parents a2d71ba + f501c2e commit 6c584d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/ELMduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ int8_t ELM327::nextIndex(char const *str,
}

/*
void ELM327::conditionResponse(const uint8_t &numExpectedBytes, const float &scaleFactor, const float &bias)
double ELM327::conditionResponse(const uint8_t &numExpectedBytes, const float &scaleFactor, const float &bias)
Description:
------------
Expand All @@ -408,9 +408,9 @@ int8_t ELM327::nextIndex(char const *str,
Return:
-------
* float - Converted numerical value
* double - Converted numerical value
*/
double ELM327::conditionResponse(const uint8_t &numExpectedBytes, const float &scaleFactor, const float &bias)
double ELM327::conditionResponse(const uint8_t &numExpectedBytes, const double &scaleFactor, const float &bias)
{
uint8_t numExpectedPayChars = numExpectedBytes * 2;
uint8_t payCharDiff = numPayChars - numExpectedPayChars;
Expand Down Expand Up @@ -475,7 +475,7 @@ double ELM327::conditionResponse(const uint8_t &numExpectedBytes, const float &s
}
else
{
return ((double)(response >> (4 * payCharDiff)) * scaleFactor) + bias;
return ((response >> (4 * payCharDiff)) * scaleFactor) + bias;
}

}
Expand Down Expand Up @@ -575,7 +575,7 @@ bool ELM327::queryPID(char queryStr[])
}

/*
float ELM327::processPID(const uint8_t& service, const uint16_t& pid, const uint8_t& num_responses, const uint8_t& numExpectedBytes, const float& scaleFactor, const float& bias)
double ELM327::processPID(const uint8_t& service, const uint16_t& pid, const uint8_t& num_responses, const uint8_t& numExpectedBytes, const float& scaleFactor, const float& bias)
Description:
------------
Expand All @@ -597,7 +597,7 @@ bool ELM327::queryPID(char queryStr[])
-------
* float - The PID value if successfully received, else 0.0
*/
double ELM327::processPID(const uint8_t &service, const uint16_t &pid, const uint8_t &num_responses, const uint8_t &numExpectedBytes, const float &scaleFactor, const float &bias)
double ELM327::processPID(const uint8_t &service, const uint16_t &pid, const uint8_t &num_responses, const uint8_t &numExpectedBytes, const double &scaleFactor, const float &bias)
{
if (nb_query_state == SEND_COMMAND)
{
Expand Down
4 changes: 2 additions & 2 deletions src/ELMduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ class ELM327
uint64_t findResponse();
bool queryPID(const uint8_t& service, const uint16_t& pid, const uint8_t& num_responses = 1);
bool queryPID(char queryStr[]);
double processPID(const uint8_t& service, const uint16_t& pid, const uint8_t& num_responses, const uint8_t& numExpectedBytes, const float& scaleFactor = 1, const float& bias = 0);
double processPID(const uint8_t& service, const uint16_t& pid, const uint8_t& num_responses, const uint8_t& numExpectedBytes, const double& scaleFactor = 1, const float& bias = 0);
void sendCommand(const char *cmd);
int8_t sendCommand_Blocking(const char *cmd);
int8_t get_response();
bool timeout();
double conditionResponse(const uint8_t& numExpectedBytes, const float& scaleFactor = 1, const float& bias = 0);
double conditionResponse(const uint8_t& numExpectedBytes, const double& scaleFactor = 1, const float& bias = 0);

float batteryVoltage(void);
int8_t get_vin_blocking(char vin[]);
Expand Down

0 comments on commit 6c584d7

Please sign in to comment.