Skip to content

Console: a full buffer without an ENDLINE breaks the console #12

@simap

Description

@simap

In ConsoleProcess, if the buffer is completely full, the call to ConsoleIoReceive will return 0 and no command parsing/processing will be done, and the buffer will remain full.

if ( received > 0u )

This can happen if you enter a single line longer than the buffer size (256).

The fix could take several routes with different implications.

The special "buffer full without an ENDLINE" condition could be detected and take of these actions:

  1. Remove the oldest character e.g. with ConsoleResetBuffer(mReceiveBuffer, mReceivedSoFar, 1)
  2. Clear the whole buffer e.g. with ConsoleResetBuffer(mReceiveBuffer, mReceivedSoFar, mReceivedSoFar)
  3. Assume that characters on this line received now and in the future are in a state that is not recoverable, and enter a line purge mode. Emit an error message, then the buffer would be cleared continuously without command processing until an ENDLINE appeared and started a new line, and line purge mode would end and normal processing would continue.

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