Package org.openwebnet4j.message
Class GatewayMgmt
- java.lang.Object
-
- org.openwebnet4j.message.OpenMessage
-
- org.openwebnet4j.message.BaseOpenMessage
-
- org.openwebnet4j.message.GatewayMgmt
-
public class GatewayMgmt extends BaseOpenMessage
- Author:
- M. Valla - Initial contribution
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GatewayMgmt.DIM
static class
GatewayMgmt.WHAT
-
Field Summary
-
Fields inherited from class org.openwebnet4j.message.BaseOpenMessage
FORMAT_DIMENSION_REQUEST, FORMAT_DIMENSION_WRITING_1P_1V, FORMAT_DIMENSION_WRITING_1V, FORMAT_DIMENSION_WRITING_2V, FORMAT_REQUEST, FORMAT_STATUS, MAX_FRAME_LENGTH, where, whereStr, who
-
Fields inherited from class org.openwebnet4j.message.OpenMessage
FRAME_ACK, FRAME_ACK_NACK_BUSY_START, FRAME_BUSY_NACK, FRAME_END, FRAME_NACK, FRAME_START, FRAME_START_DIM, frameValue
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
GatewayMgmt(String value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OpenDeviceType
detectDeviceType()
Tries to return aOpenDeviceType
based on frame valueprotected Dim
dimFromValue(int i)
static String
parseFirmwareVersion(GatewayMgmt msg)
static byte[]
parseMACAddress(GatewayMgmt msg)
Parse MAC address in the OWN message and return values in byte[]protected void
parseWhere()
Parse WHERE and assigns it toBaseOpenMessage.where
attributestatic GatewayMgmt
requestFirmwareVersion()
OpenWebNet message request for gateway firmware version*#13**16##
.static GatewayMgmt
requestKeepConnect()
OpenWebNet message request keep connect*13*60*##
.static GatewayMgmt
requestMACAddress()
OpenWebNet message request for gateway MAC address*#13**12##
.static GatewayMgmt
requestModel()
OpenWebNet message request for gateway model*#13**15##
.static GatewayMgmt
requestProductInfo(int index)
OpenWebNet message request for product information*#13**66*index##
.static GatewayMgmt
requestScanNetwork()
OpenWebNet message request to scan network*13*65*##
.static GatewayMgmt
requestSupervisor()
OpenWebNet message request for supervisor mode*13*66*##
.protected What
whatFromValue(int i)
-
Methods inherited from class org.openwebnet4j.message.BaseOpenMessage
addValues, getCommandParams, getDim, getDimParams, getDimValues, getWhat, getWhere, getWho, isCommand, isCommandTranslation, isDimWriting, parse, toStringVerbose
-
Methods inherited from class org.openwebnet4j.message.OpenMessage
equals, getFrameValue, isACK, isBUSY_NACK, isNACK, toString
-
-
-
-
Constructor Detail
-
GatewayMgmt
protected GatewayMgmt(String value)
-
-
Method Detail
-
whatFromValue
protected What whatFromValue(int i)
- Specified by:
whatFromValue
in classBaseOpenMessage
-
dimFromValue
protected Dim dimFromValue(int i)
- Specified by:
dimFromValue
in classBaseOpenMessage
-
requestSupervisor
public static GatewayMgmt requestSupervisor()
OpenWebNet message request for supervisor mode*13*66*##
.- Returns:
- GatewayMgmt message
-
requestKeepConnect
public static GatewayMgmt requestKeepConnect()
OpenWebNet message request keep connect*13*60*##
.- Returns:
- GatewayMgmt message
-
requestMACAddress
public static GatewayMgmt requestMACAddress()
OpenWebNet message request for gateway MAC address*#13**12##
.- Returns:
- GatewayMgmt message
-
parseMACAddress
public static byte[] parseMACAddress(GatewayMgmt msg) throws FrameException
Parse MAC address in the OWN message and return values in byte[]- Parameters:
msg
- the message to parse- Returns:
- byte[] MAC address values
- Throws:
FrameException
- in case of error in frame
-
requestModel
public static GatewayMgmt requestModel()
OpenWebNet message request for gateway model*#13**15##
.- Returns:
- GatewayMgmt message
-
requestFirmwareVersion
public static GatewayMgmt requestFirmwareVersion()
OpenWebNet message request for gateway firmware version*#13**16##
.- Returns:
- GatewayMgmt message
-
parseFirmwareVersion
public static String parseFirmwareVersion(GatewayMgmt msg) throws FrameException
- Throws:
FrameException
-
requestScanNetwork
public static GatewayMgmt requestScanNetwork()
OpenWebNet message request to scan network*13*65*##
.- Returns:
- GatewayMgmt message
-
requestProductInfo
public static GatewayMgmt requestProductInfo(int index)
OpenWebNet message request for product information*#13**66*index##
.NOTE Due to a bug in the USB gateway, request product info message must use
*
to separate index instead of#
:*#13**66*index##
instead of*#13**66#index##
as documented in OpenWebNet specs.- Parameters:
index
- The index of the product inside the gateway products database as returned from network scan. Index starts at 0.- Returns:
- GatewayMgmt message
-
parseWhere
protected void parseWhere() throws FrameException
Description copied from class:BaseOpenMessage
Parse WHERE and assigns it toBaseOpenMessage.where
attribute- Specified by:
parseWhere
in classBaseOpenMessage
- Throws:
FrameException
- in case of error in frame
-
detectDeviceType
public OpenDeviceType detectDeviceType()
Description copied from class:BaseOpenMessage
Tries to return aOpenDeviceType
based on frame value- Specified by:
detectDeviceType
in classBaseOpenMessage
- Returns:
- recognized device type or null if not device can be recognized
-
-