Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB protocol emulate Android #22

Open
hkfuertes opened this issue Oct 20, 2023 · 1 comment
Open

USB protocol emulate Android #22

hkfuertes opened this issue Oct 20, 2023 · 1 comment

Comments

@hkfuertes
Copy link

Hello, first of all thank you for this amazing job!
I have a question more than an issue, forgive me if this is not the right channel. I wanted to give it a try to build the project aawireless (https://github.com/Snirpo/aawireless/tree/develop) and I manage to have them both built, aasdk and aawireless. Now the hard part is to combine everything into a RPI image.

I'm still studying the code, but for what I have found, on high level, the mechanism is very simple. TCP (via bluetooth wifi hotspot) to phone, passthrough to the USB connection, what I read from the socket is what I write to the usb and viceversa.

Basically is what the project is already doing (and also https://github.com/north3221/AAGateWayWiFi/blob/main/app/src/main/java/com/north3221/aagateway/HackerService.java).

My big conceptual question is... how can I emulate and android device? what is Android Auto HeadUnit expecting? a serial device? I can put my rpi into gadget mode, and emulate a serial device, thats not an issue... but will it work with this code:

    void App::onUSBDeviceConnected(aasdk::usb::DeviceHandle deviceHandle) {
        usbConnection = connectionFactory.create(deviceHandle);
        tryStartProxy();
    }
//...
    ConnectionFactory::create(aasdk::usb::DeviceHandle deviceHandle) {
        auto aoapDevice(aasdk::usb::AOAPDevice::create(usbWrapper, ioService, deviceHandle));
        auto transport(std::make_shared<aasdk::transport::USBTransport>(ioService, std::move(aoapDevice)));
        return create(std::move(transport));
    }

What is this deviceHandle raw usb? a serial usb?

Sorry for the abstract question, and again, thank you very much for your time!

@hkfuertes
Copy link
Author

Oh... I just tested it with my wired phone, and this code is for the head unit itself, not for the device....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant