mavlink / MAVSDK-Java

MAVSDK client for Java.
71 stars 41 forks source link

Detecting serial connections with android. #60

Closed MichaelSwan3 closed 3 years ago

MichaelSwan3 commented 3 years ago

Hi,

I am connecting via serial (to a px4) on android and you need to put in a serial connection string :

int mavsdkServerPort = mavsdkServer.run("serial:///bus/usb/001/003:1150200"); How can I:

When I plug in the serial device (PX4), q ground ground immediately wants to open it - how do I do that for my own application?

I've had a quick look through https://github.com/mik3y/usb-serial-for-android. Not sure if you are already using this or I need to implement it.

Is there a serial example for android?

I've a quick look at the q ground control source, not sure if I need to do this.

I assume all I need to do is: Get the connection strings then should be able to drone.getAction().arm(); etc

Cheers Michael Swan (emesent)

JonasVautherin commented 3 years ago

There has been work done in this issue. I think there was good progress (getting a file descriptor from Android Java and passing it to libmavsdk_server.so, but for some reason it was not working.

It would be amazing if you could have a look at that and see if you manage to pass the file descriptor from Java to C++ over JNI successfully!

Let's continue the discussion there: https://github.com/mavlink/MAVSDK-Java/issues/23