📄 command.java
字号:
package net.aetherial.gis.garmin;
import java.io.*;
import java.util.*;
import javax.comm.*;
import net.aetherial.gis.garmin.*;
public class Command
{
public Command (int commandType)
{
// Kludgy -- assumes all are bytes, when the data type is int. Works
// as byte for now... Fix soon...
command = commandType;
lpc = new LinkPacketConnection();
byte[] commandByte = {(byte) commandType, 0};
commandPacket = new LinkPacket (Garmin.COMMAND_DATA, commandByte);
}
public void execute ()
{
lpc.send (commandPacket);
}
public LinkPacketConnection getLinkPacketConnection ()
{
return lpc;
}
private LinkPacket commandPacket;
private LinkPacketConnection lpc;
private int command;
public static final int CMND_ABORT_TRANSFER = 0;
public static final int CMND_TRANSFER_ALM = 1;
public static final int CMND_TRANSFER_POSN = 2;
public static final int CMND_TRANSFER_PRX = 3;
public static final int CMND_TRANSFER_RTE = 4;
public static final int CMND_TRANSFER_TIME = 5;
public static final int CMND_TRANSFER_TRK = 6;
public static final int CMND_TRANSFER_WPT = 7;
public static final int CMND_TURN_OFF_PWR= 8;
public static final int CMND_START_PVT_DATA = 49;
public static final int CMND_STOP_PVT_DATA = 50;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -