All Packages Class Hierarchy This Package Previous Next Index
Class calypso.clients.tv.CtrlMessage
java.lang.Object
|
+----calypso.clients.tv.CtrlMessage
- public class CtrlMessage
- extends Object
CtrlMsgHandler class for creating and handling control messages.
Control messages are stored in a byte buffer. The control message
frame format is as follows: first two bytes describe the type of
the frame. The next two bytes is a length indicator. All normal
control messages (requests) are thus four bytes long. There are two
types of acknowledgements: normal and volume level acknowledgements.
Normal acknowledgements are four bytes and their structure is like
that of normal control messages. Volume acknowledgement messages
contain current volume level information in addition to the normal
control message structure and are thus six bytes long. At the moment
the volume acknowledgements are only sent from the mpeg forwarding
process so creating this type of messages is not supported.
- Author:
- Olli-Pekka Auvinen / TCM laboratory / HUT
-
CTRL_MUTE
- Control message MUTE identifier.
-
CTRL_MUTE_ACK
- Control messge MUTE acknowledgement identifier.
-
CTRL_PLAY
- Control message PLAY identifier.
-
CTRL_PLAY_ACK
- Control message PLAY acknowledgement identifier.
-
CTRL_STOP
- Control message STOP identifier.
-
CTRL_STOP_ACK
- Control message STOP acknowledgement identifier.
-
CTRL_VOLDOWN
- Control message VOLDOWN identifier.
-
CTRL_VOLDOWN_ACK
- Control message VOLDOWN acknowledgement identifier.
-
CTRL_VOLUP
- Control message VOLUP identifier.
-
CTRL_VOLUP_ACK
- Control message VOLUP acknowledgement identifier.
-
CTRL_ZOOM
- Control message ZOOM identifier.
-
CTRL_ZOOM_ACK
- Control message ZOOM acknowledgement identifier.
-
LENGTH
- Control message length field access code (index).
-
msgBuffer
- Control message data buffer.
-
TYPE
- Control message type field access code (index).
-
VOL_LEVEL
- Control message volume level field access code (index).
-
CtrlMessage(byte[])
- Constructor for making CtrlMessage of a message frame byte buffer.
-
CtrlMessage(int)
- Constructor for building control messages.
-
getField(int)
- Method for getting specified field from a control message.
-
getPacket()
- Method for getting the contents of msgBuffer.
-
getShort(int)
- Method for getting a short value from msgBuffer from a given position.
-
testType(int)
- The testType method for testing the type of the message.
msgBuffer
protected byte msgBuffer[]
- Control message data buffer.
CTRL_STOP
public static final int CTRL_STOP
- Control message STOP identifier.
CTRL_STOP_ACK
public static final int CTRL_STOP_ACK
- Control message STOP acknowledgement identifier.
CTRL_PLAY
public static final int CTRL_PLAY
- Control message PLAY identifier.
CTRL_PLAY_ACK
public static final int CTRL_PLAY_ACK
- Control message PLAY acknowledgement identifier.
CTRL_VOLUP
public static final int CTRL_VOLUP
- Control message VOLUP identifier.
CTRL_VOLUP_ACK
public static final int CTRL_VOLUP_ACK
- Control message VOLUP acknowledgement identifier.
CTRL_VOLDOWN
public static final int CTRL_VOLDOWN
- Control message VOLDOWN identifier.
CTRL_VOLDOWN_ACK
public static final int CTRL_VOLDOWN_ACK
- Control message VOLDOWN acknowledgement identifier.
CTRL_MUTE
public static final int CTRL_MUTE
- Control message MUTE identifier.
CTRL_MUTE_ACK
public static final int CTRL_MUTE_ACK
- Control messge MUTE acknowledgement identifier.
CTRL_ZOOM
public static final int CTRL_ZOOM
- Control message ZOOM identifier.
CTRL_ZOOM_ACK
public static final int CTRL_ZOOM_ACK
- Control message ZOOM acknowledgement identifier.
TYPE
public static final int TYPE
- Control message type field access code (index).
LENGTH
public static final int LENGTH
- Control message length field access code (index).
VOL_LEVEL
public static final int VOL_LEVEL
- Control message volume level field access code (index).
CtrlMessage
public CtrlMessage(int messageType_)
- Constructor for building control messages.
Used to create normal control messages (requests). These include
for example stopping the video, initiating zoom and notching the
volume level up by one unit.
- Parameters:
- messageType_ - Integer value indicating the type of the message.
CtrlMessage
public CtrlMessage(byte message_[])
- Constructor for making CtrlMessage of a message frame byte buffer.
Used mainly in the acknowledgement reception. This naturally
supports receiving the volume acknowledgements in addition to
normal acknowledgements.
- Parameters:
- message_ - A byte array holding the control message.
testType
public boolean testType(int messageType_)
- The testType method for testing the type of the message.
- Parameters:
- messageType_ - The integer value (type) of the message to be tested.
- Returns:
- True if the types match, false otherwise.
getPacket
public byte[] getPacket()
- Method for getting the contents of msgBuffer.
For debugging purposes.
- Returns:
- A byte array holding the packet data.
getShort
public short getShort(int position_)
- Method for getting a short value from msgBuffer from a given position.
For debugging.
- Parameters:
- position_ - An integer value index to the returned short field.
- Returns:
- The short value of the indexed two-byte field.
getField
protected short getField(int index_) throws ArrayIndexOutOfBoundsException
- Method for getting specified field from a control message.
- Parameters:
- index_ - An integer value index to the short field to be got.
- Returns:
- The contents of the indexed field in control message.
- Throws: ArrayIndexOutOfBoundsException
- The exception is thrown in case of an invalid index.
All Packages Class Hierarchy This Package Previous Next Index