I'm trying to use the RS232 class that was in the Platform SDK (i think).
Has anyone else used this with events successfully? Here's what i've got:
======================
Public WithEvents bbsPort As Rs232 = New Rs232
With bbsPort
.BaudRate = baud
.DataBit = dataBits
.Parity = parity
.Port = comPort
.StopBit = stopBits
Try
.Open()
Catch ex As Exception
StopServerToolStripMenuItem.PerformClick()
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try
End With
'The port opens okay because if I have another application using the port I
get the exception message "Unable to open COM1"
Public Sub ReadComPort(ByVal Source As Rs232, ByVal DataBuffer() As Byte)
Handles bbsPort.DataReceived
MsgBox("DataReceived")
End Sub
=======================
Two questions I have are: I know I can communicate because I can talk to
the serial device with Hyperterminal. When I try it with my app, the event
is never fired. So I must be doing something wrong. Any help is
desperately needed & appreciated.
Second question: There doesn't seem to be a way to set flow control. Has
anyone added flow control capabilities to this class?
Thanks.