Class WirelessReceiver

  • All Implemented Interfaces:
    Receiver

    public class WirelessReceiver
    extends DEReceiver
    A receiver for use in the wireless domain.

    This receiver overrides the base class to handle transmission properties. This receiver works by bundling the token and its transmission properties into a record token, and then unbundling at the corresponding get() methods. FIXME: properties should be a RecordToken instead of Token. But I couldn't fix this until we can create an empty record token. yang

    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Yellow (cxh)
    Pt.ProposedRating:
    Green (cxh)
    • Constructor Detail

      • WirelessReceiver

        public WirelessReceiver()
        Construct an empty WirelessReceiver with no container.
      • WirelessReceiver

        public WirelessReceiver​(IOPort container)
                         throws IllegalActionException
        Construct an empty WirelessReceiver with the specified container.
        Parameters:
        container - The container.
        Throws:
        IllegalActionException - If the container does not accept this receiver.
    • Method Detail

      • get

        public Token get()
                  throws NoTokenException
        Override the base class to unbundle the token and its properties. After this is called, the properties are available via the getProperties() method.
        Specified by:
        get in interface Receiver
        Overrides:
        get in class DEReceiver
        Returns:
        The next token in the receiver.
        Throws:
        NoTokenException - If there are no more tokens. This is a runtime exception, so it need not be declared explicitly.
        See Also:
        getProperties(), Receiver.get()
      • getProperties

        public Token getProperties()
        Return the properties token associated with the most recent call to get(), or null if there was none.
        Returns:
        A properties token or null.
      • put

        public void put​(Token token,
                        Token properties)
                 throws IllegalActionException
        Put the specified token bundled with the specified properties.
        Parameters:
        token - The token to put, or null to send no token.
        properties - The associated properties, or null to not put any in.
        Throws:
        IllegalActionException - If cannot get the director or if the current microstep is zero.