-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaking changes and added classes to parse modbus messages
- Loading branch information
1 parent
1f80dc6
commit f81ecd1
Showing
20 changed files
with
346 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/me/retrodaredevil/io/modbus/ExceptionCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package me.retrodaredevil.io.modbus; | ||
|
||
public final class ExceptionCode { | ||
private ExceptionCode() { throw new UnsupportedOperationException(); } | ||
// http://www.simplymodbus.ca/exceptions.htm | ||
|
||
public static int ILLEGAL_FUNCTION = 1; | ||
public static int ILLEGAL_DATA_ACCESS = 2; | ||
public static int ILLEGAL_DATA_VALUE = 3; | ||
public static int SLAVE_DEVICE_FAILURE = 4; | ||
public static int ACKNOWLEDGE = 5; | ||
public static int SLAVE_DEVICE_BUSY = 6; | ||
public static int NEGATIVE_ACKNOWLEDGE = 7; | ||
public static int MEMORY_PARITY_ERROR = 8; | ||
// skip 9 for some reason | ||
public static int GATEWAY_PATH_UNAVAILABLE = 10; | ||
public static int GATEWAY_TARGET_DEVICE_FAILED_TO_RESPOND = 11; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/me/retrodaredevil/io/modbus/handling/MessageResponseCreator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package me.retrodaredevil.io.modbus.handling; | ||
|
||
import me.retrodaredevil.io.modbus.ModbusMessage; | ||
|
||
public interface MessageResponseCreator<T> extends MessageHandler<T> { | ||
/** | ||
* Creates a response message with the specified data | ||
* @param data The data to put in the returned response message | ||
* @return A response {@link ModbusMessage} with the specified data | ||
*/ | ||
ModbusMessage createResponse(T data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.