Skip to content

Commit

Permalink
Add roundtrip time, fix version im manifest and update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian S. committed Nov 3, 2018
1 parent fa90899 commit 239b46b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
## Alpha 0.9.18 (2018-??-??) WIP - SNAPSHOT
## Alpha 0.9.19 (2018-11-03)

Features:

- add JSerialComm as additional serial driver
- add send/receive roundtrip time to controller
- Update DTO objects
- add divider property to DTO
- change java level to 1.8

Bugfixes:

- fix "indirectly referenced" issue on extern bundles

## Alpha 0.9.18 (2018-06-10)

Features:

- add bruteforce analyzer to decode data with all data types (internal only)
- add watchdog timer to all eBus connections, default is 5mins at the moment
- add new controller exception to harden thread handling

Bugfixes:

Expand Down
2 changes: 1 addition & 1 deletion META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Automatic-Module-Name: de.csdev.ebus
Bundle-ManifestVersion: 2
Bundle-Name: eBUS 4 Java
Bundle-SymbolicName: de.csdev.ebus;singleton:=true
Bundle-Version: 0.9.18.qualifier
Bundle-Version: 0.9.19.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.google.gson,
com.google.gson.annotations,
Expand Down
20 changes: 18 additions & 2 deletions src/main/java/de/csdev/ebus/core/EBusController.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public class EBusController extends EBusControllerBase {
/** counts the re-connection tries */
private int reConnectCounter = 0;

private long sendRoundTrip = -1;

public EBusController(IEBusConnection connection) {
super(connection);
}
Expand All @@ -45,6 +47,10 @@ public Integer addToSendQueue(byte[] buffer, int maxAttemps) throws EBusControll
return queue.addToSendQueue(buffer, maxAttemps);
}

public long getLastSendReceiveRoundtripTime() {
return sendRoundTrip;
}

/**
* @param buffer
* @return
Expand Down Expand Up @@ -292,13 +298,23 @@ private void send(boolean secondTry) throws IOException {
connection.reset();

// send command
// for (int i = 0; i < dataOutputBuffers.length; i++) {
byte b = dataOutputBuffers[0];

logger.trace("Send {}", EBusUtils.toHexDumpString(b));
if (logger.isTraceEnabled()) {
logger.trace("Send {}", EBusUtils.toHexDumpString(b));
}

// store nao time to messure send receive roundtrip time
long startTime = System.nanoTime();

connection.writeByte(b);

readByte = (byte) (connection.readByte(true) & 0xFF);

// clacule send receive roundtrip time in ns
sendRoundTrip = System.nanoTime() - startTime;

// update the state machine
sendMachine.update(readByte);

if (b != readByte) {
Expand Down

0 comments on commit 239b46b

Please sign in to comment.