mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
Merge pull request #26 from jwetzell/fix/slip-framer
fix incorrect slip frame encoding
This commit is contained in:
@@ -59,9 +59,9 @@ func (sf *SlipFramer) Encode(data []byte) []byte {
|
|||||||
for _, byteToEncode := range data {
|
for _, byteToEncode := range data {
|
||||||
switch byteToEncode {
|
switch byteToEncode {
|
||||||
case END:
|
case END:
|
||||||
encodedBytes = append(encodedBytes, ESC_END)
|
encodedBytes = append(encodedBytes, ESC, ESC_END)
|
||||||
case ESC:
|
case ESC:
|
||||||
encodedBytes = append(encodedBytes, ESC_ESC)
|
encodedBytes = append(encodedBytes, ESC, ESC_ESC)
|
||||||
default:
|
default:
|
||||||
encodedBytes = append(encodedBytes, byteToEncode)
|
encodedBytes = append(encodedBytes, byteToEncode)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user