The CancelUSSDSession terminates currently active USSD session (if
any) and returns
the result of the method as a Boolean value (True if cancel session is successful).
The status of current USSD session can be determined by evaluating the status
property of
NewUSSDReceivedEventArgs object returned by the
NewUSSDReceived event.
Namespace: mCore
Assembly: mCoreLib (in mCoreLib.dll)
| Visual Basic |
| Public Class MyClass Public WithEvents objSMS As New mCore.SMS Public Sub New() Try SetCommParameters() objSMS.NewUSSDIndication = True objSMS.SendUSSD("*101#") Catch ex As mCore.GeneralException MsgBox(ex.Message) End Try End Sub 'New USSD Message Event Handling 'A message box will pop-up whenever 'a new USSD message is received Private Sub objSMS_NewUSSDReceived(ByVal sender As Object, _ ByVal e As mCore.NewUSSDReceivedEventArgs) _ Handles objSMS.NewUSSDReceived MsgBox(e.Message & vbCrLf & vbCrLf & _ "STATUS: " & e.Status.ToString, _ MsgBoxStyle.Information, "NEW USSD RECEIVED") End Sub Public Sub 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 ex As mCore.GeneralException MsgBox(ex.Message) Catch ex As Exception End Try End Function End Class |
| C# |
class MyClass { catch
(mCore.GeneralException e) |
mCore.SMS.SendUSSD Method
mCore.SMS.CancelUSSDSession Method
mCore.SMS.NewUSSDIndication Property
mCore.NewUSSDReceivedEventArgs Class
mCore.SMS.NewUSSDReceivedEventHandler Delegate