class MyClass
{
public mCore.SMS objSMS = new mCore.SMS();
public MyClass()
{
try
{
SetCommParameters();
objSMS.IncomingCallIndication =
true;
}
catch (mCore.GeneralException e)
{
MessageBox.Show(e.ToString());
}
objSMS.NewIncomingCall +=
new
mCore.SMS.IncomingCallHandler(objSMS_NewIncomingCall);
}
//Incoming Call Event Handling
//A message box will pop-up whenever
//a new incoming call is received
private void objSMS_NewIncomingCall
(object sender, mCore.IncomingCallEventArgs e)
{
MessageBox.Show("Incoming call from: " +
e.CallerID);
}
public static void SetCommParameters()
{
try
{
objSMS.Port = "COM1";
objSMS.BaudRate =
mCore.BaudRate.BaudRate_19200;
objSMS.DataBits =
mCore.DataBits.Eight;
objSMS.StopBits =
mCore.StopBits.One;
objSMS.Parity =
mCore.Parity.None;
objSMS.FlowControl =
mCore.FlowControl.RTS_CTS;
} catch
(mCore.GeneralException e)
{
MessageBox.Show(e.ToString());
}
catch (Exception e)
{
}
}
} |