Dim isSend As Boolean = False Try Dim recievedData As String = ExecCommand(port, "AT", 300, "No phone connected") recievedData = ExecCommand(port, "AT+CMGF=1", 300, "Failed to set message format.") Dim command As [String] = "AT+CMGS=""" & PhoneNo & """" recievedData = ExecCommand(port, command, 300, "Failed to accept phoneNo") command = Message & Char.ConvertFromUtf32(26) & vbCr recievedData = ExecCommand(port, command, 3000, "Failed to send message") '3 seconds If recievedData.EndsWith(vbCr & vbLf & "OK" & vbCr & vbLf) Then isSend = True ElseIf recievedData.Contains("ERROR") Then isSend = False End If Return isSend Catch ex As Exception Throw ex End Try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)