inputData = (byte)port.ReadByte();
if (inputData.Equals(0xa))
{
idx = 0;
}
else if (inputData.Equals(0xd))
{
byte[] b = new byte[idx];
Array.Copy(readcache, b, idx);
s2 = Encoding.ASCII.GetString(b);
st(s2);
idx = 0;
}
else
{
readcache[idx] = inputData;
idx++;
idx %= 1024;
}
}
}
catch
{
}
}
public void st(string s2)
{
s3 = s2;
}
public void SendMsg(string phone, string msg)
{
port.WriteLine(phone);
port.WriteLine(msg);
}
private void Delay(int mm)
{
DateTime current = DateTime.Now;
while (current.AddMilliseconds(mm) > DateTime.Now)
{
Application.DoEvents();
}