i am trying to send a sms from a modem to a phone but a get always the same error.
the error is "No data received from phone afer waiting 30000ms"
can anyone help me.
the code i used was this
Dim portName As String = ComboBox1.SelectedItem.ToString
Dim baudrate As Integer = "19200"
Dim timeout As Integer = "300"
Cursor.Current = Cursors.WaitCursor
Dim comm As New GsmCommMain(portName, baudrate, timeout)
Try
comm.Open()
While Not comm.IsConnected()
Cursor.Current = Cursors.[Default]
If MessageBox.Show(Me, "Não foi possivel comunicar com o modem, O modem encontra-se ligado?", "Teste ao modem", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation) = DialogResult.Cancel Then
comm.Close()
Return
End If
Cursor.Current = Cursors.WaitCursor
End While
comm.Close()
Catch ex As Exception
MessageBox.Show(Me, "Erro de conecção: " & ex.Message, "Teste ao modem", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Return
End Try
commport = ComboBox1.SelectedItem.ToString
openn()
MessageBox.Show(Me, "As configurações estão correctas e o modem está OK.", "Teste ao modem", MessageBoxButtons.OK, MessageBoxIcon.Information)
To connect to the modem
and to send
p_sms = txt_SMS.Text
telphone = CInt(txt_Telefone.Text)
sms_send1()
the funtion sms_send1 is this
Try
Dim pdu As SmsSubmitPdu = New SmsSubmitPdu(p_sms, telphone)
modem.SendMessage(pdu)
Catch ex As Exception
MsgBox(ex.Message)
End Try