bakercp / PacketSerial

An Arduino Library that facilitates packet-based serial communication using COBS or SLIP encoding.
http://bakercp.github.io/PacketSerial/
MIT License
277 stars 59 forks source link

SLIPPacketSerial send() gives me two 0xc0 as the end of packet #11

Closed latonita closed 7 years ago

latonita commented 7 years ago

I simply do slip.send(buff*,size) and it gives me nice slip packet, but with two 0xc0 in the end instead of one. this makes stream desynchronized and i loose packets on receiving side

I suppose it shall be only one 0xc0 in the end.

what i get: [0xc0,data,0xc0,0xc0][0xc0,data,0xc0,0xc0]...

what i expect: [0xc0,data,0xc0][0xc0,data,0xc0]...

thanks

bakercp commented 7 years ago

Hey there, thanks for the report -- can you test this pull request to see if it fixes the issue? I haven't had a chance to test it. If it works, we should just merge it!

https://github.com/bakercp/PacketSerial/pull/7

latonita commented 7 years ago

@bakercp please review and merge my fix #12

bakercp commented 7 years ago

I'm checking it out now. Thanks!

bakercp commented 7 years ago

I believe everything should be in order now. Please check out the latest release.

Thanks for your contribution.