Package org.openwebnet4j.message
Class Automation
- java.lang.Object
-
- org.openwebnet4j.message.OpenMessage
-
- org.openwebnet4j.message.BaseOpenMessage
-
- org.openwebnet4j.message.Automation
-
public class Automation extends BaseOpenMessage
OpenWebNet Automation messages (WHO=2)- Author:
- M. Valla - Initial contribution
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Automation.DIM
static class
Automation.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
Automation(String value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Automation
convertUpDown(Automation autMsg)
Convert an Automation message UP<>DOWNOpenDeviceType
detectDeviceType()
Tries to return aOpenDeviceType
based on frame valueprotected Dim
dimFromValue(int i)
boolean
isDown()
Verify OpenWebNet message isDOWN
(WHAT=2).boolean
isStop()
Verify OpenWebNet message isSTOP
(WHAT=0).boolean
isUp()
Verify OpenWebNet message isUP
(WHAT=1).protected void
parseWhere()
Parse WHERE and assigns it toBaseOpenMessage.where
attributestatic Automation
requestMoveDown(String w)
OpenWebNet message request to sendDOWN
*2*2*WHERE##
.static Automation
requestMoveUp(String w)
OpenWebNet message request to sendUP
*2*1*WHERE##
.static Automation
requestStatus(String w)
OpenWebNet message request automation status*#2*WHERE##
.static Automation
requestStop(String w)
OpenWebNet message request to sendSTOP
*2*0*WHERE##
.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
-
Automation
protected Automation(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
-
requestStop
public static Automation requestStop(String w)
OpenWebNet message request to sendSTOP
*2*0*WHERE##
.- Parameters:
w
- WHERE string- Returns:
- message
-
requestMoveUp
public static Automation requestMoveUp(String w)
OpenWebNet message request to sendUP
*2*1*WHERE##
.- Parameters:
w
- WHERE string- Returns:
- message
-
requestMoveDown
public static Automation requestMoveDown(String w)
OpenWebNet message request to sendDOWN
*2*2*WHERE##
.- Parameters:
w
- WHERE string- Returns:
- message
-
requestStatus
public static Automation requestStatus(String w)
OpenWebNet message request automation status*#2*WHERE##
.- Parameters:
w
- WHERE string- Returns:
- message
-
isStop
public boolean isStop()
Verify OpenWebNet message isSTOP
(WHAT=0).- Returns:
- true if message is "STOP"
-
isUp
public boolean isUp()
Verify OpenWebNet message isUP
(WHAT=1).- Returns:
- true if message is "UP"
-
isDown
public boolean isDown()
Verify OpenWebNet message isDOWN
(WHAT=2).- Returns:
- true if message is "DOWN"
-
convertUpDown
public static Automation convertUpDown(Automation autMsg) throws FrameException
Convert an Automation message UP<>DOWN- Parameters:
autMsg
- message to convert- Returns:
- converted Automation message
- Throws:
FrameException
- in case of error in frame
-
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
-
-