diff --git a/src/ELMduino.cpp b/src/ELMduino.cpp index f0f41b9..825b1ea 100644 --- a/src/ELMduino.cpp +++ b/src/ELMduino.cpp @@ -2689,7 +2689,7 @@ void ELM327::currentDTCCodes(const bool &isBlocking) // Each response line will start with "43" indicating it is a response to a Mode 03 request. // See p. 31 of ELM327 datasheet for details and lookup table of code types. - uint codesFound = strlen(payload) / 8; // Each code found returns 8 chars starting with "43" + uint8_t codesFound = strlen(payload) / 8; // Each code found returns 8 chars starting with "43" idx = strstr(payload, "43") + 4; // Pointer to first DTC code digit (third char in the response) if (codesFound > DTC_MAX_CODES) // I don't think the ELM is capable of returning diff --git a/src/ELMduino.h b/src/ELMduino.h index 4b9f8da..8040dc1 100644 --- a/src/ELMduino.h +++ b/src/ELMduino.h @@ -271,8 +271,8 @@ const int8_t ELM_TIMEOUT = 7; const int8_t ELM_GETTING_MSG = 8; const int8_t ELM_MSG_RXD = 9; const int8_t ELM_GENERAL_ERROR = -1; -const int8_t DTC_CODE_LEN = 6; -const int8_t DTC_MAX_CODES = 16; +const uint8_t DTC_CODE_LEN = 6; +const uint8_t DTC_MAX_CODES = 16; // Non-blocking (NB) command states typedef enum { SEND_COMMAND, @@ -308,7 +308,7 @@ class ELM327 byte responseByte_7; struct dtcResponse { - uint codesFound = 0; + uint8_t codesFound = 0; char codes[DTC_MAX_CODES][DTC_CODE_LEN]; } DTC_Response;