Class IEEE802154Node

  • Direct Known Subclasses:
    SerialNode, XBeeNode

    public abstract class IEEE802154Node
    extends AbstractNode
    Basic implementation of a node for IEEE 802.15.4 networks.

    Integrated with IEEE802154TrafficController.

    Each node has 3 addresses associated with it:

    1. A 16 bit PAN (Personal Area Network) ID assigned by the user
    2. A 16 bit User Assigned Address
    3. A 64 bit Globally Unique ID assigned by the manufacturer

    All nodes in a given network must have the same PAN ID

    • Constructor Detail

      • IEEE802154Node

        public IEEE802154Node()
        Creates a new instance of AbstractNode
      • IEEE802154Node

        public IEEE802154Node​(byte[] pan,
                              byte[] user,
                              byte[] global)
    • Method Detail

      • setNodeAddress

        public void setNodeAddress​(int address)
        Public method to set the node address. Address range is checked in subclasses.
        Overrides:
        setNodeAddress in class AbstractNode
        Parameters:
        address - address index to set in node
        Throws:
        java.lang.IllegalArgumentException - if out of range
      • checkNodeAddress

        protected boolean checkNodeAddress​(int address)
        Check for valid address with respect to range, etc.
        Specified by:
        checkNodeAddress in class AbstractNode
        Parameters:
        address - node number to check.
        Returns:
        true if valid
      • setPANAddress

        public void setPANAddress​(byte[] addr)
        Set PAN address.
        Parameters:
        addr - byte array containing upper and lower bytes of the 16 bit PAN address.
      • getPANAddress

        public byte[] getPANAddress()
        Get the PAN address
        Returns:
        byte array containing the upper and lower bytes of the PAN address
      • setUserAddress

        public void setUserAddress​(byte[] addr)
        Set User address.
        Parameters:
        addr - byte array containing upper and lower bytes of the 16 bit user assigned address.
      • getUserAddress

        public byte[] getUserAddress()
        Get the User address
        Returns:
        byte array containing the upper and lower bytes of the User assigned address
      • setGlobalAddress

        public void setGlobalAddress​(byte[] addr)
        Set global address.
        Parameters:
        addr - byte array containing bytes of the 64 bit global address.
      • getGlobalAddress

        public byte[] getGlobalAddress()
        Get the Global address
        Returns:
        byte array containing the 8 bytes of the global address
      • getSensorsActive

        public abstract boolean getSensorsActive()
        Are there sensors present, and hence this node will need to be polled? Note: returns 'true' if at least one sensor is active for this node
        Specified by:
        getSensorsActive in class AbstractNode
        Returns:
        'true' if at least one sensor is active for this node
      • resetTimeout

        public abstract void resetTimeout​(AbstractMRMessage m)
        A reply was received, so there was not timeout, do any needed processing.
        Specified by:
        resetTimeout in class AbstractNode
        Parameters:
        m - message received that has reset the timeout and is waiting to be handled
      • mustSend

        public boolean mustSend()
        Return state of needSend flag.
        Overrides:
        mustSend in class AbstractNode
        Returns:
        state of needSend flag.