Android Question AsyncStreams Prefix

Feathers

New Member
Licensed User
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:\
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
 

Feathers

New Member
Licensed User
Hello Erel

The data is sent via BT from Atmel micro, I can control what is sent.
Android device only needs to receive data, no transmission necessary.
Is the format 0011/:A-12500:\ for prefix & data not correct?

Feathers.
 
Upvote 0
Top