com.amx.duet.tools.util
Class NetLinxUtil

java.lang.Object
  extended bycom.amx.duet.tools.util.NetLinxUtil

public class NetLinxUtil
extends java.lang.Object

Class containing NetLinx API java equivalent methods. If you are not extending this class, then calls should be used like so:
NetLinx.SendLevel(nlDev, nLevel, nValue)

Note: Most methods are using camel case as apposed to the mixed case or upper case method used by NetLinx. Also, the underscore has been removed.

Since:
AMXTools 1.0.0
Version:
1.0.3

Field Summary
static int FIRST_LOCAL_PORT
           
static int FIRST_VIRTUAL_DEVICE
           
static int TIMELINE_ONCE
           
static int TIMELINE_REPEAT
           
 
Constructor Summary
NetLinxUtil()
           
 
Method Summary
static void CancelWait(WaitTimer timer)
          This method cancels the specified wait timer.
static int getPulseTime()
          The function returns the current duration of PULSE as set by setPulseTime().
static long MaxValue(long lvar1, long lvar2)
          This routine takes two variables and compares for the highest value.
static long MinValue(long lvar1, long lvar2)
          This routine takes two variables and compares for the lowest value.
static int Off(com.amx.duet.da.NetLinxDevice nlDev, int nChan)
          Send the feedback off state to the device.
static int On(com.amx.duet.da.NetLinxDevice nlDev, int nChan)
          Send the feedback on state to the device.
static int Pulse(com.amx.duet.da.NetLinxDevice nlDev, int nChan)
          Send a pulse command to the device.
static int Push(com.amx.duet.da.NetLinxDevice nlDev, int nChan)
          Send a push command to the device.
static int RandomNumber(int number)
          This function returns a random number X in the range 0 <= X < number.
static int Release(com.amx.duet.da.NetLinxDevice nlDev, int nChan)
          Send a release command to the device.
static int SendCommand(com.amx.duet.da.NetLinxDevice nlDev, java.lang.String str)
          Send the command to the device.
static int SendLevel(com.amx.duet.da.NetLinxDevice nlDev, int nLevel, float fValue)
          Send the level value to the device.
static int SendLevel(com.amx.duet.da.NetLinxDevice nlDev, int nLevel, int nValue)
          Send the level value to the device.
static int SendString(com.amx.duet.da.NetLinxDevice nlDev, java.lang.String str)
          Send the string to the device.
static void setPulseTime(int nTime)
          This function sets the PULSE time in .10 second units.
static boolean Wait(WaitTimer timer)
          This method is used to create and process an event of one or more statements at a later time.
static boolean Wait(WaitTimer timer, int nTimeOut)
          This method is used to create and process an event of one or more statements at a specified period of time.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST_VIRTUAL_DEVICE

public static final int FIRST_VIRTUAL_DEVICE
See Also:
Constant Field Values

FIRST_LOCAL_PORT

public static final int FIRST_LOCAL_PORT
See Also:
Constant Field Values

TIMELINE_ONCE

public static final int TIMELINE_ONCE
See Also:
Constant Field Values

TIMELINE_REPEAT

public static final int TIMELINE_REPEAT
See Also:
Constant Field Values
Constructor Detail

NetLinxUtil

public NetLinxUtil()
Method Detail

SendLevel

public static final int SendLevel(com.amx.duet.da.NetLinxDevice nlDev,
                                  int nLevel,
                                  int nValue)
Send the level value to the device.

Parameters:
nlDev -
nLevel -
nValue -
Returns:

SendLevel

public static final int SendLevel(com.amx.duet.da.NetLinxDevice nlDev,
                                  int nLevel,
                                  float fValue)
Send the level value to the device.

Parameters:
nlDev -
nLevel -
fValue -
Returns:

SendString

public static final int SendString(com.amx.duet.da.NetLinxDevice nlDev,
                                   java.lang.String str)
Send the string to the device.

Parameters:
nlDev -
str -
Returns:

SendCommand

public static final int SendCommand(com.amx.duet.da.NetLinxDevice nlDev,
                                    java.lang.String str)
Send the command to the device.

Parameters:
nlDev -
str -
Returns:

Push

public static final int Push(com.amx.duet.da.NetLinxDevice nlDev,
                             int nChan)
Send a push command to the device.

Parameters:
nlDev -
nChan -
Returns:

Release

public static final int Release(com.amx.duet.da.NetLinxDevice nlDev,
                                int nChan)
Send a release command to the device.

Parameters:
nlDev -
nChan -
Returns:

On

public static final int On(com.amx.duet.da.NetLinxDevice nlDev,
                           int nChan)
Send the feedback on state to the device.

Parameters:
nlDev -
nChan -
Returns:

Off

public static final int Off(com.amx.duet.da.NetLinxDevice nlDev,
                            int nChan)
Send the feedback off state to the device.

Parameters:
nlDev -
nChan -
Returns:

Pulse

public static final int Pulse(com.amx.duet.da.NetLinxDevice nlDev,
                              int nChan)
Send a pulse command to the device.

Parameters:
nlDev -
nChan -
Returns:

setPulseTime

public static final void setPulseTime(int nTime)
This function sets the PULSE time in .10 second units. The default PULSE time is 5 (0.5 seconds).

Parameters:
nTime -

getPulseTime

public static final int getPulseTime()
The function returns the current duration of PULSE as set by setPulseTime(). Time is measured in tenths of a second; the default is 5 (0.5 seconds).

Returns:

CancelWait

public static final void CancelWait(WaitTimer timer)
This method cancels the specified wait timer.

Parameters:
timer - WaitTimer to be cancelled.

Wait

public static final boolean Wait(WaitTimer timer,
                                 int nTimeOut)
This method is used to create and process an event of one or more statements at a specified period of time.

Parameters:
timer - WaitTimer object
nTimeOut - period of time to reset the timer to
Returns:
true if the timer was able to start

Wait

public static final boolean Wait(WaitTimer timer)
This method is used to create and process an event of one or more statements at a later time.

Parameters:
timer - WaitTimer object
Returns:
true if the timer was able to start

RandomNumber

public static final int RandomNumber(int number)
This function returns a random number X in the range 0 <= X < number.

Parameters:
number - integer (must be greater than zero) that will serve as the upper limit for the random number generator.
Returns:
An integer >= 0 and < number

MinValue

public static final long MinValue(long lvar1,
                                  long lvar2)
This routine takes two variables and compares for the lowest value.

Parameters:
lvar1 - variable that must be a long or casted to a long
lvar2 - variable that must be a long or casted to a long
Returns:
the lower value

MaxValue

public static final long MaxValue(long lvar1,
                                  long lvar2)
This routine takes two variables and compares for the highest value.

Parameters:
lvar1 - variable that must be a long or casted to a long
lvar2 - variable that must be a long or casted to a long
Returns:
the higher variable.


Copyright © 2008 AMX LLC. All Rights Reserved.