Skip to content

Compiler warning #56

@stumunro74

Description

@stumunro74

Describe the bug
Compiler warning when enabled.

C:\Users\Stuart\Documents\Arduino\libraries\ELMDuino\src\ELMduino.cpp: In member function 'bool ELM327::initializeELM(char)':
C:\Users\Stuart\Documents\Arduino\libraries\ELMDuino\src\ELMduino.cpp:116:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (sendCommand(command) == ELM_SUCCESS)
     ^~
C:\Users\Stuart\Documents\Arduino\libraries\ELMDuino\src\ELMduino.cpp:120:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  return connected;
  ^~~~~~

To Reproduce
Enable compiler warnings.

Expected behavior
No compiler warnings.

Code

    if (sendCommand(command) == ELM_SUCCESS)
        if (strstr(payload, "OK") != NULL)
            connected = true;

	return connected;

Troubleshooting Connection Issues

  • Try 38400 baud instead of 115200
  • If using an HC-05 for communication, ensure it's configured properly
  • Ensure the car is on and running during troubleshooting

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions