While my routines sends and receive the data between Android device and PC without any problems I have a strange issue.
All the messages I receive only on the Android side have two leading bytes that do not come from any of my data.
so when I send 01 02 03 as hex from the PC to Android device I receive “B1 60 01 20 03” this happens with all PCs or other devices – so it must be in my read routine somewhere – since other Android Apps that I tried do not receive the “B1 60” leading bytes.
This is how I read from USB:
lenOfPartialChunksBuffer = mDeviceConnection.bulkTransfer(
mFTDIEndpointIN, bufferForPartialChunksOfAnswer, 4096,
commMsg.timeoutForUSBBulkTransfer);
Anybody experienced something similar?
ps – no matter which device I connect to USB serial adapter – I keep getting these 2 extra bytes
I am a novice android programmer like yourself. What I can tell it might have something to do with your android phone/tablet. I recommend that if you can spare the two bytes in your protocol, just shift over the two bytes. That’s what I did and it worked fine.