Class Heartbeat
java.lang.Object
org.openremote.agent.protocol.bluetooth.mesh.utils.Heartbeat
- Direct Known Subclasses:
HeartbeatPublication,HeartbeatSubscription
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intprotected bytestatic final intstatic final intprotected intstatic final intstatic final intstatic final intstatic final intprotected bytestatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic intcalculateHeartbeatCount(int countLog) Calculates the heart beat publication count which is the number of publications to be sentstatic intcalculateHeartbeatPeriod(short periodLog) Calculates the heart beat period interval in secondsstatic bytedecodeHeartbeatPeriod(int period) Decodes the period and returns the period log valuebyteintgetDst()Returns the destination address.byteReturns the period for processing.abstract booleanReturns true if the heartbeats are enabled.static booleanisValidHeartbeatPeriod(int period) Validates heart beat period.static booleanisValidHeartbeatPeriodLog(byte period) Validates heart beat period log.static StringperiodToTime(int seconds) Converts the perio to time
-
Field Details
-
DO_NOT_SEND_PERIODICALLY
public static final int DO_NOT_SEND_PERIODICALLY- See Also:
-
PERIOD_MIN
public static final int PERIOD_MIN- See Also:
-
PERIOD_MAX
public static final int PERIOD_MAX- See Also:
-
PERIOD_LOG_MIN
public static final int PERIOD_LOG_MIN- See Also:
-
PERIOD_LOG_MAX
public static final int PERIOD_LOG_MAX- See Also:
-
COUNT_MIN
public static final int COUNT_MIN- See Also:
-
COUNT_MAX
public static final int COUNT_MAX- See Also:
-
SEND_INDEFINITELY
public static final int SEND_INDEFINITELY- See Also:
-
DEFAULT_PUBLICATION_TTL
public static final int DEFAULT_PUBLICATION_TTL- See Also:
-
dst
protected int dst -
periodLog
protected byte periodLog -
countLog
protected byte countLog
-
-
Method Details
-
isEnabled
public abstract boolean isEnabled()Returns true if the heartbeats are enabled. -
getDst
public int getDst()Returns the destination address. -
getPeriodLog
public byte getPeriodLog()Returns the period for processing. -
calculateHeartbeatPeriod
public static int calculateHeartbeatPeriod(short periodLog) Calculates the heart beat period interval in seconds- Parameters:
periodLog- period value
-
decodeHeartbeatPeriod
public static byte decodeHeartbeatPeriod(int period) Decodes the period and returns the period log value- Parameters:
period- period value
-
isValidHeartbeatPeriod
public static boolean isValidHeartbeatPeriod(int period) Validates heart beat period.- Parameters:
period- Heartbeat publication period.- Returns:
- true if valid or false otherwise.
- Throws:
IllegalArgumentException- if the value does not range from 0 to 17.
-
isValidHeartbeatPeriodLog
public static boolean isValidHeartbeatPeriodLog(byte period) Validates heart beat period log.- Parameters:
period- Heartbeat publication period.- Returns:
- true if valid or false otherwise.
- Throws:
IllegalArgumentException- if the value does not range from 0 to 17.
-
getCountLog
public byte getCountLog() -
calculateHeartbeatCount
public static int calculateHeartbeatCount(int countLog) Calculates the heart beat publication count which is the number of publications to be sent- Parameters:
countLog- count value
-
periodToTime
Converts the perio to time- Parameters:
seconds- PeriodLog
-