- str
- Documentation for this section has not yet been entered.
Use this method when you want to write a string as output to a serial port.
If there are too many bytes in the output buffer and SerialPort.Handshake is set to Handshake.XOnXOff then the System.IO.Ports.SerialPort object may raise a System.ServiceProcess.TimeoutException while it waits for the device to be ready to accept more data.
By default, System.IO.Ports.SerialPort uses System.Text.ASCIIEncoding to encode the characters. System.Text.ASCIIEncoding encodes all characters greater than 127 as (char)63 or '?'. To support additional characters in that range, set SerialPort.Encoding to System.Text.UTF8Encoding, System.Text.UTF32Encoding, or System.Text.UnicodeEncoding.