Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
VB
'Verificaçã se o modem está conectado e se as configurações estão correctas
       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

VB
p_sms = txt_SMS.Text
        telphone = CInt(txt_Telefone.Text)
        sms_send1()


the funtion sms_send1 is this

VB
Try

            'Send an SMS message
            Dim pdu As SmsSubmitPdu = New SmsSubmitPdu(p_sms, telphone)
            modem.SendMessage(pdu)

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try 
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900