forked from mavlink/mavlink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
all: build | ||
|
||
build: | ||
mkdir -p com/MAVLink | ||
mavgen.py --lang Java --wire-protocol=1.0 ../../../../message_definitions/v1.0/ardupilotmega.xml -o com/MAVLink | ||
mkdir -p build | ||
javac -d build test.java com/MAVLink/*.java com/MAVLink/common/*.java com/MAVLink/ardupilotmega/*.java | ||
|
||
clean: | ||
rm -rf build com/MAVLink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import com.MAVLink.MAVLinkPacket; | ||
import com.MAVLink.common.*; | ||
import com.MAVLink.Parser; | ||
|
||
import java.io.FileInputStream; | ||
import java.io.FileNotFoundException; | ||
import java.io.IOException; | ||
|
||
public class test { | ||
|
||
public static void main(String[] args) { | ||
Parser mavParser = new Parser(); | ||
try { | ||
FileInputStream tlog = new FileInputStream(args[0]); | ||
try { | ||
while(tlog.available() > 0) { | ||
MAVLinkPacket packet = mavParser.mavlink_parse_char(tlog.read()); | ||
if(packet != null){ | ||
System.out.println("msgid: " + packet.msgid); | ||
} | ||
} | ||
System.out.println("End tlog"); | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} catch (FileNotFoundException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |