I have a little windows form App which I'm using to send texts out to Customers using AT Commands, However we need a way to see the texts the customers will be sending back to us, I've already attempted to read data from the virtual Serial port I'm using and place that information in a text box, but this code is non-functional; I click the button on my form and nothing happens.
code is below, and any help whatsoever would be greatly appreciated.
public partial class MailBox : Form
{
public MailBox()
{
InitializeComponent();
}
private SerialPort _serialPort2 = new SerialPort("COM5", 115200);
private void MailBox_Load(object sender, EventArgs e)
{
_serialPort2.Open();
_serialPort2.Write("AT+CMGR=1\r");
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = _serialPort2.ReadExisting();
// _serialPort2.Close();
// _serialPort2.DataReceived += new SerialDataReceivedEventHandler(_serialPort2_DataReceived);
}