Skip to content

readChars outputs converted bytes instead of actual chars #118

@bustedbunny

Description

@bustedbunny

Describe the bug
readChars outputs converted bytes instead of actual chars.
spaces end up being "+" and other symbols are converted just like bytes aswell.

How To Reproduce
I reproduce it this way.

  size_t s = req->readChars(buffer, 255);
  buffer[s] = '\0';
  Serial.println(buffer); 

Expected Behavior
I expect to get actual readChars function. same way it works with Stream.readChars() on arduino function. It returns actual characters. If I read serial this way, I get exactly same symbols I type.

Actual Behavior
Using readChars function from this library returns converted bytes into chars. So, instead of spaces I get "+".

ESP32 Module
NodeMCU-32S

Software (please complete the following information if applicable)

  • Arduino IDE 1.8.13
  • OS: Windows 10
  • Chrome

Additional context
Judging by source code of library, there is somewhere a conversion to byte, between actual reading of data and readChars function, that causes this behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions