Hi,
This may be a trivial question, but I could not find a straightforward
answer. I am using the OpenNETCF.IO.Serial library for serial
communication. All I need to do is listen for any incoming data.
However, when I send data to the device's serial port a dialog box pops
up that says "Desktop @19200 Status" and no data ever makes it to my
application. What is this dialog box? Does it have something to do
with AciveSync? I don't use ActiveSync to debug so I could remove it
from the CE image if necessary.
Thanks for your help.
Here is a code snippet (mostly from the OpenNETCF example):
public CScale()
{
portSettings = new HandshakeNone();
portSettings.BasicSettings.BaudRate = BaudRates.CBR_9600;
portSettings.BasicSettings.Parity = Parity.none;
portSettings.BasicSettings.StopBits = StopBits.one;
port = new Port("COM1:",portSettings);
port.RThreshold = 1; //event for every byte
// define an event handler
port.DataReceived +=new Port.CommEvent(port_DataReceived);
}
private void port_DataReceived()
{
// since RThreshold = 1, we get an event for every character
byte[] inputData = new byte[1];
// read the character
inputData = port.Input;
// display as text
System.Text.Encoding enc = System.Text.Encoding.ASCII;
data = enc.GetString(inputData, 0, inputData.Length);
}