laamaa / m8c

Cross-platform M8 tracker headless client
Other
409 stars 85 forks source link

Reduce coupling on libserialport #91

Closed v3rm0n closed 1 year ago

v3rm0n commented 1 year ago

I'm building m8c for Android downstream, with a hope of upstreaming it at some point if there is interest. Unrooted Androids do not seem to have direct access to serial ports, instead you get the USB device you want to use in Java side (dealing with permissions etc.),open a connection, claim the CDC/ACM interfaces and pass the file descriptor to the native code where you can communicate with the device. Since libserialport doesn't deal with file descriptors, something like libusb needs to be used instead.

So my proposal is to:

I'm not a C developer in any capacity so ideas are welcome.

This is something I'm going to do anyway so it's not a request for somebody else to do it, more like a check to see if I should attempt to upstream it as well.

laamaa commented 1 year ago

Not a bad idea I think, it improves portability and could possibly make the codebase a bit more clear anyway. Feel free to submit a PR if you want to do one :)