Sun Microsystems V2.0 Uživatelský manuál

Procházejte online nebo si stáhněte Uživatelský manuál pro Softwarové příručky Sun Microsystems V2.0. Sun Microsystems V2.0 User's Manual Uživatelská příručka

  • Stažení
  • Přidat do mých příruček
  • Tisk

Shrnutí obsahu

Strany 1

Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. Sun™ Small Programmable Object Technology (Sun SPOT) Developers’ Guide This vers

Strany 2

10 [exec] [Adding property key: MIDlet-Vendor value: Sun Microsystems Inc] [exec] [Adding property key: MIDlet-1 value: Spottests,, squawk.

Strany 3 - Contents

11 -do-init: -post-init: init: environment: [java] To configure the environment for Squawk, try the following command: [java] set

Strany 4

12 [java] -------------------------------------------------------------------- [java] Hits - Class:95.74% Monitor:92.38% Exit:100.0

Strany 5 - Introduction

13 Excluding files from the compilation To exclude files or folders matching a specific pattern from the java compilation, set the ant property spot.

Strany 6

14 resources/META-INF/MANIFEST.MF within its root folder. The adderlib extension has such a file, whose content is FavouriteSnake: Viper This de

Strany 7

15 HostSun SPOT(“base s tation”)Sun SPOT(“Target”)USB802.15.4 radio The Host can be any of the supported platforms (e.g. Windows PC, Mac). The Host a

Strany 8

16 Base Station configuration It is possible to select a channel and pan id for the base station using command line properties in conjunction with an

Strany 9

17 To configure the SPOT so that this thread is started each time the SPOT starts issue this command via a USB connection: ant enableota The SPOT

Strany 10

18 remote.pan.id either on the command line or in the .sunspot.properties file in your user root folder. Using short names for SPOTs As a shortcut, i

Strany 11

19 Even if you aren’t concerned about security, you need to be aware of this if you want to be able to use Sun SPOTs interchangeably amongst two or m

Strany 12

2 Copyright © 2007 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved. Sun Microsystems, Inc. ha

Strany 13 - Manifest and resources

20 ant deploy for each Sun SPOT. What is protected? Applications and customized libraries are always verified and unless the digital signature can b

Strany 14 - Using the Basestation

21 When the switch is specified a basestation will still be correctly identified if one is available, but if no basestation is available the port pr

Strany 15 - Sun SPOT

22 For situation 2 above you should configure the SPOT as a dedicated mesh router, using the command: ant selectmeshrouter When the SPOT is reset

Strany 16 - Remote operation

23 critical during the USB enumeration which occurs when plugging in a new device. During this phase the SPOT may only draw 20% (100mA) of its full p

Strany 17

24 Developing and debugging Sun SPOT applications Overview of an application A Sun SPOT application is actually implemented as a MIDlet. This should

Strany 18

25 The libraries only use system priorities in three cases: 1. To guarantee that application threads don't run during a system operation during

Strany 19

26 Each physical device is controlled by a single instance of the respective class, accessed through the interfaces listed above. The single instance

Strany 20

27 - there is a possibility that another isolate has written a new value for the property since the current isolate started - your application has

Strany 21 - Configuring network features

28 example above two sectors are allocated (and thus erased), starting with the first sector available to applications. Using the Record Management S

Strany 22 - 0014.4F01.0000.0006

29 Configuring USART parameters The URL for USART access can uniquely be extended with additional parameters to configure the USART if required. For

Strany 23

3 Contents Introduction ...

Strany 24 - Threads

30 The radiogram protocol provides datagram-based communication between two devices. This protocol provides no guarantees about delivery or ordering.

Strany 25

31 Program 2 RadiostreamConnection conn = (RadiostreamConnection) Connector.open("radio://0014.4F01.0000.0007:100"); DataInputStream dis =

Strany 26

32 where serverAddr is the 64bit IEEE Address of the radio of the server, and portNo is a port number in the range 0 to 255 that identifies this par

Strany 27 - Using IFlashMemoryDevice

33 There are some points to note about using datagrams: • Only datagrams obtained from the connection may be passed in send or receive calls on the

Strany 28 - Configuration

34 There are some important points to note about using this operation: • If setting a timeout it must be set before opening streams or creating dat

Strany 29 - About the radio stack

35 The following table explains the current usage of ports in the reserved range. Port number Protocol Usage 8 radiogram:// OTA Command Server 9

Strany 30

36 DefaultChannelNumber DefaultPanId DefaultTransmitPower Turning the receiver off and on The radio receiver is initially turned off, but turns on a

Strany 31 - The radiogram protocol

37 RSSI (received signal strength indicator) measures the strength (power) of the signal for the packet. It ranges from +60 (strong) to -60 (weak). T

Strany 32

38 • CPU – power on but CPU clock off (the CPU's power saving mode) • Master system clocks – power on • Low level firmware – power on • RAM

Strany 33 - Using system allocated ports

39 If it is important that your application knows whether or not deep sleep happened, then you can alternatively execute this code: ISleepManager s

Strany 34 - Port number usage

4 Writing a device driver...

Strany 35

40 2. Of all threads executing a Thread.sleep() it determines which will resume soonest. If the sleep interval is less than the minimum deep sleep t

Strany 36 - Signal strength

41 http protocol support The http protocol is implemented to allow remote SPOT applications to open http connections to any web service accessible fr

Strany 37

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 prop

Strany 38

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_D

Strany 39

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 na

Strany 40

45 Using non-default channel or pan id It is not possible for an application being debugged to select dynamically a different channel or pan id. Inst

Strany 41

46 Expand each of the first four of these, then select and edit the “Source attachment”. Point this to the relevant source jar as follows: transduce

Strany 42

47 Start by copying LibraryExtensionSampleCode to a working area. This contains two sub-directories: adderlib and addertest. adderlib contains the li

Strany 43 - Debugging

48 Note that by default, the library is built without line number information to save space in flash memory. For debugging purposes, you may find it

Strany 44

49 The source code for the libraries is supplied in three parts: spotlib_source.jar contains the code that supports the SPOT main board; multihop_sou

Strany 45 - Unexpected exceptions

5 Introduction The purpose of this guide is to aid developers of applications for Sun SPOTs. The guide is divided into two sections. Building and de

Strany 46 - Advanced topics

50 Wire objects together At system startup, a development tool should create and wire together various objects. This code shows the general style: S

Strany 47

51 Reference Persistent system properties Property name Meaning spot.hardware.rev spot.powercontroller.firmware.version spot.sdk.version spot.exter

Strany 48 - Running startup code

52 Memory usage The Sun SPOT flash memory runs from 0x10000000 to 0x10400000 (4M bytes), and is organized as 8 x 8Kb followed by 62 x 64Kb followed b

Strany 49 - Implementing IUI

53 debugger_classes.jar The classes of the Sun SPOT high-level debugger. Used by the debug proxy. desktop_signing.jar Classes that are used to secu

Strany 50 - Execute commands

54 Contents of the src directory: multihoplib_source.jar Source code for the radio communications stack. sdproxylauncher_source.jar Source code fo

Strany 51 - Reference

6 Building and deploying Sun SPOT applications Deploying and running a sample application The normal process for creating and running an application

Strany 52

7 [delete] Deleting directory C:\MyApplication\build [delete] Deleting directory C:\MyApplication\suite [delete] Deleting directory C:\MyApp

Strany 53

8 -post-init: init: -override-warning-find-spots: -main-find-spots: [echo] Using Sun SPOT device on port COM45 -do-find-spots: slots: -ru

Strany 54

9 or ant –Dport=COM2 info The difference between these two commands is that the “spotport” version will check that there is a Sun SPOT connected to

Komentáře k této Příručce

Žádné komentáře