Skip to content

UART CIRCULAR BUFFER / waitFor does not always detect the string #2

@csann

Description

@csann

I could not get it to detect "hello" at all.

Then I entered your exact string of "1234hell9123456789helloabcdefghih". That worked!

Then I changed the string to this: "1234hel9123456789helloabcdefghih". That does not work.

If I figure out what is wrong, I will update this.

UPDATE:
I found the problem. You have the if (so_far != len) {} block commented out. Removing the comments cause the code to work for every weird string I have used. Also ignore me accidentally changing the title of this issue. Obviously, I am not too versed on GitHub.
UPDATE1:
Similar problem with copyUpto. Had to uncomment line 240.
UPDATE2:
The next function worked well without modification. I also tested the getDataFromBuffer function. It worked however while it did not copy the starting string into the final buffer, it did copy the final string into the final buffer.

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