Sun Microsystems V2.0 manual Debugging, Classpath configuration, Javadoc/source configuration

Page 43

Classpath configuration

The classpath for an application that runs on a Sun SPOT needs to include the following jars in this order:

SDK_INSTALL_DIRECTORY/lib/transducerlib_rt.jar

SDK_INSTALL_DIRECTORY/lib/multihoplib_rt.jar

SDK_INSTALL_DIRECTORY/lib/spotlib_device.jar

SDK_INSTALL_DIRECTORY/lib/spotlib_common.jar

SDK_INSTALL_DIRECTORY/lib/squawk_rt.jar

The classpath for a host application that uses the base station needs to include the following jars in this order:

SDK_INSTALL_DIRECTORY/lib/multihoplib_rt.jar

SDK_INSTALL_DIRECTORY/lib/spotlib_host.jar

SDK_INSTALL_DIRECTORY/lib/spotlib_common.jar

SDK_INSTALL_DIRECTORY/lib/squawk_classes.jar

Javadoc/source configuration

Source is included for these jars:

transducerlib_rt.jar

SDK_INSTALL_DIRECTORY/src/transducerlib_source.jar

multihoplib_rt.jar

SDK_INSTALL_DIRECTORY/src/multihoplib_source.jar

spotlib_device.jar

SDK_INSTALL_DIRECTORY/src/spotlib_source.jar

spotlib_common.jar

SDK_INSTALL_DIRECTORY/src/spotlib_source.jar

spotlib_host.jar

SDK_INSTALL_DIRECTORY/src/spotlib_host_source.jar

Javadoc for all the above and for squawk_rt.jar can be found in:

SDK_INSTALL_DIRECTORY/doc/javadoc

Debugging

The Squawk high-level debugger uses the industry-standard JDWP protocol and is compatible with IDEs such as NetBeans and Eclipse. Note that it is not currently possible to debug a SPOT directly connected via USB, but instead, the target SPOT must be accessed remotely via a base station.

The Squawk high-level debugger comprises the following:

A debug agent (the Squawk Debug Agent, or SDA) that executes in the Sun SPOT being debugged. The agent is responsible for controlling the execution of the installed application.

A debug client, such as JDB, NetBeans or Eclipse.

A debug proxy program (the Squawk Debug Proxy, or SDP) that executes on the desktop. The proxy communicates, over the air via a Sun SPOT base station, between the debug client and the debug agent.

To use the high-level debugger do the following:

1.Set up a standard Sun SPOT base station.

2.Build and deploy your application as normal, either via USB or over-the-air.

3.Ensure that the SPOT running your application has the OTA Command Server enabled:

ant enableota

4. In the root directory of your application do

ant debug –DremoteId=xxxx -Dbasestation.addr=yyyy

43

Image 43
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 Background Using short names for SPOTsManaging keys and sharing Sun SPOTs Take suitable actions during over-the-air downloadsSharing Sun SPOTs Changing the owner of a Sun SpotLimitations What is protected?Deploying and running a host application Generating a new key-pairMesh routing Configuring network featuresYour own host application Incorporating pre-existing jars into your host applicationTrace route Hardware configurations and USB powerLogging 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 modeDevice Condition to permit deep sleep USB inhibits deep sleepPreconditions for deep sleeping Deep sleep behaviour of the standard driversWriting 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 Start address Space Use Contents of the arm directoryContents of the lib directory Memory usageContents of the bin directory preverify.exe Contents of the tests directory Contents of the upgrade directory