Merge pull request #26 from jwetzell/fix/slip-framer

fix incorrect slip frame encoding
This commit is contained in:
Joel Wetzell
2025-12-24 19:15:17 -06:00
committed by GitHub

View File

@@ -59,9 +59,9 @@ func (sf *SlipFramer) Encode(data []byte) []byte {
for _, byteToEncode := range data {
switch byteToEncode {
case END:
encodedBytes = append(encodedBytes, ESC_END)
encodedBytes = append(encodedBytes, ESC, ESC_END)
case ESC:
encodedBytes = append(encodedBytes, ESC_ESC)
encodedBytes = append(encodedBytes, ESC, ESC_ESC)
default:
encodedBytes = append(encodedBytes, byteToEncode)
}