jy**********@gmail.com wrote:
i m trying to send a message packet to a RS232 port.
Which is simply impossible using only the means of the standard C++
language. Neither the language proper nor the library contains any
mechanisms to control hardware. You need to post your query to the
newsgroup that deals with your OS, most likely.
I have created the
handle and set the parameters. Now the general format of the packet is
<STX>command<ETX><LRC>
I have also written the code to calculate <LRC>.
now i dont understand how to make the packet string. should i call
writefile with STX, command , ETX and LRC characters differently or in
a single string. can anyone give me the exact string for a command say
z42. should it be something like "\2z42\3\lrc". Plss help, thanks in
advance
I am not sure what <STX> is (that's not defined in the language either),
but if it's a symbol with the value 1, then you may be better off using
three-digit octal notation: "\002z42\003". If this doesn't help, post
again to the forum that covers your OS. Whatever you think "\lrc" does,
we can't really help you. There is no such escape sequence in C++. The
accepted ones are \a \b \f \n \r \t \v \' \" \? \\. If your compiler
accepts it, there must be an extension to the language that allow that,
and you need to ask about it in the newsgroup that deals with your
compiler.
There is no such thing in C++ as "command say z42".
Read the FAQ, there are some suggestions where to post if your question
is OT here (and it is).
V