SunSPOT API V3.0


com.sun.spot.peripheral.radio
Interface I802_15_4_PHY


public interface I802_15_4_PHY

Defines the portion of the I802.15.4 PHY layer specification that this library currently supports. Note: even if you intend to use this class to implement a physical-level transmitter only, you should still call pdDataIndication in a separate thread in order to prevent the CC2420's RX FIFO from filling with radio noise.

See Also:
http://standards.ieee.org/getieee802/index.html

Field Summary
static int BUSY
          Return code for CCA requests when channel is not clear
static int IDLE
          Return code for CCA requests when channel is clear
static int PHY_CURRENT_CHANNEL
          Attribute to set the current channel (in the range 11..26) (see plmeSet(int, int))
static int PHY_TRANSMIT_POWER
          Attribute to set the transmit power (the parameter must be a six bit 2s-complement number in the range -32..31 - the easiest was to get this is to pass in "myPower & 0x3F") (see plmeSet(int, int))
static int RX_ON
          Value for TRX state (see plmeSetTrxState(int)) to enable RX
static int SUCCESS
          Return code for success in pdDataRequest(RadioPacket) and plmeSetTrxState(int)
static int TRX_OFF
          Value for TRX state (see plmeSetTrxState(int)) to disable RX
static int TX_ON
          Return code for plmeCCARequest() if transmission is active
 
Method Summary
 void pdDataIndication(RadioPacket rp)
          Receive a packet.
 int pdDataRequest(RadioPacket rp)
          Send a packet
 int plmeCCARequest()
          Check to see if channel is clear
 int plmeGet(int attribute)
          Gets the value of a PHY attribute
 void plmeSet(int attribute, int value)
          Sets the value of a PHY attribute.
 int plmeSetTrxState(int newState)
          Set the TRX state.
 

Field Detail

BUSY

static final int BUSY
Return code for CCA requests when channel is not clear

See Also:
Constant Field Values

IDLE

static final int IDLE
Return code for CCA requests when channel is clear

See Also:
Constant Field Values

RX_ON

static final int RX_ON
Value for TRX state (see plmeSetTrxState(int)) to enable RX

See Also:
Constant Field Values

SUCCESS

static final int SUCCESS
Return code for success in pdDataRequest(RadioPacket) and plmeSetTrxState(int)

See Also:
Constant Field Values

TRX_OFF

static final int TRX_OFF
Value for TRX state (see plmeSetTrxState(int)) to disable RX

See Also:
Constant Field Values

TX_ON

static final int TX_ON
Return code for plmeCCARequest() if transmission is active

See Also:
Constant Field Values

PHY_CURRENT_CHANNEL

static final int PHY_CURRENT_CHANNEL
Attribute to set the current channel (in the range 11..26) (see plmeSet(int, int))

See Also:
Constant Field Values

PHY_TRANSMIT_POWER

static final int PHY_TRANSMIT_POWER
Attribute to set the transmit power (the parameter must be a six bit 2s-complement number in the range -32..31 - the easiest was to get this is to pass in "myPower & 0x3F") (see plmeSet(int, int))

See Also:
Constant Field Values
Method Detail

pdDataRequest

int pdDataRequest(RadioPacket rp)
Send a packet

Parameters:
rp - - Packet to send
Returns:
SUCCESS | RX_ON

pdDataIndication

void pdDataIndication(RadioPacket rp)
Receive a packet. Note: this method is not synchronized because we assume only one thread will call this at a time.

Parameters:
rp - - Packet to fill in with data

plmeCCARequest

int plmeCCARequest()
Check to see if channel is clear

Returns:
TRX_OFF | BUSY | IDLE

plmeSet

void plmeSet(int attribute,
             int value)
             throws PHY_UnsupportedAttributeException,
                    PHY_InvalidParameterException
Sets the value of a PHY attribute.

Parameters:
attribute - - key of attribute to set
value - - value to set
Throws:
PHY_UnsupportedAttributeException
PHY_InvalidParameterException
See Also:
PHY_CURRENT_CHANNEL, PHY_TRANSMIT_POWER

plmeGet

int plmeGet(int attribute)
            throws PHY_UnsupportedAttributeException
Gets the value of a PHY attribute

Parameters:
attribute - - key of attribute to get
Returns:
- attribute value
Throws:
PHY_UnsupportedAttributeException
See Also:
PHY_CURRENT_CHANNEL, PHY_TRANSMIT_POWER

plmeSetTrxState

int plmeSetTrxState(int newState)
Set the TRX state.

Currently not implemented for TX_ON in the CC2420.

Parameters:
newState - -- TRX_OFF | RX_ON | TX_ON

SunSPOT API V3.0


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