Skip to content

Add custom end of line #84

@wino45

Description

@wino45

I am using a product that uses the following binary encoding to send packets over serial.
Adding a custom end of line in SimpleUsbTerminal will allow to use the resulting file directly. Today I use 0x0A as and of line. Each packet in the mentioned protocol has a header and 0x0a in this header. So I got a line with part of the packet , and beginning of the header of the next packet.
Adding custom end of the line will allow me to set it 0xBC and I will have a timestamp and the whole packet in a single line. That will be a great improvement !

Packet Coding
=============
SLIP_START     0xAB
SLIP_END       0xBC
SLIP_ESC       0xCD
SLIP_ESC_START 0xAC
SLIP_ESC_END   0xBD
SLIP_ESC_ESC   0xCE

SLIP ENCODING PROCEDURE
Add a SLIP_START to encoded packet
For each byte in unencoded packet, do the following:
 - If the byte is not equal to SLIP_START, SLIP_END, or SLIP_ESC, add it to encoded packet.
 - Otherwise, replace it with a SLIP_ESC followed by the corresponding escaped character.
Finally: add a SLIP_END to encoded packet

Today:

2026-02-28 16:57:57.031 AB 39 00 03 6F 81 02 0A
2026-02-28 16:57:57.031 01 25 38 00 00 D4 AC 59 78 D6 BE 89 8E 42 25 00 1C B7 29 25 7F 3D 1E FF 06 00 01 09 20 22 21 CB 7A 30 82 EB 9D F3 00 81 19 CF 06 63 05 31 0C A9 9D 96 C8 77 31 BD A0 B7 BC AB 39 00 03 70 81 02 0A
2026-02-28 16:57:57.031 01 26 32 00 00 08 AF 59 78 D6 BE 89 8E 42 25 00 1C B7 29 25 7F 3D 1E FF 06 00 01 09 20 22 21 CB 7A 30 82 EB 9D F3 00 81 19 CF 06 63 05 31 0C A9 9D 96 C8 77 31 BD A0 B7 BC AB 39 00 03 71 81 02 0A

after adding the custom end of the line add setting it to 0xBC:

2026-02-28 16:57:57.031 AB 39 00 03 6F 81 02 0A 01 25 38 00 00 D4 AC 59 78 D6 BE 89 8E 42 25 00 1C B7 29 25 7F 3D 1E FF 06 00 01 09 20 22 21 CB 7A 30 82 EB 9D F3 00 81 19 CF 06 63 05 31 0C A9 9D 96 C8 77 31 BD A0 B7 BC 
2026-02-28 16:57:57.031 AB 39 00 03 70 81 02 0A 01 26 32 00 00 08 AF 59 78 D6 BE 89 8E 42 25 00 1C B7 29 25 7F 3D 1E FF 06 00 01 09 20 22 21 CB 7A 30 82 EB 9D F3 00 81 19 CF 06 63 05 31 0C A9 9D 96 C8 77 31 BD A0 B7 BC 

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions