Sun Microsystems V2.0 manual Configuring projects in an IDE, Socket Proxy GUI mode

Page 42

HTTP Proxy

If the host computer running the Socket Proxy is behind a proxy server, the device can still access the Internet if the following property is specified in the MANIFEST.MF:

com.sun.squawk.io.j2me.http.Protocol-HttpProxy: <proxyaddress>:<port>

where proxyaddress is the hostname or IP address of the HTTP proxy server and port is the proxy's TCP port.

Socket Proxy GUI mode

The SocketProxy program actually has two modes it can run in. The default as shown earlier, which presents a headless version. There is also a GUI version that allows you to view log information and see what is actually going on. To launch the proxy in GUI mode, issue the following command

ant socket-proxy-gui

This will present you with the following window:

base station's serial port the serial port that the base station is connected to. This is automatically

 

populated by the calling scripts.

Radiogram port

the radiogram port used to establish the initial connection.

 

This panel lets the user select the logging level to use. The log level

 

affects which logs are to be displayed in the log panel.

 

1.

System: log all that is related to the proxy itself

 

2.

Error: log all that is an error (exceptions)

 

3.

Warning: log all that is a warning

 

4.

Info: log all extra information (incoming connections, closing connections)

 

5.

I/O: log all I/O activities

Radio port usage

the SocketProxy reserves a radio port for every Sun SPOT connected to it.

 

This counter lets you monitor that activity. Whenever the SocketProxy

 

runs out of radio ports, it will say so in here and stop accepting new

 

connections until some ports get freed up.

The log level can be set with the socketproxy.loglevel property in the SDK's default.properties file. The log levels are the same as in the GUI mode but they are set in a complementary way. So if warning is selected as a level, the level will actually be system, error and warning.

The default radiogram port used for the initial connection can be set with the socketproxy.initport property in the SDK's default.properties file.

Configuring projects in an IDE

This section includes general-purpose notes for setting up all IDEs. We assume that the reader is familiar with his or her own IDE, and in particular, incorporating the various ant scripts that this guide refers to.

42

Image 42
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 applicationManifest and resources Excluding files from the compilationOther user properties Using the Basestation Built-in propertiesOverview Set up Base Station configuration Remote operationIntroduction 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 routingHardware configurations and USB power Trace routeLogging Page Overview of an application ThreadsThread priorities Sun Spot device libraries Sun Spot device libraryDevice Interface 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 Conserving power using deep sleep mode Monitoring radio activityShallow Sleep 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 modeClasspath configuration Javadoc/source configurationDebugging 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 Reference Persistent system propertiesProperty name Meaning 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