Connect Method

Description:

Connect method opens the serial communication port specified in the Port property, with the serial communication parameter specified in BaudRate, Parity, DataBits, StopBits properties.

   

Usage blnResult = ObjectName.Connect
Parameters None
Returns Boolean value
  • True - If closing is successful
  • False - If closing of port fails
Remarks It is not mandatory to call Connect method explicitly. The Connect method is called internally by mCore automatically after detecting the port connection state in following cases:
  • If you call any method that requires serial communication with the GSM modem (e.g. ReadSMS, Command etc).
  • If you read any property value that requires serial communication with the modem (e.g. MessageMemory, SignalStrength, Network, SMSC etc)
  • If you set the value of any property that requires serial communication with the modem (e.g. SMSC, MessageMemory etc)

Usage Example:

Visual Basic / ASP (VBScript)
Dim objSMS As mCore.SMS
Set objSMS = New mCore.SMS
' You can also use Set objSMS = CreateObject("mCore.SMS")
' In case of ASP (VBScript) to create object use
' Set objSMS = Server.CreateObject("mCore.SMS")
' In ASP use Response.Write instead of MsgBox
objSMS.Port = "COM2"
objSMS.BaudRate = 57600
objSMS.Parity = "N"
objSMS.DataBits = 8
objSMS.StopBits = "1"
If objSMS.Connect Then
     MsgBox "Connected Successfully!"
     objSMS.Disconnect
Else
     MsgBox "Error " & CStr(objSMS.ErrorCode) & _
            ": " & objSMS.ErrorDescription
End If
Set objSMS = Nothing

  

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved