Sun Microsystems V2.0 manual Sun Spot device libraries, Sun Spot device library, Device Interface

Page 25

The libraries only use system priorities in three cases:

1.To guarantee that application threads don't run during a system operation during which the system may be in an inconsistent state.

2.To guarantee short uninterruptible periods of operation for critical hardware interaction.

3.To ensure that the attention button is recognised.

Threads are only assigned a permanent system priority to achieve 1. or 3.

The Sun SPOT device libraries

Introduction

This section describes the contents of the Sun SPOT base library, spotlib_device.jar plus

spotlib_common.jar (the source code for both is in spotlib_source.jar).

Sun SPOT device library

The library contains drivers for:

The on-board LED

The PIO, AIC, USART and Timer-Counter devices in the AT91 package

The CC2420 radio chip, in the form of an IEEE 802.15.4 Physical interface

An IEEE 802.15.4 MAC layer

An SPI interface, used for communication with the CC2420 and off-board SPI devices

An interface to the Sun SPOT's flash memory

It also contains:

The basestation support code (in com.sun.spot.peripheral.basestation)

The over-the-air (OTA) control support code (in com.sun.spot.peripheral.ota)

The radio policy manager

A simple on-SPOT test framework, based on junit (in com.sun.spot.testFramework)

A framework for inter-isolate communication using a remote procedure call style (in

com.sun.spot.interisolate)

A handler for the attention button on the edge of the device

For details about using these devices and features see the respective Java interface:

Device

Interface

 

LED

ILed

PIO

IAT91_PIO

AIC

IAT91_AIC

Timer-Counter

IAT91_TC

CC2420

I802_15_4_PHY

MAC layer

I802_15_4_MAC

RadioPolicyManager

IRadioPolicyManager

SPI

ISpiMaster

Flash memory

IFlashMemoryDevice

Power controller

IPowerController

OTA Command Server

OTACommandServer (class)

Attention button handler

FiqInterruptDaemon (class)

25

Image 25
Contents Page Page Contents Http protocol support Introduction Deploying and running a sample application Building and deploying Sun Spot applicationsBuild Successful Total time 3 seconds \MyApplication Ant -Dport=COM2 info Total time 4 seconds \MyApplication Total time 0 seconds \MyApplication Incorporating utility classes into your application Deploying a pre-existing jarExcluding files from the compilation Manifest and resourcesOther user properties Built-in properties Using the BasestationOverview Set up Remote operation Base Station configurationIntroduction Connect a Sun Spot base station Managing keys and sharing Sun SPOTs Using short names for SPOTsTake suitable actions during over-the-air downloads BackgroundSharing Sun SPOTs Changing the owner of a Sun SpotDeploying and running a host application What is protected?Generating a new key-pair LimitationsYour own host application Configuring network featuresIncorporating pre-existing jars into your host application Mesh routing Trace route Hardware configurations and USB power Logging Page Threads Overview of an applicationThread priorities Sun Spot device library Sun Spot device librariesDevice Interface Persistent properties Overriding the Ieee address Accessing flash memoryUsart Radio communication library Program Radiogram protocol Server end Client endYou can open server radiogram connections in a similar way Broadcasting Radio properties Turning the receiver off and on Monitoring radio activity Conserving power using deep sleep modeShallow Sleep Deep Sleep Activating deep sleep modePreconditions for deep sleeping USB inhibits deep sleepDeep sleep behaviour of the standard drivers Device Condition to permit deep sleepWriting a device driver Http protocol support Configuring the http protocolSocket Proxy GUI mode Configuring projects in an IDEJavadoc/source configuration Classpath configurationDebugging Ant selectapplication Configuring Eclipse as a debug client Configuring NetBeans as a debug clientAdvanced topics Using library suitesWith adderlib as your current directory, execute the command Use the command Using the spot client SpotSerialPortException other exception in serial port comms Persistent system properties ReferenceProperty name Meaning Contents of the lib directory Contents of the arm directoryMemory usage Start address Space UseContents of the bin directory preverify.exe Contents of the tests directory Contents of the upgrade directory