SunSPOT API V3.0


com.sun.spot.peripheral.basestation
Class MACCommand

java.lang.Object
  extended by com.sun.spot.peripheral.basestation.MACCommand
All Implemented Interfaces:
ICommand
Direct Known Subclasses:
MCPSDataIndicationCommand, MCPSDataRequestCommand, MLMEGetCommand, MLMEResetCommand, MLMERxEnableCommand, MLMESetCommand, MLMEStartCommand, NoArgIntParameterCommand, ResetProxyCommand, SetPLMETransmitPowerCommand

public abstract class MACCommand
extends Object
implements ICommand


Field Summary
static byte GetChannelAccessFailureCommand
           
static byte GetNoAckCommand
           
static byte GetNullPacketAfterAckWaitCommand
           
static byte GetPLMETransmitCommand
           
static byte GetWrongAckCommand
           
static byte MCPSDataIndicationCommand
           
static byte MCPSDataRequestCommand
           
static byte MLMEGetCommand
           
static byte MLMEResetCommand
           
static byte MLMERxEnableCommand
           
static byte MLMESetCommand
           
static byte MLMEStartCommand
           
static byte ResetProxyCommand
           
static byte SetPLMETransmitPowerCommand
           
 
Constructor Summary
MACCommand()
           
 
Method Summary
protected abstract  byte classIndicatorByte()
           
 long getTimeout()
           
 int getUID()
           
 void populateFrom(byte[] inputBuffer, int startingOffset)
           
protected abstract  void prepareResultOrExecute(I802_15_4_MAC mac)
           
protected  Object readResultFrom(DataInputStream dataInputStream)
           
 Object resultFrom(DataInputStream dataInputStream, ICreateExceptions exceptionCreator)
           
 void setUID(int uid)
           
 void writeOnto(DataOutputStream dataOutputStream)
           
protected  void writeParametersOnto(DataOutputStream dataOutputStream)
           
protected  int writePreparedResult(byte[] outputBuffer, int startingOffset)
           
 int writeResultOnto(byte[] outputBuffer, int startingOffset, I802_15_4_MAC mac)
          Write the result onto the outputBuffer byte array, starting at startingOffset.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GetNullPacketAfterAckWaitCommand

public static final byte GetNullPacketAfterAckWaitCommand
See Also:
Constant Field Values

GetChannelAccessFailureCommand

public static final byte GetChannelAccessFailureCommand
See Also:
Constant Field Values

GetNoAckCommand

public static final byte GetNoAckCommand
See Also:
Constant Field Values

GetPLMETransmitCommand

public static final byte GetPLMETransmitCommand
See Also:
Constant Field Values

GetWrongAckCommand

public static final byte GetWrongAckCommand
See Also:
Constant Field Values

MCPSDataIndicationCommand

public static final byte MCPSDataIndicationCommand
See Also:
Constant Field Values

MCPSDataRequestCommand

public static final byte MCPSDataRequestCommand
See Also:
Constant Field Values

MLMEGetCommand

public static final byte MLMEGetCommand
See Also:
Constant Field Values

MLMEResetCommand

public static final byte MLMEResetCommand
See Also:
Constant Field Values

MLMERxEnableCommand

public static final byte MLMERxEnableCommand
See Also:
Constant Field Values

MLMESetCommand

public static final byte MLMESetCommand
See Also:
Constant Field Values

MLMEStartCommand

public static final byte MLMEStartCommand
See Also:
Constant Field Values

SetPLMETransmitPowerCommand

public static final byte SetPLMETransmitPowerCommand
See Also:
Constant Field Values

ResetProxyCommand

public static final byte ResetProxyCommand
See Also:
Constant Field Values
Constructor Detail

MACCommand

public MACCommand()
Method Detail

writeOnto

public final void writeOnto(DataOutputStream dataOutputStream)
                     throws IOException
Specified by:
writeOnto in interface ICommand
Throws:
IOException

classIndicatorByte

protected abstract byte classIndicatorByte()

writeParametersOnto

protected void writeParametersOnto(DataOutputStream dataOutputStream)
                            throws IOException
Throws:
IOException

populateFrom

public void populateFrom(byte[] inputBuffer,
                         int startingOffset)
                  throws IOException
Specified by:
populateFrom in interface ICommand
Throws:
IOException

writeResultOnto

public int writeResultOnto(byte[] outputBuffer,
                           int startingOffset,
                           I802_15_4_MAC mac)
                    throws IOException
Description copied from interface: ICommand
Write the result onto the outputBuffer byte array, starting at startingOffset. Answer the number of bytes that you actually wrote.

Specified by:
writeResultOnto in interface ICommand
Throws:
IOException

prepareResultOrExecute

protected abstract void prepareResultOrExecute(I802_15_4_MAC mac)
                                        throws Throwable
Throws:
Throwable

writePreparedResult

protected int writePreparedResult(byte[] outputBuffer,
                                  int startingOffset)
                           throws IOException
Throws:
IOException

resultFrom

public final Object resultFrom(DataInputStream dataInputStream,
                               ICreateExceptions exceptionCreator)
                        throws Throwable
Specified by:
resultFrom in interface ICommand
Throws:
Throwable

readResultFrom

protected Object readResultFrom(DataInputStream dataInputStream)
                         throws IOException
Throws:
IOException

getUID

public int getUID()
Specified by:
getUID in interface ICommand

getTimeout

public long getTimeout()
Specified by:
getTimeout in interface ICommand

setUID

public void setUID(int uid)
Specified by:
setUID in interface ICommand

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.