Skip to content

More compact protocol #3

Description

@mfld-fr

Tune the protocol for a more reliable and efficient data transfer in case of a slow target with a single byte buffer in its serial port (high risk of character lost by the target):

  • Extend immediate value to a stack of two values (full & consistent reverse polish logic)
  • Index of command is the previous immediate value - consumed by the command
  • Remove suffixes to allow any command to end a token and make space optional
  • Define 'X' as token restart (upon token error)
  • Add echo from target to any character from host
  • Except on invalid token when echo is 'X' in place of the faulty character
  • Wait for echo before sending next token character
  • Resend no echoed character after timeout (limit number of tries)
  • Cancel current token whenever echo is 'X'
  • Retry cancelled token (limit number of tries)
  • No more status returned for immediate command
  • Redefine 'Z' as completion event for delayed command

Examples before tuning:

'J0 ' returns '12 Z0 '
'12 K0 ' returns 'Z0 Z0 '
'1234 S 5678 O R R R ' returns 'Z0 Z0 Z0 Z0 AA Z0 BB Z0 CC Z0 '
'1234 S 5678 O AA W BB W CC W ' returns 'Z0 Z0 Z0 Z0 Z0 Z0 Z0 Z0 Z0 Z0 '
'1234 S 5678 O P ' returns 'Z0 Z0 Z0 Z0 Z0 '
'T ' returns 'Z0 Zx '

And after tuning:

'0J' returns '0J12 '
'12 0K' returns '12 0K'
'1234S5678ORRR' returns '1234S5678ORAA RBB RCC ' (-50% from host / -33% from target)
'1234S5678OAAWBBWCCW' returns '1234S5678OAAWBBWCCW' (-40% from host / -50% from target)
'1234S5678OP' returns '1234S5678OP...Z'
'T' returns 'T...xZ''

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions