Sun Microsystems V2.0 manual Radio properties

Models: V2.0

1 54
Download 54 pages 11.11 Kb
Page 35
Image 35

The following table explains the current usage of ports in the reserved range.

Port

Protocol

Usage

number

 

 

8

radiogram://

OTA Command Server

9

radiostream://

Debugging

10

radiogram://

http proxy

11

radiogram://

Manufacturing tests

12

radiostream://

Remote printing (Master isolate)

13

radiostream://

Remote printing (Child isolate)

20

radiogram://

Trace route server

Radio properties

Changing channel, pan id and output power

The RadioPolicyManager provides operations for changing the radio channel, the PAN Id and the transmit power. For example:

IRadioPolicyManager rpm = Spot.getInstance().getRadioPolicyManager(); int currentChannel = rpm.getChannelNumber();

short currentPan = rpm.getPanId();

int currentPower = rpm.getOutputPower(); rpm.setChannelNumber(11); // valid range is 11 to 26 rpm.setPanId((short) 6); rpm.setOutputPower(-31); // valid range is -32 to +31

There are some important points to note about using these operations:

The most important point is that changing the channel, Pan Id or power changes it for all connections.

If the radio is already turned on, changing the channel or Pan Id forces the radio to be turned off and back on again. The most significant consequence of this is that remote devices receiving from this radio may detect a "frame out of sequence" error (reported as an IOException). The radio is turned on when the first RadiogramConnection is opened, or when the first input stream is opened on a RadioConnection.

Adjusting log output

It is possible to disable the log messages displayed via System.out each time a connection is opened or closed. To do this set the system property spot.log.connections to false. To do this using an ant command:

ant set-system-property –Dkey=spot.log.connections –Dvalue=false

To do this from within an application:

Spot.getInstance().setProperty("spot.log.connections", false);

For host programs, use:

ant host-run -Dspot.log.connections=false

Using manifest properties to adjust the radio

The initial values of the channel, Pan Id and transmit power can be specified using properties in the application manifest. The properties are:

35

Page 35
Image 35
Sun Microsystems V2.0 manual Radio properties