Here is the original thread I followed to do steps below: https://www.sunspotworld.com/forums/viewtopic.php?t=1078&highlight=ant
1. Run your target SPOT Host application using ant in command line in Windows:
ant host-run -v
This will cause ant to show you the full arguments it is passing to the java executable, which you can then use yourself. Like this below:
...
-do-host-run:
[java] Executing 'C:\Program Files\Java\jdk1.6.0_04\jre\bin\java.exe' with
arguments:
[java] '-Djava.library.path=C:/Program Files/Sun/SunSPOT/sdk/lib;'
[java] '-DSERIAL_PORT=COM9'
[java] '-Dremote.channel=26'
[java] '-Dremote.pan.id=3'
[java] '-Dspot.mesh.route.logging=false'
[java] '-Dspot.log.connections=true'
[java] '-Dspot.basestation.sharing=false'
[java] '-Dspotclient.addin.classes=com.sun.spot.client.command.spotworld.Sp
otWorldSpotClientExtension,'
[java] '-classpath'
[java] 'D:\Projects\new\Demos\TelemetryDemo\Telemetry-onDesktop\build;C:\Pr
ogram Files\Sun\SunSPOT\sdk\lib\multihoplib_rt.jar;C:\Program Files\Sun\SunSPOT\
sdk\lib\transducerlib_rt.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\spotworldext_r
t.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\spotlib_host.jar;C:\Program Files\Sun
\SunSPOT\sdk\lib\spotlib_common.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\squawk_
classes.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\RXTXcomm.jar;C:\Program Files\S
un\SunSPOT\sdk\lib\spotclient.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\desktop_s
igning.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\spotworldext_spotclient.jar;D:\P
rojects\new\Demos\TelemetryDemo\Telemetry-onDesktop'
[java] 'org.sunspotworld.demo.TelemetryFrame'
[java]
[java] The ' characters around the executable and arguments are
[java] not part of the command.
[java] [radiogram] Adding: Server on port 42
[java] [radiogram]Removing: Server on port 42
[java] Accelerometer Reader Thread Started ...
[java] [radiogram] Adding: Broadcast on port 43
[java] [radiogram]Removing: Broadcast on port 43
[java] [radiogram] Adding: Server on port 42
[java] [radiogram] Adding: Broadcast on port 43
[java] [radiogram]Removing: Broadcast on port 43
[java] [radiogram] Adding: Broadcast on port 43
[java] [radiogram]Removing: Broadcast on port 43
[java] Received request from: 0014.4F01.0000.0E90
[java] [radiogram]Removing: Server on port 42
[java] [radiogram] Adding: Output to 0014.4F01.0000.0E90 on port 43
[java] [radiogram] Adding: Input from 0014.4F01.0000.0E90 on port 43
[java] Accelerometer scale is set to 2G
[java] Accelerometer zero offsets:
[java] 2G: 465.0, 465.0, 465.0
[java] 6G: 465.0, 465.0, 465.0
[java] Accelerometer gains:
[java] 2G: 186.0, 186.0, 186.0
[java] 6G: 62.0, 62.0, 62.0
[java] Accelerometer rest offsets:
[java] 2G: 465.0, 465.0, 651.0
[java] 6G: 465.0, 465.0, 527.0
-post-host-run:
host-run:
BUILD SUCCESSFUL
Total time: 1 minute 16 seconds
D:\Projects\new\Demos\TelemetryDemo\Telemetry-onDesktop>
2. Extract arguments from printout. In this case, the red lines are arguments used in this application. So I try to grab them out. Here below is the command with arguments thant can be executed without ant:
java -Djava.library.path="C:/Program Files/Sun/SunSPOT/sdk/lib"; -DSERIAL_PORT=COM9 -Dremote.channel=26 -Dremote.pan.id=3 -Dspot.mesh.route.logging=false -Dspot.log.connections=true -Dspot.basestation.sharing=false -Dspotclient.addin.classes=com.sun.spot.client.command.spotworld.SpotWorldSpotClientExtension, -classpath "D:\Projects\new\Demos\TelemetryDemo\Telemetry-onDesktop\build;C:\Program Files\Sun\SunSPOT\sdk\lib\multihoplib_rt.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\transducerlib_rt.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\spotworldext_rt.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\spotlib_host.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\spotlib_common.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\squawk_classes.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\RXTXcomm.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\spotclient.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\desktop_signing.jar;C:\Program Files\Sun\SunSPOT\sdk\lib\spotworldext_spotclient.jar;D:\Projects\new\Demos\TelemetryDemo\Telemetry-onDesktop" org.sunspotworld.demo.TelemetryFrame
3. It works! Enjoy :)
没有评论:
发表评论