TODOPIC

FORO TÉCNICO => Telefonía, GPS y Microcontroladores => Mensaje iniciado por: alac en 01 de Octubre de 2014, 11:29:15

Título: Evento DataReceived VB.NET
Publicado por: alac en 01 de Octubre de 2014, 11:29:15
la idea es si se recibe un sms +CMTI en el evento datareceived entonces

se liste el sms recibido y se divida en partes, ya intente hacerlo pero no me esta quedando, cual creen que sea mi error , ayuda porfa lo necesito, saludos.

este es mi codigo
Código: [Seleccionar]
Private Sub SerialPort1_DataReceived(sender As Object, e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived

        Dim buffer As String
        Dim partir As String()
  buffer = SerialPort1.ReadExisting
        EventsReceived.Text = ("Recivido:" & buffer & vbCrLf)

If InStr(EventsReceived.Text, "+CMTI") Then
           
            SerialPort1.WriteLine("AT+CMGF=1" & Chr(13))
            SerialPort1.Write("AT+CMGL=" & Chr(34) & "ALL" & Chr(34) & Chr(13))
            partir = EventsReceived.Text.Split(",")

            For i = LBound(partir) To UBound(partir)
       
                 MsgBox(partir(i))

            Next
        End If
 End Sub