⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 garmin12xl.java

📁 gps garmingpstool-src-0[1].9.tar.gz
💻 JAVA
字号:
package net.aetherial.gis.garmin;

import javax.comm.*;
import java.util.*;
import net.aetherial.gis.garmin.*;

public class Garmin12XL 
{
	public static void main (String[] args)
	{
		try 
		{
			if (args[0].equals  ("procap"))
			{
				System.out.println ("GPS Receiver Product Capability");
				ProductData pd = new ProductData ();
				System.out.println ("Product ID: "+pd.getProductID ());
				System.out.println ("Software Version: "+pd.getSoftwareVersion ());
				System.out.println ("Product Description: "+pd.getProductDescription ());

				System.out.print ("Supported Physical Protocols: ");
				String[] phys = pd.getPhysicalProtocols ();
				for (int i = 0; i < phys.length; i++)
				{
					System.out.print (phys[i]+" ");
				}
				System.out.println ("");

				System.out.print ("Supported Link Protocols: ");
				String[] link = pd.getLinkProtocols ();
				for (int i = 0; i < link.length; i++)
				{
					System.out.print (link[i]+" ");
				}
				System.out.println ("");

				System.out.print ("Supported Link Protocols: ");
				String[] app = pd.getApplicationProtocols ();
				for (int i = 0; i < app.length; i++)
				{
					System.out.print (app[i]+" ");
				}
				System.out.println ("");

				System.out.print ("Supported Data Formats: ");
				String[] data = pd.getDataFormats ();
				for (int i = 0; i < data.length; i++)
				{
					System.out.print (data[i]+" ");
				}
				System.out.println ("");
			}
			else if (args[0].equals ("waypnt"))
			{
				Waypoint103[] wps = WaypointCommand.getWaypoints103 ();

				System.out.println ("Waypoint Name, Latitude, Longitude");

				for (int i = 0; i < wps.length; i++)
					System.out.println (wps[i].getCSVRepresentation ());
			}
			else
			{
				printUsage ();
			}
		}
		catch (ArrayIndexOutOfBoundsException e)
		{
			printUsage ();
		}
	}

	private static void printUsage ()
	{
		System.out.println ("Garmin GPS Serial Link Test Program.");
		System.out.println ("Usage: Test [test] [options]");
		System.out.println ("Tests:");
		System.out.println ("     procap      - Product Capabilities / Supported Data Types");
		System.out.println ("     waypnt      - Waypoint Transfer Protocol");
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -