Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/02/01 06:43
Read: times


 
#13743 - detecting -1
I have a problem detecting -1.
I'm reading characters from serial port using in c written routine which returns -1 value if buffer is empty. Everthing works fine if i just receiving the ascii characters, but must receiving hex characters too, like 0xFF. I would like to know if i'm working right.

receving a char
c = com_getchar();
i = c&0xFF;
if (i!=-1) then displaychar(c);


thanks

List of 6 messages in thread
TopicAuthorDate
detecting -1            01/01/70 00:00      
RE: detecting -1            01/01/70 00:00      
RE: detecting -1            01/01/70 00:00      
RE: detecting -1            01/01/70 00:00      
RE: detecting -1            01/01/70 00:00      
RE: detecting -1            01/01/70 00:00      

Back to Subject List