Hi...

I want to write and read hex data from serial port..
I have successfully opened serial port and also able to write hex data on serial port,but when i try to read that data it only reads first seven bits and ignore the last bit..

E.g.
Qt Code:
  1. unsigned char a[2] = {0x87,0x0D};
  2. unsigned char b[2] = {0x7F,0x0D};
  3. unsigned char c;
  4.  
  5. write(fd,a or b,sizeof(a or b));
  6. read(fd,&c,sizeof(c));
To copy to clipboard, switch view to plain text mode 

In case of read b,it gives perfect answer hex-0x7F dec-127 bin-01111111
In case of read a,it ignores MSB bit hex-0x87 dec-128 bin-10000000

So my problem is how to read hex data that gives me perfect output without ignoring MSB bit.

Waiting for quick reply..

Thanks..