### Data Collection

AsyncStreams (in non prefix mode) raises the NewData event whenever there is data available.
AsyncStreams has no buffer.
The End of Line (EOL) character(s) are not included in the NewData event.
Example
`Sub Process_Globals
Private AStream As AsyncStreams
...
End Sub`
' Handle NewData from an Arduino coming in via the serial line.
' Parameter: Buffer as byte. The buffer needs to be converted to a string
`Sub AStream_NewData (Buffer() As Byte)
Dim s As String = BytesToString(Buffer, 0, Buffer.Length, "UTF8")
Log("Newdata: " & s)
Select s
Case "0":
txtFromArduino.Text = "Arduino Replied with 0 : LED=OFF"
Case "1":
txtFromArduino.Text = "Arduino Replied with 1 : LED=ON"
Case "ON":
txtFromArduino.Text = "Arduino Replied with 1 : LED=ON"
Case "OFF":
txtFromArduino.Text = "Arduino Replied with 1 : LED=OFF"
End Select
End Sub`

Changed: , Category: AsyncStreams, File: T6C162M1203.htm, ID: 1203