Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable stdout flooding #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion YADrone/src/de/yadrone/base/command/CommandManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class CommandManager extends AbstractManager
private Timer timer;

private static int seq = 1;

private boolean debug = false;

public CommandManager(InetAddress inetaddr, IExceptionListener excListener) {
super(inetaddr);
Expand Down Expand Up @@ -892,7 +894,7 @@ public void run()
}

private synchronized void sendCommand(ATCommand c) throws InterruptedException, IOException {
if (!(c instanceof KeepAliveCommand)) {
if (!(c instanceof KeepAliveCommand) && debug) {
System.out.println("CommandManager: send " + c.getCommandString(seq));
}

Expand Down Expand Up @@ -946,5 +948,9 @@ private void waitForControlAck(boolean b) throws InterruptedException {
}
}
}

public void debugEnable(boolean val) {
debug = val;
}

}