Android Question [SOLVED] FelUSBserial issue

saunwin

Active Member
Licensed User
Longtime User
Hi,
Using FELusbserial to send and recieve a few bytes. I noticed that when sending a byte a random number of DataAvailable events are fired, with what looks like no data bytes.
so I send 62, 62, 64 and 54 and dataAvailable logs empty data. I'm also dropping bytes even though I'm looping in the dataAvailable routine From 0 To Buffer.length-1.
Any advise here ?
TIA

Send a byte
B4X:
                tx = 62
                'send 0x62 thru serial port
                t = bc.HexToBytes(tx)
                    If usbserial.IsInitialized Then
                    usbserial.Write(t)

Receiving bytes
B4X:
Private Sub serial_DataAvailable (Buffer() As Byte)
    
    Log("New data: " & bc.HexFromBytes(Buffer))

1631993774716.png
 

saunwin

Active Member
Licensed User
Longtime User
Thanks for the reply Erel.
B4X:
Log ("Buffer Length "& (Buffer.length))
The above line returns zero. So this is normal ? - I'm using the Si Labs 2102
 
Upvote 0

saunwin

Active Member
Licensed User
Longtime User
OK, this is weird.
My tablet (Tangotab) has two USB ports (a USB A and an OTG).
The OTG appears to work fine.
The full size USB A drops bytes and produces dataavailable events with no data.
Thank you for replying Erel.
 
Upvote 0
Top