Skip to content

Commit

Permalink
minor bug fixing openhab#3
Browse files Browse the repository at this point in the history
  • Loading branch information
acioni committed Jul 31, 2016
1 parent 48f2fe6 commit 3ae8370
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public class MySensorsBindingConstants {
public final static String CHANNEL_LAST_UPDATE = "lastupdate";

// Wait time Arduino reset
public final static int RESET_TIME = 5000;
public final static int RESET_TIME = 3000;

public final static Map<Number, String> CHANNEL_MAP = new HashMap<Number, String>() {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public abstract class MySensorsBridgeConnection {

private Logger logger = LoggerFactory.getLogger(MySensorsBridgeConnection.class);

private static final MySensorsMessage I_VERSION_MESSAGE = new MySensorsMessage(0, 0, 3, 0, false, 2, "");

public List<MySensorsUpdateListener> updateListeners;
public boolean pauseWriter = false;

Expand Down Expand Up @@ -73,6 +75,7 @@ protected boolean startReaderWriterThread(MySensorsReader reader, MySensorsWrite
int i = 0;
synchronized (this) {
while (!iVersionResponse && i < 5) {
addMySensorsOutboundMessage(I_VERSION_MESSAGE);
waitingObj = this;
waitingObj.wait(1000);
i++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,10 @@ public abstract class MySensorsWriter implements MySensorsUpdateListener, Runnab
protected ExecutorService executor = Executors.newSingleThreadExecutor();
protected Future<?> future = null;

private static final MySensorsMessage I_VERSION_MESSAGE = new MySensorsMessage(0, 0, 3, 0, false, 2, "");

protected int sendDelay = 1000;

public void startWriter() {
future = executor.submit(this);

// Send the I_VERSION message
mysCon.addMySensorsOutboundMessage(I_VERSION_MESSAGE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public class MySensorsSerialConnection extends MySensorsBridgeConnection {

private String serialPort = "";
private int baudRate = 115200;
public int sendDelay = 0;
private int sendDelay = 0;
private boolean skipStartupCheck = false;

private NRSerialPort serialConnection = null;

Expand All @@ -44,6 +45,7 @@ public MySensorsSerialConnection(String serialPort, int baudRate, int sendDelay,
this.serialPort = serialPort;
this.baudRate = baudRate;
this.sendDelay = sendDelay;
this.skipStartupCheck = skipStartupCheck;

}

Expand Down

0 comments on commit 3ae8370

Please sign in to comment.