Thanks, so do you mean implement a buffer to collect incoming data, and my activity grabs the samples from that buffer?
I've already got that. In AStream_NewData, I first stuff data in the buffer with this function:
Public Sub PutManyByte(rxd() As Byte)
For i =0 To rxd.Length-1
fifobuf.Add(rxd(i))
'Log("rx: " & rxd(i))
rxdCnt = rxdCnt+1
Next
End Sub
Then before leaving the AStream_NewData, I check if the amount of data in 'fifobuf' is sufficient to contain one or more packets of my data, and if it does I repetitively retrieve the packets out of fifobuf and send them to a function in my activity that draws to screen and so on.
I guess I should not be doing this last part in the AStream_NewData event but rather in a timer event in my activity? I'll give that a go.
For interest sake, here's the sort of lag I am seeing - up to 3.7 seconds in this captured data: