Hello,
I am not able to read received data in AsyncStreams Prefix mode, it works in non Prefix mode(breaks data up as expected), I wish to use Prefix mode.
An example of data being sent including prefix
0011/:A-12500:\
Any suggestions appreciated.
Feathers
I am not able to read received data in AsyncStreams Prefix mode, it works in non Prefix mode(breaks data up as expected), I wish to use Prefix mode.
An example of data being sent including prefix
0011/:A-12500:\
B4X:
Sub seriall_Connected (Success As Boolean)
ProgressDialogHide
Log("Connected: " & Success)
If Success = False Then
Log(LastException.Message)
ToastMessageShow("error connecting: " & LastException.Message,True)
timer1.Enabled = False
Else
'AStreams.Initialize(seriall.InputStream, seriall.OutputStream, "AStreams")
AStreams.InitializePrefix(seriall.InputStream, True, seriall.OutputStream, "AStreams")
If AStreams.IsInitialized = True Then Log("OK")
btnScan.Visible = False
timer1.Enabled = False
'StartActivity (displayData)
End If
End Sub
Sub AStreams_NewData (Buffer() As Byte)
Dim msg As String
msg = BytesToString(Buffer, 0, Buffer.Length, "UTF8")
ToastMessageShow(msg, False)
End Sub
Any suggestions appreciated.
Feathers