@@ -63,10 +63,38 @@ public int run(String systemAddress, int mavsdkServerPort) {
6363 return getPort (mavsdkServerHandle );
6464 }
6565
66+ /**
67+ * Run MavsdkServer with MAVLink on `systemAddress` with custom MAVLink IDs.
68+ *
69+ * <p>MavsdkServer will listen for a `System` to connect on `mavsdkServerPort`.</p>
70+ *
71+ * @param systemAddress The address on which the remote MAVLink system is expected.
72+ * Valid formats are:
73+ * For TCP : tcp://[server_host][:server_port]
74+ * For UDP : udp://[bind_host][:bind_port]
75+ * For Serial : serial:///path/to/serial/dev[:baudrate]
76+ * @param mavsdkServerPort The port on which the server should listen for a `System`.
77+ * @param systemId The MAVLink sysid that MAVSDK should use.
78+ * @param componentId The MAVLink compid that MAVSDK should use.
79+ * @return The port on which MavsdkServer listens for a `System` to connect.
80+ * A return value of 0 means that the server failed to start.
81+ */
82+ public int runWithMavIds (String systemAddress , int mavsdkServerPort , int systemId , int componentId ) {
83+ mavsdkServerHandle = initNative ();
84+
85+ if (!runNativeWithMavIds (mavsdkServerHandle , systemAddress , mavsdkServerPort , systemId , componentId )) {
86+ return 0 ;
87+ }
88+
89+ return getPort (mavsdkServerHandle );
90+ }
91+
6692 private native long initNative ();
6793
6894 private native boolean runNative (long mavsdkServerHandle , String systemAddress , int mavsdkServerPort );
6995
96+ private native boolean runNativeWithMavIds (long mavsdkServerHandle , String systemAddress , int mavsdkServerPort , int systemId , int componentId );
97+
7098 private native int getPort (long mavsdkServerHandle );
7199
72100 /**
0 commit comments