I'm having a problem with a program that communicates over a serial port. One of the characters it must send and receive is the degree symbol, ASCII 0xBF. It's been working fine for years now suddenly the serial port object has started dropping bit 7, so I get 0x3F instead of 0xBF.
I'm sure that this is something silly I've done because I've tinkered with my code in that area recenlty - however I cannot see what I've done that causes loss of the 8th bit.
My port gets initialized like this:
BaudRate 9600 int
DataBits 8 int
DiscardNull true bool
DtrEnable true bool
Encoding {System.Text.ASCIIEncoding} System.Text.Encoding Handshake None System.IO.Ports.Handshake
NewLine "
" string
Parity None System.IO.Ports.Parity
ParityReplace 63 byte
PortName "COM4" string
ReadBufferSize 128 int
ReadTimeout 250 int
ReceivedBytesThreshold 1 int
RtsEnable true bool
StopBits One System.IO.Ports.StopBits
WriteBufferSize 64 int
WriteTimeout 1500 int
Any ideas how I restore the port to 8-bit operation?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…