mik3y / usb-serial-for-android

Android USB host serial driver library for CDC, FTDI, Arduino and other devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Did you do this by reverse engineering?

midnight-wonderer opened this issue · comments

Hi,
I taught myself how to write a USB device driver, and I use some of the code here as a reference, specifically the CH34x one.
It has a lot of magic numbers and pointless operations.

Do you guys (maintainers, collaborators, or contributors) implement this by sniffing wire protocol?
Impressive!! If that is the case.

For instance,

checkState("init #1", 0x5f, 0, new int[]{-1 /* 0x27, 0x30 */, 0x00});

This one is not actually a state but a command to read the silicon version number. This version number should be used to implement things differently to support different hardware.

There are many more; most of the magic numbers used are unidentifiable. (I use the official driver as a reference.)
Are you looking for improvement (e.g., naming things, removing redundant operations, or documenting), or are you OK with how things are?
(Not that I can directly contribute myself, as I don't have the setup for testing/debugging Android devices. I'm just curious about the state of the project.)

Reverse engineering was done by different people or reused from other open source implementations.
As there is no publicly available documentation, we should keep as is.