B4X:
Sub AStream_NewData (Buffer() As Byte)
Dim localmsg As String
'If Buffer(0) = 1 AND Buffer(1) = 1 Then
localmsg = BytesToString(Buffer, 0, Buffer.Length, "UTF8") ' 3rd byte is start of data
Log(localmsg)
msg = localmsg.SubString(2) ' Process Global - First 2 bytes are command bytes
If IsPaused(Page2) = False Then
CallSub(Page2,"LoadLabelText") ' Only update label text if Page2 is active
End If
'End If
End Sub
This code is running in a service
I am sending 54 byte packets over USB Accessory.
However the CallSub(Page2,"LoadLabelText") only appears to execute when the log has filled up:
Message longer than Log limit (4000). Message was truncated.
Naturally I'd like the Page2 label text to update every packet.
What am I doing wrong?
Thanks in advance
FP