RichardFerraro
Well-known member
Hello all,
Any good source code for following ?
I receive a serial char stream from Internet.
There is no way to know what is coming at me.
I want to detect a key, say "hello".
As each character received changes the input buffer,
it seems that converting to stream with each char received might be wasteful.
Thus, it seems working with the char array might be better.
My idea is to insure that the # of chars received is greater than the longest key I am detecting,
then doing a char-by-char comparison.
strstr would require a terminating /0 which the input stream will never have.
thanks,
Richie
Any good source code for following ?
I receive a serial char stream from Internet.
There is no way to know what is coming at me.
I want to detect a key, say "hello".
As each character received changes the input buffer,
it seems that converting to stream with each char received might be wasteful.
Thus, it seems working with the char array might be better.
My idea is to insure that the # of chars received is greater than the longest key I am detecting,
then doing a char-by-char comparison.
strstr would require a terminating /0 which the input stream will never have.
thanks,
Richie