M
Malc
Hi, when I try and open the Bluetooth serial port using Compact Framework
2.0's System.IO.Ports library I get an IOException, however the same code
works fine with the regular serial port. Anyone know a solution?
outPort = new SerialPort("COM8:", 4800, Parity.None, 8,StopBits.One);
outPort.Handshake = Handshake.None;
outPort.Encoding = Encoding.ASCII;
outPort.ReceivedBytesThreshold = 7;
outPort.ReadBufferSize = 7;
outPort.WriteBufferSize = 8;
outPort.ReceivedEvent+=new
SerialReceivedEventHandler(outPort_ReceivedEvent);
try
{
outPort.Open();
}
catch (Exception e) { Console.WriteLine(e.Message);}
This occurs on a iPAQ 5550 and 4150, and the exception occurs after the
Bluetooth browser pops up and I choose the device providing the serial
service. Note it works fine when I do the same thing using
OpenNetCF.IO.Serial. The reason for trying CF 2.0 is OpenNetCF serial
stutters on Bluetooth connections. I mean sometimes it just pauses and no
data received events are thrown for a while. Then when it continues the
data has been buffered and the application lags behind with old data. The
solution was to increase the priority of OpenNetCF's internal data
received thread, but if someone knows how to get past the IOException
under CF 2.0 that would be great.
2.0's System.IO.Ports library I get an IOException, however the same code
works fine with the regular serial port. Anyone know a solution?
outPort = new SerialPort("COM8:", 4800, Parity.None, 8,StopBits.One);
outPort.Handshake = Handshake.None;
outPort.Encoding = Encoding.ASCII;
outPort.ReceivedBytesThreshold = 7;
outPort.ReadBufferSize = 7;
outPort.WriteBufferSize = 8;
outPort.ReceivedEvent+=new
SerialReceivedEventHandler(outPort_ReceivedEvent);
try
{
outPort.Open();
}
catch (Exception e) { Console.WriteLine(e.Message);}
This occurs on a iPAQ 5550 and 4150, and the exception occurs after the
Bluetooth browser pops up and I choose the device providing the serial
service. Note it works fine when I do the same thing using
OpenNetCF.IO.Serial. The reason for trying CF 2.0 is OpenNetCF serial
stutters on Bluetooth connections. I mean sometimes it just pauses and no
data received events are thrown for a while. Then when it continues the
data has been buffered and the application lags behind with old data. The
solution was to increase the priority of OpenNetCF's internal data
received thread, but if someone knows how to get past the IOException
under CF 2.0 that would be great.