Package org.openmuc.jship.state.smeproth
Class Listen
- java.lang.Object
-
- org.openmuc.jship.state.SubState
-
- org.openmuc.jship.state.smeproth.SmeProtHSubState
-
- org.openmuc.jship.state.smeproth.Listen
-
- Direct Known Subclasses:
ClientListenChoice
,ServerListenConfirm
,ServerListenProposal
public abstract class Listen extends SmeProtHSubState
-
-
Field Summary
Fields Modifier and Type Field Description protected Configuration
config
-
Fields inherited from class org.openmuc.jship.state.smeproth.SmeProtHSubState
protHCallBacks
-
Fields inherited from class org.openmuc.jship.state.SubState
busy, changeStateCB, log, stateCB
-
-
Constructor Summary
Constructors Constructor Description Listen(StateCallBack stateCB, ProtHCallBacks protHCallBacks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
isCompatibleVersion(int major, int minor)
checks if version is compatible, for now accept every version that is equal or lower than own versionprotected boolean
isInvalidMsg(ProtocolHandshakeMsg p, ProtocolHandshakeTypeType type)
checks if a SME_PROT_H message is validprotected ProtocolHandshakeMsg
receiveMsg()
helper method wraps parsing in a try/catch block.-
Methods inherited from class org.openmuc.jship.state.smeproth.SmeProtHSubState
getProtHCallBacks, setProtHCallBacks
-
Methods inherited from class org.openmuc.jship.state.SubState
doProcedure, getStateCB, isBusy, next, procedure, setBusy, setNextSubState, setStateCB
-
-
-
-
Field Detail
-
config
protected Configuration config
-
-
Constructor Detail
-
Listen
public Listen(StateCallBack stateCB, ProtHCallBacks protHCallBacks)
-
-
Method Detail
-
receiveMsg
protected ProtocolHandshakeMsg receiveMsg()
helper method wraps parsing in a try/catch block.- Returns:
- the parsed SME_PROT_H message if successful, otherwise
null
-
isInvalidMsg
protected boolean isInvalidMsg(ProtocolHandshakeMsg p, ProtocolHandshakeTypeType type)
checks if a SME_PROT_H message is valid- Parameters:
p
- the SME_PROT_H messagetype
- the desired ProtocolHandshakeTypeType element- Returns:
true
if the message is valid,false
otherwise
-
isCompatibleVersion
protected boolean isCompatibleVersion(int major, int minor)
checks if version is compatible, for now accept every version that is equal or lower than own version- Parameters:
major
- major version numberminor
- minor version number- Returns:
true
if version is equal or lower to own version number,false
otherwise
-
-