C:\Users\USER\Documents\Arduino\libraries\OBD9141-master\src\OBD9141.cpp:179:65: error: no matching function for call to 'min(uint8_t&, int)'
for (uint8_t i=0; i < min(answer_length, OBD9141_BUFFER_SIZE); i++){
^
Compiling for arduino 1.8.5 (which I had on my computer, more recent version may be different?) gives;
OBD9141.cpp:179:27: error: 'min' was not declared in this scope
for (uint8_t i=0; i < min<uint8_t>(answer_length, OBD9141_BUFFER_SIZE); i++){
^
OBD9141.cpp:179:38: error: expected primary-expression before '>' token
for (uint8_t i=0; i < min<uint8_t>(answer_length, OBD9141_BUFFER_SIZE); i++){
^
exit status 1
Ultimately, it doesn't matter as the check here enforces that answer_length is always less than or equal to OBD9141_BUFFER_SIZE. So I'm confident we can remove this non-portable min call.
After i had replaced the line 179 ,the compiler completed successfully ,also checked on a vehicle and work correctly with debug mode of course.
Nice work.
The check is enforced by line 171.
This caused an issue in #35;
Compiling for arduino 1.8.5 (which I had on my computer, more recent version may be different?) gives;
Ultimately, it doesn't matter as the check here enforces that
answer_length
is always less than or equal toOBD9141_BUFFER_SIZE
. So I'm confident we can remove this non-portablemin
call.