Gostaria de saber se alguem sabe como posso manipular um faxMoldem, neste caso, o meu fax moldem está na "COM3", ja consegui "escutar" o RING dele, mas nao sei outros tipos de comandos, minha intenção é de atender a chamada apos o terceiro toque... veja o que eu ja consegui.
public
partial class Form1 : Form
{
public bool _continue;
public SerialPort _serialPort;
public Thread readThread;
public Form1()
{
InitializeComponent();
}
public void Read()
{
while (_continue)
{
try
{
string message = _serialPort.ReadLine();
//Mostra o que foi lido
MessageBox.Show(message);
}
catch (TimeoutException) { }
}
}
private void button1_Click(object sender, EventArgs e)
{
readThread =
new Thread(Read);
_serialPort =
new SerialPort();
_serialPort.PortName =
"COM3";
_serialPort.BaudRate =
int.Parse("9600");
_serialPort.Parity = (
Parity)Enum.Parse(typeof(Parity), "None");
_serialPort.DataBits =
int.Parse("8");
_serialPort.StopBits = (
StopBits)Enum.Parse(typeof(StopBits), "One");
_serialPort.Handshake = (
Handshake)Enum.Parse(typeof(Handshake), "None");
_serialPort.ReadTimeout = 500;
_serialPort.WriteTimeout = 500;
_serialPort.RtsEnable =
true;
_serialPort.Open();
_continue =
true;
readThread.Start();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
readThread.Abort();
}
}