I am trying to communicate with a USB Accessory (Magnetic Strip Card reader, Model- E-Seek M250), with a Nexus 7 acting as a USBHost.
Use case : When a card is swiped , I need to get the details from the card and convert it to a user readable format.
I have been able to successfully get the device, its interface and the input endpoint. After that this is what I am doing to get the data:
int receivedBytes = mConnection.bulkTransfer(usbEndpointIN, readBytes, readBytes.length, 3000);
if (receivedBytes > 2) {
dataString = new String(readBytes);
Log.v(Util.TAG, " :: Received Byte Count ::" + receivedBytes);
Log.v(Util.TAG, " :: Final Value Bytes" + readBytes);
Log.v(Util.TAG, " :: Final Value String" + dataString);
}
After several tries, I could not find a way to get the data in user readable format, below is the way the data is shown in the logs.
Can anybody let me know how to convert this data into user readable format?