Sub Serial1_Connected (Success As Boolean)
If Success Then
ToastMessageShow("Connected successfully", False)
TextReader1.Initialize(Serial1.InputStream)
TextWriter1.Initialize(Serial1.OutputStream)
Timer1.Enabled = True
connected = True
lblEstadoBT.Text = "CONECTADO"
RemoveViews
Activity.LoadLayout("Motor")
Else
lblEstadoBT.Text = "Error de conexión" & CRLF & "Inténtelo de nuevo"
connected = False
Timer1.Enabled = False
Msgbox(LastException.Message, "Error connecting.")
End If
End Sub