net.homeip.mleclerc.omnilink.messagebase
Class MessageHelper

java.lang.Object
  extended bynet.homeip.mleclerc.omnilink.messagebase.MessageHelper

public class MessageHelper
extends java.lang.Object


Constructor Summary
MessageHelper()
           
 
Method Summary
static double celciusToFahrenheit(double tempCelcius)
           
static int createWord(short highByte, short lowByte)
           
static double fahrenheitToCelcius(double tempFahrenheit)
           
static int getAreaCount(SystemTypeEnum model)
           
static short getBits(int value, int bitIndex, int bitCount)
           
static short[] getCRC(short[] message)
           
static int getMaxZones(SystemTypeEnum model)
           
static java.lang.String getText(int byteIndex, short[] data)
           
static short highByte(int word)
           
static boolean isBitOn(int value, int bitIndex)
           
static short lowByte(int word)
           
static double omniToTemp(short tempCode)
           
static short tempToOmni(double temp)
           
static char toHouseCode(int houseCodeVal)
           
static java.lang.String toPhoneNumber(short[] data, int first, int last)
           
static java.lang.String toRevisionCode(int revision)
           
static int updateCRC(int crc, short data)
           
static short[] userCodeToBytes(java.lang.String userCode)
           
static void validateEnum(Enum enum)
           
static void validateRange(int firstNumber, int lastNumber)
           
static void validateValue(int value, int min, int max)
           
static Enum valueToEnum(EnumInfo metaInfo, int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageHelper

public MessageHelper()
Method Detail

omniToTemp

public static double omniToTemp(short tempCode)

tempToOmni

public static short tempToOmni(double temp)

getCRC

public static short[] getCRC(short[] message)

updateCRC

public static int updateCRC(int crc,
                            short data)

lowByte

public static short lowByte(int word)

highByte

public static short highByte(int word)

isBitOn

public static boolean isBitOn(int value,
                              int bitIndex)

createWord

public static int createWord(short highByte,
                             short lowByte)

getBits

public static short getBits(int value,
                            int bitIndex,
                            int bitCount)

userCodeToBytes

public static short[] userCodeToBytes(java.lang.String userCode)
                               throws CommunicationException
Throws:
CommunicationException

validateRange

public static void validateRange(int firstNumber,
                                 int lastNumber)
                          throws CommunicationException
Throws:
CommunicationException

validateValue

public static void validateValue(int value,
                                 int min,
                                 int max)
                          throws CommunicationException
Throws:
CommunicationException

validateEnum

public static void validateEnum(Enum enum)
                         throws CommunicationException
Throws:
CommunicationException

valueToEnum

public static Enum valueToEnum(EnumInfo metaInfo,
                               int value)
                        throws CommunicationException
Throws:
CommunicationException

getText

public static java.lang.String getText(int byteIndex,
                                       short[] data)

toHouseCode

public static char toHouseCode(int houseCodeVal)

toRevisionCode

public static java.lang.String toRevisionCode(int revision)

toPhoneNumber

public static java.lang.String toPhoneNumber(short[] data,
                                             int first,
                                             int last)

getAreaCount

public static int getAreaCount(SystemTypeEnum model)
                        throws CommunicationException
Throws:
CommunicationException

getMaxZones

public static int getMaxZones(SystemTypeEnum model)
                       throws CommunicationException
Throws:
CommunicationException

celciusToFahrenheit

public static double celciusToFahrenheit(double tempCelcius)

fahrenheitToCelcius

public static double fahrenheitToCelcius(double tempFahrenheit)