Rev 1698 |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
package dongfang.mkt.frames;
import java.io.IOException;
import dongfang.mkt.RequestFrameVisitor;
public class ExternalControlRequestFrame
extends RequestFrame
{
public static final int COMMAND_NONE =
0;
public static final int COMMAND_GYROCAL =
1;
public static final int COMMAND_ACCCAL =
2;
public static final int COMMAND_GYRO_ACC_CAL =
3;
public static final int COMMAND_STOP =
10;
public static final int COMMAND_START =
11;
int[] digital =
new int[2];// unsigned byte.
int remoteButtons
; // unsigned byte.
int pitch
; // signed byte.
int roll
; // signed byte.
int yaw
; // signed byte.
int throttle
; // unsigned byte.
int height
; // signed byte (!).
int command
; // unsigned byte. Called "free" in MK code.
int frameNum
; // unsigned byte.
int argument
; // unsigned byte. Called "config" in MK code.
public ExternalControlRequestFrame
() {
super(FC_ADDRESS
);
}
public int[] getDigital
() {
return digital
;
}
public void setDigital
(int[] digital
) {
this.
digital = digital
;
}
public int getRemoteButtons
() {
return remoteButtons
;
}
public void setRemoteButtons
(int remoteButtons
) {
this.
remoteButtons = remoteButtons
;
}
public int getPitch
() {
return pitch
;
}
public void setPitch
(int pitch
) {
this.
pitch = pitch
;
}
public int getRoll
() {
return roll
;
}
public void setRoll
(int roll
) {
this.
roll = roll
;
}
public int getYaw
() {
return yaw
;
}
public void setYaw
(int yaw
) {
this.
yaw = yaw
;
}
public int getThrottle
() {
return throttle
;
}
public void setThrottle
(int throttle
) {
this.
throttle = throttle
;
}
public int getHeight
() {
return height
;
}
public void setHeight
(int height
) {
this.
height = height
;
}
public int getCommand
() {
return command
;
}
public void setCommand
(int command
) {
this.
command = command
;
}
public int getFrameNum
() {
return frameNum
;
}
public void setFrameNum
(int frameNum
) {
this.
frameNum = frameNum
;
}
public int getArgument
() {
return argument
;
}
public void setArgument
(int argument
) {
this.
argument = argument
;
}
public void start
() {
command = COMMAND_START
;
}
public void stop
() {
command = COMMAND_STOP
;
}
public void gyroCal
() {
command = COMMAND_GYROCAL
;
}
public void accCal
() {
command = COMMAND_ACCCAL
;
}
@
Override
public void accept
(RequestFrameVisitor o
) throws IOException {
o.
visit(this);
}
}