Sun Microsystems V2.0 manual Ant selectapplication

Page 44

where xxxx is the id of the SPOT running the application being debugged and yyyy is the id of your base station. Note that xxxx can be a short name, as described in the Remote section, but yyyy cannot. If you regularly use the same basestation you can define the basestation.addr property in the .sunspot.properties file in your user root folder and then omit it from the command line.

The SPOT will be restarted with the SDA running; your application will not start. Then the SDP will be started and will communicate with the SPOT. This takes a few seconds. The output should look something like this:

C:\arm9\AirText>ant debug -DremoteId=spot1

Buildfile: build.xml

. . .

-main-find-spots:

[echo] Using Sun SPOT basestation on port COM7

. . .

-run-spotclient:

[java]

My IEEE

address is 0000.0000.0000.0001

[java]

Waiting

for target to synchronise...

[java]

(please

wait for remote SPOT spot1 to respond)

[java]

(if no response ensure SPOT is running OTACommandServer)

[java]

Remote Monitor (1443-20060717)

[java]

SPOT serial number = 0014.4F01.0000.0080

[java]

Writing Configuration(1080 bytes) to remote Spot

[java]

[java]

Exiting

 

[delete]

Deleting: C:\SunSPOT\dev\temp\spot-temp-1157051385

. . .

-do-debug-proxy-run:

[java] Starting hostagent...

[java] My IEEE address is 0000.0000.0000.0001

[java] Done starting hostagent

[java] Trying to connect to VM on radio://spot1:9

[java] Established connection to VM (handshake took 62ms)

[java] Waiting for connection from debugger on serversocket://:2900

5.Start a remote debug session using your preferred debug client. The process for doing this varies from client to client, but you need to use a socket connection on port 2900. When the connection from the debug client to the SDP is closed at the end of the debug session the SDP will exit and return to the command prompt. Output generated by the application using System.out or System.err will be displayed in the proxy window.

6.To take the remote SPOT out of debug mode so that it just runs your application do:

ant selectapplication

Limitations

The current version of the debugger has some limitations that stem from the fact that when using the debugger, the application runs in a child isolate.

44

Image 44
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 Using short names for SPOTs Managing keys and sharing Sun SPOTsTake suitable actions during over-the-air downloads BackgroundChanging the owner of a Sun Spot Sharing Sun SPOTsWhat is protected? Deploying and running a host applicationGenerating a new key-pair LimitationsConfiguring network features Your own host applicationIncorporating pre-existing jars into your 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 SleepUSB inhibits deep sleep Preconditions for deep sleepingDeep sleep behaviour of the standard drivers 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 Contents of the arm directory Contents of the lib directoryMemory usage Start address Space UseContents of the bin directory preverify.exe Contents of the upgrade directory Contents of the tests directory