Sun Microsystems V2.0 manual Using the Basestation, Built-in properties, Overview

Page 14

resources/META-INF/MANIFEST.MF

within its root folder. The adderlib extension has such a file, whose content is

FavouriteSnake: Viper

This defines a property whose value will be available to all applications in a similar fashion to application-specific manifest properties. The addertest application demonstrates this by displaying the value of this property. The library suite is built to contain all the properties defined by the manifests of all its input jars. For more details on accessing these properties, see the section Manifest and resources.

Running startup code

Some library extensions require initialisation to be performed at startup (for example, to create daemon threads). To specify startup code that must be run, add one or more lines to the manifest properties of the library extension with the following format:

spot-startup-xxxx: my.fully.qualified.Classname

where xxxx is a string that is provided as the single argument to the static main() method of

Classname.

Startup code is run only in the master isolate. It is run after all normal spotlib initialisation is completed but before the OTACommandServer (if configured) is started and before the application is launched.

Modifying the system library code) for properties that are constant for all your Sun SPOTs and applications.

Built-in properties

There are a number of properties with reserved names that the libraries understand. These are:

DefaultChannelNumber DefaultPanId DefaultTransmitPower com.sun.spot.io.j2me.socket.SocketConnection-BaseStationAddress com.sun.spot.io.j2me.socket.SocketConnection-BaseStationPort

The first three control the radio’s operation; see section Using manifest properties to adjust the radio. The last two control the socket connection that underpins http access: see the section Configuring the http protocol.

Using the Basestation

Overview

The purpose of the Sun SPOT Basestation software is to allow applications running on the Host to interact with applications running on Targets. The physical arrangement is:

14

Image 14
Contents Page Page Contents Http protocol support Introduction Building and deploying Sun Spot applications Deploying and running a sample applicationBuild Successful Total time 3 seconds \MyApplication Ant -Dport=COM2 info Total time 4 seconds \MyApplication Total time 0 seconds \MyApplication Deploying a pre-existing jar Incorporating utility classes into your applicationOther user properties Manifest and resourcesExcluding files from the compilation Overview Using the BasestationBuilt-in properties Set up Introduction Base Station configurationRemote operation Connect a Sun Spot base station Take suitable actions during over-the-air downloads Using short names for SPOTsManaging keys and sharing Sun SPOTs BackgroundChanging the owner of a Sun Spot Sharing Sun SPOTsGenerating a new key-pair What is protected?Deploying and running a host application LimitationsIncorporating pre-existing jars into your host application Configuring network featuresYour own host application Mesh routingLogging Hardware configurations and USB powerTrace route Page Thread priorities Overview of an applicationThreads Device Interface Sun Spot device librariesSun Spot device library Persistent properties Accessing flash memory Overriding the Ieee addressUsart Radio communication library Program Radiogram protocol Client end Server endYou can open server radiogram connections in a similar way Broadcasting Radio properties Turning the receiver off and on Shallow Sleep Conserving power using deep sleep modeMonitoring radio activity Activating deep sleep mode Deep SleepDeep sleep behaviour of the standard drivers USB inhibits deep sleepPreconditions for deep sleeping Device Condition to permit deep sleepWriting a device driver Configuring the http protocol Http protocol supportConfiguring projects in an IDE Socket Proxy GUI modeDebugging Classpath configurationJavadoc/source configuration Ant selectapplication Configuring NetBeans as a debug client Configuring Eclipse as a debug clientUsing library suites Advanced topicsWith adderlib as your current directory, execute the command Use the command Using the spot client SpotSerialPortException other exception in serial port comms Property name Meaning ReferencePersistent system properties Memory usage Contents of the arm directoryContents of the lib directory Start address Space UseContents of the bin directory preverify.exe Contents of the upgrade directory Contents of the tests directory