Dim cPort As New SerialPort
cPort.PortName = m_port
cPort.BaudRate = 115200
cPort.DataBits = 8
cPort.StopBits = IO.Ports.StopBits.One
cPort.Parity = IO.Ports.Parity.None
cPort.ReadTimeout = 10000
cPort.WriteTimeout = 1000
cPort.DtrEnable = True
cPort.RtsEnable = True
cPort.Open()
AddHandler cPort.DataReceived, AddressOf DataReceivedHandler
Public Sub DataReceivedHandler(ByVal sender As Object, ByVal e As SerialDataReceivedEventArgs)
Dim sp As SerialPort = CType(sender, SerialPort)
Dim indata As String = sp.ReadExisting()
End Sub