mCore™ .NET SMS Library 1.2

mCore.SMS.Port Property

Description:

The Port property gets or sets the serial port or the virtual serial port to which the GSM Modem or the Phone is connected. The value is set/returned as a string and is between "COM1" and "COM256".

For GSM devices connected through Infrared Port or USB to Serial converter or Bluetooth interface, the Port property value should be set to the virtual serial port address.

Namespace: mCore
Assembly: mCoreLib (in mCoreLib.dll)

Exceptions:

mCore.GeneralException

Usage Example:

Visual Basic
Public Class MyClass
   Public WithEvents objSMS As New mCore.SMS

   Public Sub ModemConnect()
      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
         objSMS.Connect()

      Catch ex As mCore.GeneralException
         MsgBox(ex.Message, MsgBoxStyle.Critical, "mCore Demo")

      Catch ex As Exception

      End Try
   End Function
End Class
 
C#
class MyClass
{
   public mCore.SMS objSMS = new mCore.SMS();
   public static void ModemConnect()
   {
      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;
         objSMS.Connect();
      }

      catch (mCore.GeneralException e)
      {
         MessageBox.Show(e.ToString());
      }
      catch (Exception e)
      {
      }
   }
}

See Also:

mCore.SMS.BaudRate Property
mCore.SMS.DataBits Property
mCore.SMS.StopBits Property
mCore.SMS.Parity Property
mCore.SMS.FlowControl Property
mCore.SMS.Timeout Property
mCore.SMS.IsConnected Property
mCore.SMS.Connect Method
mCore.SMS.Disconnect Method

 

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved