com.amx.duet.tools.util
Class EventPacker

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

public class EventPacker
extends java.lang.Object

The EventPacker class was created to package up NetLinx event data into a single Event object. The class provides a list of methods that can be used to create Event objects for routines such as processing advanced events or listening to loopback data coming from a derived NetLinxDevice.

Since:
AMXTools 1.0.1
Version:
1.0.0

Constructor Summary
EventPacker()
           
 
Method Summary
static com.amx.duet.core.master.netlinx.Event packError(com.amx.duet.core.master.netlinx.DPS dps, int error)
          Create an ERROR Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packOff(com.amx.duet.core.master.netlinx.DPS dps, int channelId)
          Create an OFF Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packOffInputChannel(com.amx.duet.core.master.netlinx.DPS dps, int channelId)
          Create a RELEASE Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packOffline(com.amx.duet.core.master.netlinx.DPS dps)
          Create an OFFLINE Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packOn(com.amx.duet.core.master.netlinx.DPS dps, int channelId)
          Create an ON Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packOnInputChannel(com.amx.duet.core.master.netlinx.DPS dps, int channelId)
          Create a PUSH Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packOnline(com.amx.duet.core.master.netlinx.DPS dps)
          Create an ONLINE Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendCommand(com.amx.duet.core.master.netlinx.DPS dps, byte[] str)
          Create a SEND_COMMAND Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendCommand(com.amx.duet.core.master.netlinx.DPS dps, char[] str)
          Create a SEND_COMMAND Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendCommand(com.amx.duet.core.master.netlinx.DPS dps, java.lang.String str)
          Create a SEND_COMMAND Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendCommandWide(com.amx.duet.core.master.netlinx.DPS dps, java.lang.String str)
          Create a wide string SEND_COMMAND Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendCustom(com.amx.duet.core.master.netlinx.DPS dps, int id, int eventType, int flag, int value1, int value2, int value3, byte[] eventData, byte[] encode)
          Create a CUSTOM Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendCustom(com.amx.duet.core.master.netlinx.DPS dps, int id, int eventType, int flag, int value1, int value2, int value3, char[] eventData, byte[] encode)
          Create a CUSTOM Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendCustom(com.amx.duet.core.master.netlinx.DPS dps, int id, int eventType, int flag, int value1, int value2, int value3, java.lang.String eventData, byte[] encode)
          Create a CUSTOM Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendCustomWide(com.amx.duet.core.master.netlinx.DPS dps, int id, int eventType, int flag, int value1, int value2, int value3, java.lang.String eventData, byte[] encode)
          Create a wide string CUSTOM Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendLevel(com.amx.duet.core.master.netlinx.DPS dps, int levelId, float value)
          Create a LEVEL Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendLevel(com.amx.duet.core.master.netlinx.DPS dps, int levelId, int value)
          Create a LEVEL Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendLevel(com.amx.duet.core.master.netlinx.DPS dps, int levelId, com.amx.duet.core.master.netlinx.Level value)
          Create a LEVEL Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendString(com.amx.duet.core.master.netlinx.DPS dps, byte[] str)
          Create a SEND_STRING Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendString(com.amx.duet.core.master.netlinx.DPS dps, char[] str)
          Create a SEND_STRING Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendString(com.amx.duet.core.master.netlinx.DPS dps, java.lang.String str)
          Create a SEND_STRING Event for the passed in DPS.
static com.amx.duet.core.master.netlinx.Event packSendStringWide(com.amx.duet.core.master.netlinx.DPS dps, java.lang.String str)
          Create a wide string SEND_STRING Event for the passed in DPS.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventPacker

public EventPacker()
Method Detail

packError

public static final com.amx.duet.core.master.netlinx.Event packError(com.amx.duet.core.master.netlinx.DPS dps,
                                                                     int error)
Create an ERROR Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
error - Error value to be reported
Returns:
an Event object containing all necessary event information.

packOnline

public static final com.amx.duet.core.master.netlinx.Event packOnline(com.amx.duet.core.master.netlinx.DPS dps)
Create an ONLINE Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
Returns:
an Event object containing all necessary event information.

packOffline

public static final com.amx.duet.core.master.netlinx.Event packOffline(com.amx.duet.core.master.netlinx.DPS dps)
Create an OFFLINE Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
Returns:
an Event object containing all necessary event information.

packOff

public static final com.amx.duet.core.master.netlinx.Event packOff(com.amx.duet.core.master.netlinx.DPS dps,
                                                                   int channelId)
Create an OFF Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
channelId - is the index of the channel (1 based)
Returns:
an Event object containing all necessary event information.

packOffInputChannel

public static final com.amx.duet.core.master.netlinx.Event packOffInputChannel(com.amx.duet.core.master.netlinx.DPS dps,
                                                                               int channelId)
Create a RELEASE Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
channelId - is the index of the channel (1 based)
Returns:
an Event object containing all necessary event information.

packOn

public static final com.amx.duet.core.master.netlinx.Event packOn(com.amx.duet.core.master.netlinx.DPS dps,
                                                                  int channelId)
Create an ON Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
channelId - is the index of the channel (1 based)
Returns:
an Event object containing all necessary event information.

packOnInputChannel

public static final com.amx.duet.core.master.netlinx.Event packOnInputChannel(com.amx.duet.core.master.netlinx.DPS dps,
                                                                              int channelId)
Create a PUSH Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
channelId - is the index of the channel (1 based)
Returns:
an Event object containing all necessary event information.

packSendCommand

public static final com.amx.duet.core.master.netlinx.Event packSendCommand(com.amx.duet.core.master.netlinx.DPS dps,
                                                                           byte[] str)
Create a SEND_COMMAND Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
str - is a string containing the command data
Returns:
an Event object containing all necessary event information.

packSendCommand

public static final com.amx.duet.core.master.netlinx.Event packSendCommand(com.amx.duet.core.master.netlinx.DPS dps,
                                                                           char[] str)
Create a SEND_COMMAND Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
str - is a string containing the command data
Returns:
an Event object containing all necessary event information.

packSendCommand

public static final com.amx.duet.core.master.netlinx.Event packSendCommand(com.amx.duet.core.master.netlinx.DPS dps,
                                                                           java.lang.String str)
Create a SEND_COMMAND Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
str - is a string containing the command data
Returns:
an Event object containing all necessary event information.

packSendCommandWide

public static final com.amx.duet.core.master.netlinx.Event packSendCommandWide(com.amx.duet.core.master.netlinx.DPS dps,
                                                                               java.lang.String str)
Create a wide string SEND_COMMAND Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
str - is a string containing the command data
Returns:
an Event object containing all necessary event information.

packSendCustom

public static final com.amx.duet.core.master.netlinx.Event packSendCustom(com.amx.duet.core.master.netlinx.DPS dps,
                                                                          int id,
                                                                          int eventType,
                                                                          int flag,
                                                                          int value1,
                                                                          int value2,
                                                                          int value3,
                                                                          byte[] eventData,
                                                                          byte[] encode)
Create a CUSTOM Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
id -
eventType -
flag -
value1 -
value2 -
value3 -
eventData - a string containing the custom event data
encode -
Returns:
an Event object containing all necessary event information.

packSendCustom

public static final com.amx.duet.core.master.netlinx.Event packSendCustom(com.amx.duet.core.master.netlinx.DPS dps,
                                                                          int id,
                                                                          int eventType,
                                                                          int flag,
                                                                          int value1,
                                                                          int value2,
                                                                          int value3,
                                                                          char[] eventData,
                                                                          byte[] encode)
Create a CUSTOM Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
id -
eventType -
flag -
value1 -
value2 -
value3 -
eventData - a string containing the custom event data
encode -
Returns:
an Event object containing all necessary event information.

packSendCustom

public static final com.amx.duet.core.master.netlinx.Event packSendCustom(com.amx.duet.core.master.netlinx.DPS dps,
                                                                          int id,
                                                                          int eventType,
                                                                          int flag,
                                                                          int value1,
                                                                          int value2,
                                                                          int value3,
                                                                          java.lang.String eventData,
                                                                          byte[] encode)
Create a CUSTOM Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
id -
eventType -
flag -
value1 -
value2 -
value3 -
eventData - a string containing the custom event data
encode -
Returns:
an Event object containing all necessary event information.

packSendCustomWide

public static final com.amx.duet.core.master.netlinx.Event packSendCustomWide(com.amx.duet.core.master.netlinx.DPS dps,
                                                                              int id,
                                                                              int eventType,
                                                                              int flag,
                                                                              int value1,
                                                                              int value2,
                                                                              int value3,
                                                                              java.lang.String eventData,
                                                                              byte[] encode)
Create a wide string CUSTOM Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
id -
eventType -
flag -
value1 -
value2 -
value3 -
eventData - a string containing the custom event data
encode -
Returns:
an Event object containing all necessary event information.

packSendLevel

public static final com.amx.duet.core.master.netlinx.Event packSendLevel(com.amx.duet.core.master.netlinx.DPS dps,
                                                                         int levelId,
                                                                         com.amx.duet.core.master.netlinx.Level value)
Create a LEVEL Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
levelId - a one based integer representing the level to send
value - a Level object containing the level value to send
Returns:
an Event object containing all necessary event information.

packSendLevel

public static final com.amx.duet.core.master.netlinx.Event packSendLevel(com.amx.duet.core.master.netlinx.DPS dps,
                                                                         int levelId,
                                                                         int value)
Create a LEVEL Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
levelId - a one based integer representing the level to send
value - int level value to send
Returns:
an Event object containing all necessary event information.

packSendLevel

public static final com.amx.duet.core.master.netlinx.Event packSendLevel(com.amx.duet.core.master.netlinx.DPS dps,
                                                                         int levelId,
                                                                         float value)
Create a LEVEL Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
levelId - a one based integer representing the level to send
value - int level value to send
Returns:
an Event object containing all necessary event information.

packSendString

public static final com.amx.duet.core.master.netlinx.Event packSendString(com.amx.duet.core.master.netlinx.DPS dps,
                                                                          byte[] str)
Create a SEND_STRING Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
str - is a string buffer containing the string data
Returns:
an Event object containing all necessary event information.

packSendString

public static final com.amx.duet.core.master.netlinx.Event packSendString(com.amx.duet.core.master.netlinx.DPS dps,
                                                                          char[] str)
Create a SEND_STRING Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
str - is a string buffer containing the string data
Returns:
an Event object containing all necessary event information.

packSendString

public static final com.amx.duet.core.master.netlinx.Event packSendString(com.amx.duet.core.master.netlinx.DPS dps,
                                                                          java.lang.String str)
Create a SEND_STRING Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
str - is a string buffer containing the string data
Returns:
an Event object containing all necessary event information.

packSendStringWide

public static final com.amx.duet.core.master.netlinx.Event packSendStringWide(com.amx.duet.core.master.netlinx.DPS dps,
                                                                              java.lang.String str)
Create a wide string SEND_STRING Event for the passed in DPS.

Parameters:
dps - a DPS object representing the D:P:S of an IcspNetLinxDevice
str - is a string buffer containing the string data
Returns:
an Event object containing all necessary event information.


Copyright © 2008 AMX LLC. All Rights Reserved.