Replace tabs with spaces

This commit is contained in:
2015-09-01 13:19:54 +01:00
parent 0f33f2a429
commit 4773db55ef
10 changed files with 398 additions and 407 deletions

View File

@@ -11,50 +11,41 @@ import com.github.boukefalos.arduino.exception.ArduinoException;
import com.github.boukefalos.tm1638.AbstractTM1638;
public class Remote extends AbstractTM1638 implements Receiver {
protected Duplex duplex;
protected ArrayList<Listen<Object>> listenList;
protected Duplex duplex;
public Remote(Duplex duplex) {
this.duplex = duplex;
listenList = new ArrayList<Listen<Object>>();
duplex.register(this); // Server > [receive()]
}
public Remote(Duplex duplex) {
this.duplex = duplex;
listenList = new ArrayList<Listen<Object>>();
duplex.register(this); // Server > [receive()]
}
public void start() {
duplex.start();
}
public void start() {
duplex.start();
}
public void stop() {
duplex.stop();
}
public void stop() {
duplex.stop();
}
public void exit() {
super.stop();
duplex.exit();
}
public void exit() {
super.stop();
duplex.exit();
}
public void register(Listen<Object> listen) {
listenList.add(listen);
}
public void receive(byte[] buffer) {
// Arduino > Server > [Client]
// Should give option to decode here?
for (Listen<Object> listen : listenList) {
listen.add(buffer);
}
}
public void remove(Listen<Object> listen) {
listenList.remove(listen);
}
public void receive(byte[] buffer) {
// Arduino > Server > [Client]
// Should give option to decode here?
for (Listen<Object> listen : listenList) {
listen.add(buffer);
}
}
public void send(byte[] buffer) throws ArduinoException {
// [Client] > Server > Arduino
try {
duplex.send(buffer);
} catch (IOException e) {
throw new ArduinoException("Failed to send");
}
}
public void send(byte[] buffer) throws ArduinoException {
// [Client] > Server > Arduino
try {
duplex.send(buffer);
} catch (IOException e) {
throw new ArduinoException("Failed to send");
}
}
}