test.java 800 B

1234567891011121314151617181920212223242526272829303132
  1. import com.MAVLink.MAVLinkPacket;
  2. import com.MAVLink.common.*;
  3. import com.MAVLink.Parser;
  4. import java.io.FileInputStream;
  5. import java.io.FileNotFoundException;
  6. import java.io.IOException;
  7. public class test {
  8. public static void main(String[] args) {
  9. Parser mavParser = new Parser();
  10. try {
  11. FileInputStream tlog = new FileInputStream(args[0]);
  12. try {
  13. while(tlog.available() > 0) {
  14. MAVLinkPacket packet = mavParser.mavlink_parse_char(tlog.read());
  15. if(packet != null){
  16. System.out.println("msgid: " + packet.msgid);
  17. }
  18. }
  19. System.out.println("End tlog");
  20. } catch (IOException e) {
  21. // TODO Auto-generated catch block
  22. e.printStackTrace();
  23. }
  24. } catch (FileNotFoundException e) {
  25. // TODO Auto-generated catch block
  26. e.printStackTrace();
  27. }
  28. }
  29. }