T
Tomppa
I've got an RS232 device that gives me data via hyperterminal but no data
comes acorss using my class below.
My hyperterm settings are as follows and appear to be the same as my
class?????
COM1
Bits per second 57600
Data bits 8
Parity None
Stop bits 1
Flow control None
I am able to open the port and it shows open but no data.
Any Ideas??????
I get the same results from my desktop framework or my embedded device in
the CF2.0
I tested it in VB6 using the MScomm ocx and it did recieve data. I
obviously cannot use this ocx in WinCE though.
public class RS232Device
{
private SerialPort port = new SerialPort("COM1", 57600, Parity.None, 8,
StopBits.One);
public RS232Device()
{
port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
port.Handshake = Handshake.None;
port.ReceivedBytesThreshold = 1;
}
public bool Open()
{
bool ret = false;
port.Open();
if (port.IsOpen)
{
ret = true;
}
return ret;
}
public void Close()
{
if (port.IsOpen)
{
port.Close();
}
}
void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
Debug.WriteLine(port.ReadExisting());
}
}
comes acorss using my class below.
My hyperterm settings are as follows and appear to be the same as my
class?????
COM1
Bits per second 57600
Data bits 8
Parity None
Stop bits 1
Flow control None
I am able to open the port and it shows open but no data.
Any Ideas??????
I get the same results from my desktop framework or my embedded device in
the CF2.0
I tested it in VB6 using the MScomm ocx and it did recieve data. I
obviously cannot use this ocx in WinCE though.
public class RS232Device
{
private SerialPort port = new SerialPort("COM1", 57600, Parity.None, 8,
StopBits.One);
public RS232Device()
{
port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
port.Handshake = Handshake.None;
port.ReceivedBytesThreshold = 1;
}
public bool Open()
{
bool ret = false;
port.Open();
if (port.IsOpen)
{
ret = true;
}
return ret;
}
public void Close()
{
if (port.IsOpen)
{
port.Close();
}
}
void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
Debug.WriteLine(port.ReadExisting());
}
}