irides
Posts: 2
Joined: Mon May 05, 2008 7:25 pm

The new problem

Tue May 06, 2008 6:16 pm

I run Example1 on my phone with windows mobile 5, set baudrate to 9600. When I use the method write(), it returns zero! The OnWritten can return the correct number that has been written. Of course I receive nothing on another phone.
Urgent for your help!
mail:yangxh@sdu.edu.cn
Yangxh
The code listed below:
port_list = SerialNET.Port.List;
SerialNET.License license = new SerialNET.License();
license.LicenseKey = "eNZd1eYJlQcUC7L2gadUzaget2fuow7PeRag";

port = new SerialNET.Port();
port.Parent = this;

port.ComPort = 2;
// port.Timeout = 5000;

port.DTR = false;
port.RTS = false;
port.BaudRate = 9600;

<font color="red">port.InfraRed = true;</font id="red">

port.OnRead += new SerialNET.OnRead(port_OnRead);
port.OnWritten += new SerialNET.OnWritten(port_OnWritten);
port.OnForceClose += new SerialNET.OnForceClose(port_OnForceClose);
port.Enabled = true;
MessageBox.Show("Port opened!");

txtRead.Text=port.Write(txtWrite.Text).ToString();
txtRead.Update();

Return to “SerialTools”