rxtime or rxcheck question
steprog
Posts: 227
Hi Guys,
Does rxtime or rxcheck corrupt the incoming string if you use it?
Thanks,
Greg
Does rxtime or rxcheck corrupt the incoming string if you use it?
Thanks,
Greg
Comments
What does your code look like?
getstr(@command)
if strcomp(@Reset, @command)
do stuff
From what your telling me my string compare won't work too well.
Let's say you receive the string "fred\n" ('\n' being the end of the line/string). Depending on timing MsgTest will either be -1 (timeout) or 'f'. Then getstr will assemble the string "fred" or "red". So in case you didn't get the timeout you want to recover the missing/consumed character.
Thanks for the help.
Greg
getstr looks like one of your methods, so why don't you pass in an extra parameter (i.e. MsgTest) which when -1 is ignored otherwise inserted into the buffer before the serial device is read again?
I'd help you but I'd need to see more code in order to do so. An example would be ...
Greg
Andy