Click here to Skip to main content
15,919,479 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Is escape bytes a must or not for a serial communication protocol? I am asking this question because I heard from many people that there is no way to implement a serious serial protocol without escaping.

What I have tried:

Nothing. Just some thoughts for now!!!!!!
Posted
Updated 19-Sep-23 11:06am
v2
Comments
OriginalGriff 16-Sep-23 11:35am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with - we get no other context for your project.
Imagine this: you go for a drive in the country, but you have a problem with the car. You call the garage, say "it broke" and turn off your phone. How long will you be waiting before the garage arrives with the right bits and tools to fix the car given they don't know what make or model it is, who you are, what happened when it all went wrong, or even where you are?

That's what you've done here. So stop typing as little as possible and try explaining things to people who have no way to access your project!

Use the "Improve question" widget to edit your question and provide better information.
Richard MacCutchan 16-Sep-23 11:39am    
It all depends on what you mean by "escaping".
[no name] 16-Sep-23 12:27pm    
Serial communications in a vacuum is pointless; you should decide what you plan to communicate with and go from there. There's usually a "manual" and "examples".

Serial over COM ports is just sending a stream of bytes. You have to come up with your own communication protocol, defining what those bytes mean and when on your won. Whether or not you have to escape anything is entirely up to the protocol you come up with.

WARNING: Coming up with this is not as easy as it sounds. People tend to design their code, and other things, based on everything working 100% of the time, completely forgetting that communication and data is not 100% accurate 100% of the time. Whether you succeed or not at this is going to be determined by how your communication code handles errors in the protocol and data and recovers from it.
 
Share this answer
 
v2
Quote:
Is escape bytes a must or not for a serial communication protocol ?

As us, the question barely make sense.
You need to know that 'Serial' is an interface, an extremely simple one, mostly naked, no feature other than a reasonable effort to make it reliable if correct programming is supervising it.

You are responsible of choosing a communication protocol other Serial Interface.
The fact that the protocol use escaping chars is secondary.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900