So my main question is: Is it possible to detect a serial port on an Android device coming from a Windows PC that isn't using AOAP?
Context: I'm trying to build a custom pilot display app (on android) that receives serial data over a wired connection from a windows computer collecting data on board a helicopter. Everything I've read and the libraries I've seen recommended are for the scenario where the Android device is in USB Host Mode (which isn't ideal because I would like to power the tablet as well). The differences between USB Host Mode and Accessory Mode can be seen here (https://developer.android.com/guide/topics/connectivity/usb/).
So this is what I'm trying to accomplish: 1. Plug in tablet to computer (via USB -> micro usb/usb type c). 2. Detect serial port and receive data (don't need to send it back). 3. Power device from computer.
While designing the app to be in USB Accessory Mode seems like a good solution, it requires that the Host (in my case the PC) is using Android Open Accessory Protocol (AOAP) which it isn't (and for reasons I won't explain isn't ideal). I also don't want to daisy chain Computer -> Serial connector -> OTG cable -> android tablet because it doesn't allow for charging the tablet nor does it fix the detecting the serial device issue.
In theory it seems like it should be more straightforward and yet I haven't been able to find any example to of this being done in the android world.
Thanks for reading.