SunSPOT API V3.0


com.sun.spot.peripheral.radio
Interface IProprietaryRadio


public interface IProprietaryRadio

This interface represents the parts of the CC2420's functionality that are not exposed by the I802.15.4 PHY layer but are still useful. Some of these are required for the current I802.15.4 MAC layer implementation.


Field Summary
static int DEFAULT_CHANNEL
          Default radio channel to use.
static int DEFAULT_TRANSMIT_POWER
          Default output power setting.
static int OFF_MODE_IDLE
          Parameter for setting RX off mode to leave the chip's oscillator enabled (see setOffMode(int))
static int OFF_MODE_POWER_DOWN
          Parameter for setting RX off mode to enable the chip's voltage regulator but disable the oscillator (see setOffMode(int))
static int OFF_MODE_VREG_OFF
          Parameter for setting RX off mode to disable the chip's voltage regulator (see setOffMode(int))
 
Method Summary
 int dataRequest(RadioPacket rp, boolean retry)
          Attempt to send rp.
 void dumpHistory()
          Dump information about the last ten packets to log.
 int getCrcError()
          Answer the count of the number of CRC errors recorded.
 int getRxOverflow()
          Answer the count of the number of overflows recorded while receiving packets.
 int getShortPacket()
          Answer the count of the number of short packets recorded.
 int getTransceiverState()
          Answer the transceiver's state as defined by the I802.15.4.
 int getTxMissed()
          Answer the count of the number of times we started a transmit and apparently didn't manage to start waiting for it to complete until after the interrupt was already signalled.
 boolean isActive()
           
 boolean isRxDataWaiting()
           
 void reset()
          Reset the hardware device
 void resetErrorCounters()
          Reset the CrcError, ShortPacket, TxMissed and RxOverflow counters to zero.
 void setAddressRecognition(short panId, long extendedAddress)
          Set the hardware device to ignore non-broadcast messages that don't match our panID and extendedAddress
 void setAutoAGCGainMode()
          Set the AGC gain range to be auotmatic selected
 void setAutoHighGainMode()
          Set the AGC gain range to be the high range
 void setAutoLowGainMode()
          Set the AGC gain range to be the low range
 void setAutoMediumGainMode()
          Set the AGC gain range to be the medium range
 void setManualHighGainMode(int gain)
          Turn off AGC, set gain range to be the medium range
 void setManualLowGainMode(int gain)
          Turn off AGC, set gain range to be the low range
 void setManualMediumGainMode(int gain)
          Turn off AGC, set gain range to be the medium range
 void setOffMode(int offState)
          Set the off mode for the radio to one of the modes defined above.
 void setRecordHistory(boolean shouldRecordHistory)
          The driver can maintain a history of recent radio events which can be displayed by dumpHistory.
 

Field Detail

DEFAULT_TRANSMIT_POWER

static final int DEFAULT_TRANSMIT_POWER
Default output power setting.

See Also:
Constant Field Values

DEFAULT_CHANNEL

static final int DEFAULT_CHANNEL
Default radio channel to use.

See Also:
Constant Field Values

OFF_MODE_VREG_OFF

static final int OFF_MODE_VREG_OFF
Parameter for setting RX off mode to disable the chip's voltage regulator (see setOffMode(int))

See Also:
Constant Field Values

OFF_MODE_POWER_DOWN

static final int OFF_MODE_POWER_DOWN
Parameter for setting RX off mode to enable the chip's voltage regulator but disable the oscillator (see setOffMode(int))

See Also:
Constant Field Values

OFF_MODE_IDLE

static final int OFF_MODE_IDLE
Parameter for setting RX off mode to leave the chip's oscillator enabled (see setOffMode(int))

See Also:
Constant Field Values
Method Detail

reset

void reset()
Reset the hardware device


setAddressRecognition

void setAddressRecognition(short panId,
                           long extendedAddress)
Set the hardware device to ignore non-broadcast messages that don't match our panID and extendedAddress

Parameters:
panId - the pan id to which this Spot should respond
extendedAddress - the 64 bit IEEE address to which this Spot should respond

setRecordHistory

void setRecordHistory(boolean shouldRecordHistory)
The driver can maintain a history of recent radio events which can be displayed by dumpHistory. This call enables or disables history recording.

Parameters:
shouldRecordHistory - - true to record history, false to not record

dumpHistory

void dumpHistory()
Dump information about the last ten packets to log. Intended to support testing


getTransceiverState

int getTransceiverState()
Answer the transceiver's state as defined by the I802.15.4. PHY layer spec.

Returns:
I802_15_4_PHY.RX_ON | I802_15_4_PHY.TRX_OFF | I802_15_4_PHY.TX_ON

setOffMode

void setOffMode(int offState)
Set the off mode for the radio to one of the modes defined above. The radio will enter this mode whenever the rx is turned off.

NOTE - If you select OFF_MODE_VREG_OFF then the radio will forget all its configuration settings when it enters that mode. You will need to reset the channel, the power and the address recognition after turning the radio back on. In the other power off modes the radio always remembers its settings when powered-down.

Parameters:
offState - -- OFF_MODE_VREG_OFF | OFF_MODE_POWER_DOWN | OFF_MODE_IDLE

setAutoAGCGainMode

void setAutoAGCGainMode()
Set the AGC gain range to be auotmatic selected


setAutoLowGainMode

void setAutoLowGainMode()
Set the AGC gain range to be the low range


setAutoMediumGainMode

void setAutoMediumGainMode()
Set the AGC gain range to be the medium range


setAutoHighGainMode

void setAutoHighGainMode()
Set the AGC gain range to be the high range


setManualLowGainMode

void setManualLowGainMode(int gain)
Turn off AGC, set gain range to be the low range

Parameters:
gain - - specific gain value to be used

setManualMediumGainMode

void setManualMediumGainMode(int gain)
Turn off AGC, set gain range to be the medium range

Parameters:
gain - - specific gain value to be used

setManualHighGainMode

void setManualHighGainMode(int gain)
Turn off AGC, set gain range to be the medium range

Parameters:
gain - - specific gain value to be used

getRxOverflow

int getRxOverflow()
Answer the count of the number of overflows recorded while receiving packets. To support testing.

Returns:
-- the count.

getCrcError

int getCrcError()
Answer the count of the number of CRC errors recorded. To support testing.

Returns:
-- the count.

getTxMissed

int getTxMissed()
Answer the count of the number of times we started a transmit and apparently didn't manage to start waiting for it to complete until after the interrupt was already signalled. To support testing.

Returns:
-- the count

getShortPacket

int getShortPacket()
Answer the count of the number of short packets recorded. To support testing.

Returns:
-- the count.

resetErrorCounters

void resetErrorCounters()
Reset the CrcError, ShortPacket, TxMissed and RxOverflow counters to zero.


dataRequest

int dataRequest(RadioPacket rp,
                boolean retry)
Attempt to send rp. Return either SUCCESS or BUSY if the channel is not clear. If retry is true, we assume the packet is already in the radio chip TXFIFO. If not, for example if sending code is multithreading, this will break.

Parameters:
rp - radio packet to send
retry - whether this radio packet is a resend of the previous call to this method.
Returns:
-- SUCCESS or BUSY.

isRxDataWaiting

boolean isRxDataWaiting()
Returns:
Whether there is data waiting in the chip's receive buffer

isActive

boolean isActive()
Returns:
Whether data is being received or transmitted

SunSPOT API V3.0


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