Home

JAVA User's Guide

image

Contents

1. 36 Figure 17 Scenario for testing data rates on ASC1 with GPRS data upload 37 Figure 18 Scenario for testing data rates on ASC1 with GPRS data download 38 Figure 19 OTAP OVeniew si cise c3 Gaince glen teas ath atau teeta c Ach mateais dusted dopaekn das gant dos Galles cov gate 44 Figure 20 OTAP Install Update Information Flow messages in brackets are optional 48 Figure 21 OTAP Delete Information Flow messages in brackets are optional 49 Figure 22 Create new Eclipse project Create a J2ME MIDP Midlet Suite 68 56 Figure 23 Create new Eclipse project New J2ME Project ccccccccceeeeeeeeeeeeeeeeeeeeeeeeeeees 56 Figure 24 Create new Eclipse project Midlet Suite Properties ccceeeeeeeeeeeeeeeeeeees 57 Figure 25 Create new Eclipse project work area with new created project eee 57 Figure 26 Create new Eclipse project Create a J2ME Midlet ssssssseeseeeeeeeeeeeeees 58 Figure 27 Create new Eclipse project Create a New J2ME Midlet sssseseeeeeeeeeee 58 Figure 28 Create new Eclipse project Edit some Java commands eeeeeeeeeeeeeeeeeee 59 Figure 29 Create new Eclipse project Edit deployed path to Jar file cc eeeeeeeeeeeeee 59 Figure 30 Data flow of a Java application in the debug environment sseeeeeeeeeees 61 Figure 31 NetBea
2. cccceeeseeeeee 14 3 3 Setup Java Development Environment with Eclipse IDE Quick Start up 15 3 4 Siemens Mobility Toolkit Installation ccceeeccceeeeseeeeeeeeeeeeeeeneeeeeeeeeeeeeeeeaaees 17 3 4 1 Installing the Standard Development Toolkit eres 17 3 4 2 Installing the SMTK Environment c cccceeeeeeeeeeeeeeeeeeeeeeeeseeeenaaees 17 3 4 3 Installing NetBeans IDE 5 bc veces eens eee enti veescerrend erent eer edi ates 19 3 4 4 Installing Eclipse 3 0 or Eclipse 3 1 0 0 ccccceeeeeceeeeeeeeeeeeeeeeeeeeeeeeeeaes 19 3 4 5 Installing Borland JBuilder X 2005 and 2006 Enterprise Developer 19 3 4 6 Installing Module Exchange Suite MES eeeeseeeeeeeeeeeeeeeeneees 19 3 5 SMTK UninStalll saorane si hudsaneu leds ita luda a a a a a aas 20 3 6 Upgrades rnern sort iora erte apane tort SEERE E ope oe sora e SOTE aeea ia oia sadesenciaed 20 Software Platform wesisiescetecendsbensvsectiensedsseasvescreesesdsSousversteeanedssedersbsvensesccsensvessteennvcesees 21 4 14 Software Architecture 22ca5240 s0450 0 carae SanaeavAcsuavandosnaiantosuaandosaseadsosuatandesauiactotechs 21 42 MMC ACES ss cobes sees a a Coad ocd testa ws Soren oan Baa wd Wad ee absent vee nee ened Goa es 22 4 2 1 ASCO Serial DeViCC eeeesssessssseeesesssssssssssssessessssssseesssseseseseeees 22 4 2 2 General Purpose I O 0 0 0 0 ceeessssssssssssssssssssssssssssssssssssssessseesssssseeseseeees 22 4 23 IDACIAD C
3. SIEMENS SPINS S S wiVAVE JAVA User s Guide SIEM ENS Confidential Released General Notes Product is deemed accepted by recipient and is provided without interface to recipient s products The documentation and or product are provided for testing evaluation integration and information purposes The documentation and or product are provided on an as is basis only and may contain deficiencies or inadequacies The documentation and or product are provided without warranty of any kind express or implied To the maximum extent permitted by applicable law Siemens further disclaims all warranties including without limitation any implied warranties of merchantability completeness fitness for a particular purpose and non infringement of third party rights The entire risk arising out of the use or performance of the product and documentation remains with recipient This product is not intended for use in life support appliances devices or systems where a malfunction of the product can reasonably be expected to result in personal injury Applications incorporating the described product must be designed to be in accordance with the technical specifications provided in these guidelines Failure to comply with any of the required procedures can result in malfunctions or serious discrepancies in results Furthermore all safety instructions regarding the use of mobile technical systems including GSM products which also apply to cel
4. atch InterruptedException e ystem out printlin e nadtat System out printin ThreadDemo notifyDestroyed TC65_AC75_JAVA User s Guide_V08 pauseApp Page 104 of 105 Exception starting threads Waiting 4 seconds before stopping threads Closing application cond Stopping threads from outsdide Waiting for threads to die All threads died 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 14 Differences to the TC45 For those who are familiar with the Siemens WM IMP1 0 product TC45 this is an overview of the main differences between this and the IMP NG product line e g TC65 real TCP and UDP access interfaces SocketConnection ServerSocketConnection UDPDatagramConnection Use of StreamConnection StreamConnectionNotifier DatagramConnection is now discouraged CommConnection can access both RS232 interfaces ASCO and ASC1 Standard out can be directed to any of the serial interfaces ASCO ASC1 USB or written to the flash file system No IO pin multiplexing GPIOs DAI and the serial interface for CommConnection do not share any pins so the selection mechanism no longer exists The CommConnection interface which used to be proprietary com siemens icm io is now part of the standard package javax microedition io No interface emulation on the PC When running a MIDlet under the emulator it is completely
5. 5 4 Charging Please refer to 3 and 4 for general information about charging Charging can be monitored by the running Java application The JVM is active in Charge mode and in Charge Only mode if autostart is activated Only a limited number of AT commands are available when the module is in Charge Only mode A Java application must be able to handle the Charge Only mode and reset the module to reinstate the normal mode See 4 for information about the Charge Only mode The Charge Only mode is indicated by URC SYSSTART CHARGE ONLY MODE Note When a Java application is started in Charge Only mode only AT Command APIs without CSD are available The mode indicating URC is created after issuing the very first AT command on any opened channel To read the URC it is necessary to register a listener see 5 on this AT command API instance before passing the first AT command TC65_AC75_ JAVA User s Guide_V08 Page 29 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 5 5 Airplane Mode The main characteristic of this mode is that the RF is switched off and therefore only a limited set of AT commands is available The mode can be entered or left using the appropriate at scfg command This AT command can also be used to configure the airplane mode as the standard startup mode see 4 The JVM is started when autostart is enabled A Java application must be able to handle this mode The airplane mode is indicated
6. Confidential Released Select path where Eclipse ME plugin is located on CD EclipseMEplugin_123 and select eclipseme feature_1 2 3_site zip Search Results Select features to install from the search result list he features to install ifeclipseme feature_1 2 3_site zip Deselect All suo Eclipsele ASS Eclipseeie 1 2 3 Select Required EclipseME Update Site 1 of 1 selected M Show the latest version of a feature only Filter features included in other features on the list Figure 4 Installation of Eclipse ME Plugin 1 2 3 dialog box Search Results Select Install All in dialog box verification Select Yes for restart Eclipse in dialog box Install Update installUpdate Tt is recommended you restart the workbench for the changes to take effect s but it may be possible to apply the changes to the current configuration without restarting Would you like to restart now No Apply Changes Figure 5 Installation of Eclipse ME Plugin 1 2 3 dialog box Restart Eclipse Eclipse IDE is restarted Please close Eclipse IDE before continuing with installation of SMTK Step 4 Installation of the product s SMTK Start setup exe from CD root path Choose Destination Folder of Eclipse C Program Files Eclipse in dialog box Select Eclipse Folder Select SMTK e g C Program Files Siemens SMTK in dialog box Destination Folder Select COM port and set baud r
7. LFG ar MELTA An adine i not avelatie iy Semere MPNA ICES RA Ge verfed Project jad i Problems Javadoc Decker abon O errors warnings fos Description Resarce Figure 25 Create new Eclipse project work area with new created project TC65_AC75_JAVA User s Guide_V08 Page 57 of 105 2006 06 12 JAVA User s Guide Confidential Released SIEMENS Select Project01 and press lt Ctrl N gt and select J2ME Midlet Sit O TI ex chy i Proyector m HE ktrary Siemens IMPNG T wizards veted chee D Projecto jad interfaco WE Java Project SE Java Project from Existing Ant Sadie Ge Plugin Project E Product Configuration S cvs amp we G i NE Mdet Ste lave amp Mun Develooment Op Sge lt PropectOt Figure 26 Create new Eclipse project Create a J2ME Midlet Fill in Midlet parameters package directory name of Java source file and press lt Finish gt J2ME Midlet Create a New J2ME Midlet Source folder ProjectO1 Browse Package G sre gt Browse Enclosing type rowse Name lt Torintmel gt Modifiers public C defaut C te C abstract final jz Superclass javax microedition midlet MIDlet Browse Interfaces Add po Leo Which methods should be created Iv Superclass constructors V Unimplemented abstract methods Add To Application Descriptor Figure 27 Create new Eclipse project Crea
8. MIDP OTA OTAP PDP PDU SDK SMS SMTK TCP URC URL VBS WTK Terms and Abbreviations Description Application Program Interface Asynchronous Serial Controller Connected Limited Device Configuration Circuit Switched Data Digital Audio Interface Data Carrier Detect Data Set Ready General Purpose I O General Packet Radio Service Global Positioning System Hypertext Transfer Protocol Input Output Integrated Development Environment Internet Protocol Java 2 Mobile Edition Java 2 Standard Edition Java Application Description Java Archive Java Development Kit Java Virtual Machine Light Emitting Diode Mobile Equipment Module Exchange Suite Mobile Information Device Protocol Over The Air Over The Air Provisioning of Java Applications Packet Data Protocol Protocol Data Unit Standard Development Kit Short Message Service Siemens Mobile Toolkit Transfer Control Protocol Unsolicited Result Code Universal Resource Locator Visual Basic Script Wireless Toolkit TC65_AC75_JAVA User s Guide_V08 Page 11 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 3 Installation 3 1 System Requirements The Siemens Mobility Toolkit SMTK requires that you have Windows 2000 or Windows XP installed 40Mbytes free disk space for SMTK Administration privileges Java 2 SDK Standard Edition 1 4 To install the JDK version 1 4 2_09 provided follow the instructions in Section 3 4 1 aS If
9. administrator for help TC65_AC75_ JAVA User s Guide_V08 Page 62 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 11 3 Java IDE The SMTK is integrated into your Java IDE during installation Please note that the IDE integration is intended to create MIDlets suitable for the Java enabled module and for debugging using the emulator JAR files used in the module must be configured according to the batch file examples given If the SMTK install succeeded you can easily switch between the Siemens environment and Standard JDK environment the special libraries APls and emulators are available and AT commands can be sent to the module Regular function of the IDE for non Siemens projects is unchanged Using the debugger please keep in mind that the MIDlet URL included in the Jad file has to indicate and store the location where the emulator will find the corresponding Jar file Generally the location will only be the file name for the Jar file If you are using Eclipse IDE the location of the Jar file is deployed lt filename gt jar Please check this path name inside the Jad file before starting a debugging session with Eclipse IDE and change it manually if the deployed subdirectory is missing Please keep in mind that the subdirectory deployed is used as a default setting in the Eclipse IDE and can be changed by the user within the Eclipse menu While using on device debugging the ME is restarted
10. are required for a proper work of SMTK on device debugging Note for customers migrating from TC45 to TC65 If you uninstall the TC45 software after the installation of TC65 you need to run the TC65 SDK and MES setup in maintenance mode to restore several files required for TC65 To do so open the Windows Control Panel double click Add or Remove Programs select TC65 Software Development Kit press the Change Remove button and select Repair In the same manner reinstall the Siemens Module Exchange Suite MES As an alternative to avoid this step remove the TC45 package before installing TC65 SDK and MES 3 6 Upgrades The SMTK can be modified repaired or removed by running the setup program on the Installation CD TC65_AC75_ JAVA User s Guide_V08 Page 20 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 4 Software Platform In this chapter we discuss the software architecture of the SMTK and the interfaces to it 4 1 Software Architecture The SMTK enables a customer to develop a Java application on a PC and have it be executable on the Java enabled module The application is then loaded onto the module The platform comprises e Java 2 Micro Edition J2ME which forms the base of the architecture The J2ME is provided by SUN Microsystems http java sun com j2me It is specifically designed for embedded systems and has a small memory footprint The ME uses CLDC 1 1 HI the conne
11. secure mode the output is written directly to the file 5 9 3 UDP Redirection to a UDP socket is used in conjunction with the debugger UDP is used by default when using on device debugging see chapter 11 This can be changed by editing the emulators ini file If the output is redirected to an UDP socket any changes of the System out configuration are ignored while the Virtual Machine is running The UDP Socket settings will not be stored in the module 5 10 Restrictions 5 10 1 Flash File System The maximum length of a complete path name including the path and the filename is limited by the Flash file system on the module to 124 characters It is recommended that names of classes and files be distinguished by more than case sensitivity 5 10 2 Memory The CLDC 1 1 HI features a just in time compiler This means that parts of the Java byte code which are frequently executed are translated into machine code to improve efficiency This feature uses up RAM space There is always a trade off between code translation to speed up execution and RAM space available for the application TC65_AC75_ JAVA User s Guide_V08 Page 33 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 5 11 Performance The performance study was focused on comparable performance values under various circumstances 5 11 1 Java This section gives information about the Java command execution throughput jPS Java statements per
12. 1 A suitable Manifest file for the JAD file above might look like Manifest Version 1 0 MIDlet Name MyTest MlDlet Version 1 0 1 MlDlet Vendor TLR Inc MlDlet 1 MyTest example mytest MyTest MicroEdition Profile IMP NG MicroEdition Configuration CLDC 1 1 8 6 Procedures 8 6 1 Install Update OTAP Java Application TC65 Controller Server Parameter SMS gt SMS password check a Parameters collection Parameter SMS with START install gt Combination of SMS parameter set and AT parameter set If parameter set complete Close running Java application yno w L umopeso D HTTP request for jad file Start install update procedure lt HTTP basic authentication i n Download jad file HTTP jad file download 5 e HTTP Post Error If Error post and reboot Le HTTP request for jar file HTTP basic authentication a z HTTP download of jar file a Download jar file le HTTP Post Result Post result If success install and change autostart Reboot no w L aes y Reboot Figure 20 OTAP Install Update Information Flow messages in brackets are optional TC65_AC75_JAVA User s Guide _V08 Page 48 of 105 2006 06 12 JAVA User s Guide Confidential Released SIEMENS When an SM with keyword START install is received and there is a valid parameter set for the operation the module always reboots either when the operation completed an error occur
13. 1 also implies calling the destroyApp method Note that AT CFUN x 1 will restart the module to restart Java afterwards either use the autostart mode configured with AT SCFG or restart Java with ATASJRA From this you can see that the commands AT SMSO and AT CFUN x 1 should never be sent within the destroyApp method It is good practice to always call the notifyDestroyed method at the end of your destroyApp method And use the destroyApp method as single exit point of your midlet TC65_AC75_ JAVA User s Guide_V08 Page 39 of 105 2006 06 12 JAVA User s Guide Confidential Released SIEMENS e notifyDestroyed the MIDlet notifies the application management software that it has cleaned up and is done Note the only way to terminate a MIDlet is to call notifyDestroyed but destroyApp is not automatically called by notifyDestroyed You must not terminate your midlet i e having no threads left and not calling notifyDestroyed before e notifyPaused the MIDlet notifies the application management software that it has paused e resumeRequest the MIDlet asks application management software to be started again Table 5 A typical sequence of MIDlet execution Application Management Software The application management software creates a new instance of a MIDlet The application management software has decided that it is an appropriate time for the MIDlet to run so it calls the MlDlet startApp metho
14. 10 minutes Result Codes Supported status codes in body of the http POST request e 900 Success e 901 Insufficient memory in filesystem e 902 not supported e 903 not supported e 904 JAR size mismatch given size in JAD file does not match real size of jar file e 905 Attribute mismatch one of the mandatory attributes MlDlet name MIDlet version MIDlet Vendor in the JAD file does not match those given in the JAR manifest e 906 invalid descriptor something is wrong with the format of the jad file e 907 invalid JAR the JAR file was not available under MIDlet Jar URL files could not be extracted from JAR archive or something else is wrong with the format of the file e 908 incompatible configuration or profile e 909 application authentication failure signature did not match certificate e 910 application authorization failure tried to replace signed with unsigned version e 911 not supported e 912 Delete Notification All HTTP packets GET POST sent by the module contain the IMEI number in the User Agent field e g User Agent lt productname gt 000012345678903 Profile IMP NG Configuration CLDC 1 1 This eases device identification at the HTTP server 8 8 Tips and Tricks for OTAP e For security reasons it is recommended that an SMS password be used Otherwise the delete operation can remove entire directories without any authentication e For extra security set up a private CSD PPP Server and set its phone
15. GE g private key public key generate customer root certificate Rp Customer Root Certificate X 509 public key from issuer of the certificate Sas Customer Environment binary data of certificate build binary data for AT command AT SJSEC AT4SJSEC cmdlen cmdid O O O binary data of certificate signature 33 pm T1 bepa Computer send to module Figure 57 Insert Customer Root Certificate After this action the module is in the following conditions The module changes into the mode trusted for MIDlet execution Untrusted Domain is OFF HTTPS certificate verification is OFF MES is ON TC65_AC75_JAVA User s Guide_V08 Page 88 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 12 2 2 Concept for the Signing the Java MIDlet Java MIDlet JAR File generate HASH JAR File HASH SHA1 F 8 ul private key Customer Environment Bis encoding with private key encoded JAR File HASH add the signature is base64 g encoded into the JAD file as the D value of the MIDlet Jar RSA SHA1 5 attribute 8 5 Java MIDlet JAD File Figure 58 Prepare MIDlet for Secured Mode TC65_AC75_JAVA User s Gui
16. JAVA User s Guide Si EM ENS Confidential Released 4 2 7 JVM Interfaces IMP NG File API AT Command API Connected Limited Device Configuration CLDC J2ME Figure 6 Interface Configuration J2ME CLDC and MIDP were implemented by SUN IMP NG is a stripped down version of MIDP 2 0 prepared by Siemens and does not include the graphical interface LCDUI Siemens developed the File I O API and the AT command API Documentation for J2ZME and CLDC can be found at http java sun com j2me Documentation for the other APIs is found in Java doc 5 4 2 7 1 IP Networking IMP NG provides access to TCP IP similarly to MIDP 2 0 Because the used network connection CSD or GPRS is fully transparent to the Java interface the CSD and GPRS parameters must be defined separately either by the AT command at sjnet 3 or by parameters given to the connector open method see Java doc 5 4 2 7 2 Media Media package is not supported See Java doc 5 4 2 7 3 Other Interfaces Neither the PushRegistry interfaces and mechanisms nor any URL schemes for the PlatformRequest method are supported See Java doc 5 TC65_AC75_JAVA User s Guide _V08 Page 23 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 4 3 Data Flow of a Java Application Running on the Module AT Parser
17. MIDlet Jar Size 1408 MicroEdition Profile IMP NG MicroEdition Configuration CLDC 1 1 A detailed description of these attributes and others can be found in the Java MIDlet documentation http java sun com j2me docs alt html WTK104 UG Ap Attributes html TC65_AC75_ JAVA User s Guide_V08 Page 53 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 9 2 Compile e Launch a Command Prompt This can be done from the Programs menu or by typing cmd at the Run prompt in the Start menu e Change to the directory where the code to be compiled is kept e Compile the program with the SDK Examples of build batch files can be found in each sample program found in the examples directory Siemens SMTK lt productname gt wtk src example e If the compile was successful the program can be run from the command line Examples of run batch files can be found in the examples directories listed above as well The batch files for compiling and running the samples refer to master batch files in the Siemens SMTK lt productname gt wtk bin directory and use the system environment variables IMPNG_JDK_DIR and IMPNG_DIR IMPNG_JDK_DIR points to the root directory of the installed JDK and IMPNG_DIR points to the root directory of the Siemens SMTK lt productname gt IMPNG installation The installation process sets these environment variables A modification is usually not necessary They may be modified as requested
18. NetBeansSamples Project g E WTK H E bin H E doc mmn a kL File name HelloWorld jpx File type All JBuilder Projects jpx jpr bpar jpgr Figure 52 JBuilder 2006 Enterprise Developer Sample Projects Starting the debugging session is done in the same way as for JBuilder X see chapter for JBuilder X above TC65_AC75_JAVA User s Guide_V08 Page 80 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 11 4 Breakpoints Breakpoints can be set as usual within the IDE The debugger cannot step through methods or functions whose source code is not available 11 5 Switching Java System out to IDE debug window The Java System out can be redirected during a debugging session using a UDP socket connection as described in chapter 5 9 System Out and 5 9 3 UDP Switching between Java System out using serial port and Java System out using UDP socket is done by a setting inside of the emulator configuration file WM_Debug_config ini e g TC65 Release 2 located under TC65_R2 WTkK bin Switching Java System out to serial port is used as default setting P WM Debug config ini Notepad File Edit Format Yiew Help AT command These AT commands are used for initialising the module for debugging Hints The IP address range 10 x x x is not supported for configuration of debugging AT Cmd1 5 ATEL AT Cmd2 R 20K AT Cm
19. Screenshots are provided as examples and unless otherwise stated apply to all supported products TC65_AC75_ JAVA User s Guide_V08 Page 9 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 2 Overview The ME features an ultra low profile and low power consumption for data CSD and GPRS voice SMS and fax Java technology and several peripheral interfaces on the module allow you to easily integrate your application This document explains how to work with the ME the installation CD and the tools provided on the installation CD Old solution The customer application was distributed across 2 uC external uC and internal uC on the module New solution The customer application exists only on the module Customer Application Customer Application Figure 1 Overview 2 1 Related Documents 1 Multiplexer Installation Guide 2 DSB75 Support Box Evaluation Kit for Siemens Cellular Engines 3 AT Command Set of your Siemens Wireless product 4 Hardware Interface Description of your Siemens Wireless product 5 Java doc wtk doc html index html 6 IMP NG JSR228 Standard 7 Application Note 24 Application Developer s Guide TC65_AC75_JAVA User s Guide _V08 Page 10 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 2 2 Abbreviation API ASC CLDC CSD DAI DCD DSR GPIO GPRS GPS HTTP 1 0 IDE IP J2ME J2SE JAD JAR JDK JVM LED ME MES
20. Sun NetBeans IDE 5 0 is done for all users 3 4 4 Installing Eclipse 3 0 or Eclipse 3 1 Eclipse 3 1 2 CD directory Eclipse and Eclipse ME Plugin 1 2 3 CD directory EclipseME_123 are provided on the SMTK CD The installation of Eclipse is shortly described in chapter 3 3 Eclipse can be freely downloaded from http www eclipse org In order to use Eclipse with the ME the EclipseME plug in is also needed It can be downloaded from http eclipseme org Using Eclipse 3 0 1 or Eclipse 3 0 2 A customized version of this plug in CD directory EclipseME_WM for Eclipse 3 0 1 and 3 0 2 comes with SMTK It is required to use this plug in for Eclipse 3 0 1 and Eclipse 3 0 2 because EclipseME plugin 1 2 3 requires Eclipse 3 1 0 and later and not installable for the older Eclipse versions 3 0 1 and 3 0 2 Using Eclipse 3 1 0 Eclipse 3 1 1 or Eclipse 3 1 2 Please use EclipseME plug in 1 2 1 or 1 2 3 for Eclipse version 3 1 0 Eclipse 3 1 1 or Eclipse 3 1 2 Note Only one selection for an Eclipse version at a time for SMTK integration is possible 3 4 5 Installing Borland JBuilder X 2005 and 2006 Enterprise Developer Borland JBuilder can be purchased from http Awww borland com jbuilder Note The installation path name of JBuilder should not include space characters There are also 30 days trial versions available on the website Installation instructions can be found on the web page 3 4 6 Installing Mod
21. System out printin nHello World n destroyApp pauseApp public void pauseApp System out println HelloWorld pauseApp destroyApp ti public void destroyApp boolean cond System out println HelloWorld destroyApp cond notifyDestroyed TC65_AC75_JAVA User s Guide_V08 Page 41 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 7 File Transfer to Module 7 1 Module Exchange Suite The Module Exchange Suite allows you to view the Flash file system on the module as a directory from Windows Explorer Make sure that the module is turned on and that one of the module s serial interfaces ASCO ASC1 or USB is connected to the COM port that the Module Exchange Suite is configured to The configured COM port can be checked or changed under Properties of the Module directory Please note that the Module Exchange Suite can be used only if the module is in normal mode While running the module with the Module Exchange Suite subdirectories and files can be added to the flash file system of module Keep in mind that a maximum of 200 flash objects files and subdirectories per directory in the flash file system of the module is recommended 7 1 1 Windows Based The directory is called Module and can be found at the top level of workspace MyComputer To transfer a file to the module simply copy the file from the source directory to
22. a concise definition of the MIDlet s states and APIs to signal changes between the states A MIDlet has three valid states e Paused The MIDlet is initialised and is quiescent It should not be holding or using any shared resources e Active The MIDlet is functioning normally e Destroyed The MIDlet has released all of its resources and terminated This state is only entered once State changes are controlled by the MIDlet interface which supports the following methods e pauseApp the MIDlet should release any temporary resources and become passive e startApp the MIDlet starts its execution needed resources can be acquired here or in the MIDlet constructor Note Take care that the startApp method is always properly terminated before calling the destroyApp method For example avoid that threads launched by startApp enter a closed loop and be sure that all code was entirely executed This is especially important for OTAP which needs to call destroyApp e destroyApp the MIDlet should save any state and release all resources Note To destroy only the Java application without switching off the module the destroyApp method can be called explicitly To destroy the Java application and switch off the module at the same time it is sufficient to send the ATSSMSO command from somewhere in your code because this procedure implies calling the destroyApp method Likewise resetting the module with AT CFUN x
23. after the end of each debugging session This is independent of the used IDE Eclipse 3 0 1 Eclipse 3 0 2 Eclipse 3 1 0 Eclipse 3 1 1 Eclipse 3 1 2 NetBeans IDE 5 0 JBuilder X JBuilder 2005 JBuilder 2006 Enterprise Developer Please keep in mind that it is not possible to use obfuscated files for a debugging session When writing and debugging a midlet be aware of the midlet life cycle see chapter 6 2 MIDlet Life Cycle TC65_AC75_ JAVA User s Guide_V08 Page 63 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 11 3 1 NetBeans IDE 5 0 This section indicates the changes to your IDE you will see after integrating the SMTK and describes how to exploit these features to build and debug your applications All installed emulators can be found using the NetBeans IDE 5 0 menu Tools gt Java Platform Manager See Figure 31 Java Platform Manager Platforms 2 J2MeE Platform Name Siemens IMP NG TC65 R2 Wireless Toolkit fh 12ME Wireless Toolkit 2 2 Platform Folder C Program Files Siemens SMTK TC6S_R2 WTK hy Siemens IMP NG TC65 R2 Wirel D J25 Devices Sources JavaDoc Tools amp Extensions m JDK 1 4 Default poe IMP_NG_TC65_R2 lt a Figure 31 NetBeans IDE 5 0 installed emulators TC65_AC75_ JAVA User s Guide _V08 Page 64 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 11 3 1 1 Switching emulator to IMP NG emulator You c
24. all data Further details can be found in 4 5 7 1 Automatic Shutdown The ME is switched off automatically in different situations e under or overtemperature e under or overvoltage Appropriate warning messages transmitted by the ME to the host application are implemented as URCs To activate the URCs for temperature conditions use the at sctm command Undervoltage and overvoltage URCs are generated automatically when fault conditions occur For further detail refer to the commands at sctm and at sbc described in the AT Command Set 3 In addition a description of the shutdown procedures can be found in 4 TC65_AC75_ JAVA User s Guide_V08 Page 30 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 5 7 2 Manual Shutdown The module can be switched off manually with the AT command at smso or when using the TC65 Terminal by pressing the ignition key for a period of time see 4 In these cases the midlets destroyApp method is called and the application has 5s time to clean up and call the notifydestroy method After the 5s the VM is shut down 5 7 3 Restart after Switch Off When the module is switched off without setting an alarm time see the AT Command Set 3 e g after a power failure external hardware must restart the module with the Ignition line IGT The Hardware Interface Description 4 explains how to handle a switched off situation 5 8 Special AT Command Set for Java Applications
25. different number of timeslots CS4 Download data rate with x timeslots Coding scheme 4 kbit s theor from theor from theor from theor from Value theor Value theor Value theor Value theor value value value value 35 60 58 38 80 48 net transmission rates for LLC layer TC65_AC75_ JAVA User s Guide_V08 Page 38 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 6 MIDlets The J2ME Mobile Information Device Profile MIDP provides a targeted Java API for writing wireless applications The MIDP runs on top of the Connected Limited Device Configuration CLDC which in turn runs on top of the J2ME MIDP applications are referred to as MiDlets MlDlets are controlled by the mobile device implementation that supports the CLDC and MIDP Since IMP NG is a subset of MIDP 2 0 IMP includes MIDlets The MIDlet code structure is very similar to applet code There is no main method and MiDlets always extend from the MIDlet class The MIDlet class in the MIDlet package provides methods to manage a MlDlet s life cycle 6 1 MIDlet Documentation MIDP and MIDlet documentation can be found at http wireless java sun com midp and in the html document directory of the wtk Siemens SMTK lt productname gt wtk doc index html 6 2 MIDlet Life Cycle The MIDlet life cycle defines the protocol between a MIDlet and its environment through a simple well defined state machine
26. download of Java files 68 11 3 2 Eclipse 3 0 and Eclipse 3 1 cccccccccccceeeeeeeeeeeeeeeaeeeeeeeeeeeeeeeaaaeneees 69 aE A A CIOS cA E cake e este creed neste deetak fie ene Becta era ceitee stat eta 69 ai EA HECIDSS Sol E AE deat oie sane bid can T cand ata sou ienaaettate tae de 69 11 3 2 3 Additional Configuration of integrated emulator cceeeeeeee 69 11 3 2 4 Switching Emulators sciecc ects ste ccedeteheteesuteteeate tele aettadiends tol anetedien cases 70 11 3 2 5 Import EXA E erar Tera e Terp ae kaan der ela aaa tada dai taaa dan tei 70 11 3 26 Compile and debUgi isiiisiissni iniurias uniia uiaiia 72 11 3 2 7 Starting debugging session without download of Java files 74 11 3 3 Borland JBuilder X ccccccccccceceeeeeeeeeceaaeeceeeeeeeeeeeeaaaaaeeeeeeeeeeeaaeaneees 75 TAS Sed HEXEMPISS E E E E E 76 TC65_AC75_JAVA User s Guide_V08 Page 5 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 11 3 3 2 Starting debugging session without download of Java files 78 11 3 4 Borland JBuilder 2005 and JBuilder 2006 Enterprise Developer 79 T13 4 1 Examples e r oea i E aaea ae e aaa a R aaa 80 11 4 BreaKkpoints msnen eea e iea aea ae ae Na E E ane deea aeea aoea 81 11 5 Switching Java System out to IDE debug WindoW sssssssssesssrnrnssssrrrrrrrn 81 42 SJaVa Aa A A E A E TT 82 121 Secure Data Transferi ne en EEEE ELE EE E
27. e g when switching to a different JDK via the advanced system properties 9 3 Run on the Module with Manual Start e Compile the application at the prompt as discussed in Section 9 2 or in an IDE e Transfer the jar and jad file from the development platform to the desired directory on the module using the Module Exchange Suite or OTA provisioning Chapter 7 explains how to download your application to the module e Start a terminal program and connect to ASCO e The command at sjra is used to start the application and is sent to the module via your terminal program Either the application can be started by jar or by jad file Example In your terminal program enter at sjra a ava jam example helloworld helloworld jar If you prefer to start with jad file atsjra a java jam example helloworld helloworld jad The Flash file system on the module is referenced by a Depending on which file you specify the java application manager tries to find the corresponding file in the same directory This search is not done by name but by comparing the contained attributes The first file which contains the same values for MIlDlet Name MlDlet Version and MIDlet Vendor is used 9 4 Run on the Module with Autostart e Compile the application at the prompt as discussed in Section 9 2 or in an SMTK integrated IDE e Transfer the jar and jad file from the development platform to the desired directory on the module using the Module Exchang
28. form a chain TC65_AC75_JAVA User s Guide _V08 Page 84 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 12 1 1 Create a Secure Data Transfer Environment Step by Step The following steps describe the creation of the configuration e The certificate exists within the module see 12 2 1 Change to Secured Mode Step 1 e Certificate verification is activated for a data connection HTTPS or SecureConnection The steps described below use the cygwin openssl environment for installation see http www cygwin com the openssl documentation can be found here http www openssl org docs apps openssl html A CA Root certificate is generated This certificate can be placed on the HTTPS Server Another possibility is to use the private key of the certificate in order to sign thereby a server certificate Both certificates form then a chain which can be examined by the ME 1 Create CA and generate CA Root Certificate We need certificates with sha1 signature Java Security supports a sha1 signature of the certificate only Add the parameter sha1 to the command Making CA certificate in the section of file CA pl cygwin location cygwin usr ssi misc create a shell use location cygwin usr ss misc execute commands gt perl CA pl newca convert file format from PEM to DER CA certificate cacert pem gt openssl x509 in demoCA cacert pem inform PEM out demoCA cacert der outform DER CA pr
29. is not installed first install JBuilder X and follow the installation wizard instructions Run the SMTK installation program in maintenance mode The SMTK will find the installed JBuilder X IDE Select JBuilder X to integrate the SMTK into JBuilder X After integration of SMTK into JBuilder X you can examine the integration by opening the menu Tools gt Configure JDKs see Figure below G Configure JDKs FE Project JDK Settings am we Home fon 44 2 01208 Name Siemens IMP NG TC65 R2 Wireless Toolkit java version 1 4 2_01 1 im ea JDK home path C Program Files Siemens SMTK TCB5_R2MVTK p J2ME Wireless Toolkit 2 0_01 7 eeaSiemens IMP NG TCB5 R2 Wireless Tool O Always debug with classic Class Source Documentation Micro le Program Files Siemens SMTKIT CBS_R2MT Kilibiclasses zip El gt New Add Folder Delete l OK Cancel Help Figure 44 JBuilder X JDK settings The libraries included with the SMTK can be examined by opening the menu Tools gt Configure Libraries see Figure below g Configure Libraries ee Do a Library Settings usTL D Junt Name Siemens IMP NG TC65 R2 amp LayoutAssistant Sample f Open Tools SDK SHTML Handler Add 5 Struts E Struts 1 0 2 amp Unt Test Web Start D wspi4 f Xalan Tia Xerces f XmlBeans amp xMLoBMs v New Add Folder Delete Class Source Documentation Framework Required Librari
30. issue this command is then exclusively used for the OTAP tracer All other functionality which is normally present AT commands or CommConnection and System out in Java is not available when the tracer is on This feature is intended to be used during development phase and not in deployed devices 8 10 Security Java Security as described in chapter 12 also has consequences for OTAP If the module is in secured mode the MIDlet signature is also relevant to the OTAP procedure This means e f the application is an unsigned version of an installed signed version of the same application then status code 910 is returned e Ifthe applications signature does not match the module s certificate then status code 909 is returned TC65_AC75_ JAVA User s Guide_V08 Page 51 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 8 11 How To This chapter is a step by step guide for using OTAP 1 9 Do you need OTAP Is there any chance that it might be necessary to update the Java application install a new one or delete it It could be that device is in the field and you cannot or do not want to update it over the serial line If the answer is yes then read through the following steps if the answer is no then consider simply setting the OTAP SMS password to protect your system Then you are finished with OTAP Take a look at the parameters chapter 8 3 which control OTAP You need to decide which of them
31. recommend referring to Java descriptions on threads before making any choices about threading models Threads can be created in two ways A class can be a subclass of Thread or it can implement Runnable For example threads can be launched in startApp and destroyed in destroyApp Note that destroying Java threads can be tricky It is recommended that the developer read the Java documentation on threads It may be necessary to poll a variable within the thread to see if it is still alive 13 2 2 Example This example derives a class from Thread and creates two instances of the subclass One thread instance finishes itself the other one is stopped by the main application packag xample threaddemo import javax microedition midlet public class ThreadDemo extends MIDlet Member variables boolean runThreads true Flag for stopping threads DemoThread thread1 First instance of DemoThread DemoThread thread2 Second instance of DemoThread Private class implementing the thread to be started by the main application private class DemoThread extends Thread int loops public DemoThread int waitTime Store number of loops to execute loops waitTime System out printlin Thread loops Created public void run System out printlin Thread loops Started for int i 1 i lt loops i Check if main application asked threa
32. storepass keystorepassword keypass keypassword keystore customer ks gt HttpsVerifyOff bin TC65_AC75_JAVA User s Guide_V08 Page 95 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released Command switch on module exchange functionality java jar jseccmd jar cmd ObexActivationOn imei 012345678901234 alias keyname storepass keystorepassword keypass keypassword keystore customer ks gt ObexActivationOn bin Command switch off module exchange functionality java jar jseccmd jar cmd ObexActivationoff imei 012345678901234 alias keyname storepass keystorepassword keypass keypassword keystore customer ks gt ObexActivationoff bin 12 5 4 Sign a MIDlet Use the tool jadtool jar to sign a Java MIDlet This program is in the folder wkt bin java jar jadtool jar addjarsig jarfile helloworld jar inputjad helloworld jad outputjad helloworld jad alias keyname storepass keystorepassword keypass keypassword keystore customer ks encoding UTF 8 12 6 Attention The central element of Java Security is the private key If Java Security is activated and you lose the private key then the module is destroyed You have no chance of deactivating Java Security downloading of a new Midlet or starting any other operation concerning Java Security To prevent problems you are strongly advised to secure the private key TC65_AC75_JAVA User s Guide _V08 Page 96 of 105 2006 06 12 JAVA User s Guide S
33. the result code of the AT command as a string Occasionally it may be infeasible to wait for an AT command that requires some time to be processed such as at cops There is a second non blocking send function which takes a second parameter in addition to the AT command This second parameter is a callback instance ATCommandResponseListener Any response to the AT command is delivered to the callback instance when it becomes available The method itself returns immediately The ATCommandResponseListener and the non blocking send method are described in Section 13 1 2 Note Using the send methods with strings with incorrect AT command syntax will cause errors 13 1 1 3 Data Connections If a data connection is created with the ATCommand class for instance with atd an input stream is opened to receive the data from the connection Similarly an output stream can be opened to send data on the connection Please note that this example would not work unless the module had been initialized and logged into a network System out println Dialing ATD CALLED NO response atc send ATD CALLED NO MNEU ise System out println received response if response indexOf CONNECT gt 0 try We have a data connection now we do some streaming IOException will be thrown if any of the Stream methods fail OutputStream dataOut ATCmd getDataOutputStream InputStream dataIn ATCmd ge
34. this is an optional entry specifying a URL to which the result of an update install operation is posted That is the only way to get any feedback about the outcome of an install update operation The format of the posted URL complies with the IMP NG OTA Provisioning specification In contrast to the jar and jad file this URL must not be protected by basic authentication e MlDlet Delete Notify this is an optional entry specifying a URL to which the result of a delete operation is posted That is the only way to get any feedback about the outcome of a delete operation The format of the posted URL complies with the IMP NG OTA Provisioning specification In contrast to the jar and jad file this URL must not be protected by basic authentication e MIDlet Name MlDlet Version MlDlet Vendor are mandatory entries in the JAD and Manifest file Both files must contain equal values otherwise result 905 see 8 7 is returned e MlDlet Jar Size must contain the correct size of the jar file otherwise result 904 see 8 7 is returned TC65_AC75_ JAVA User s Guide_V08 Page 47 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released Example MIDlet Name MyTest MIDlet Version 1 0 1 MIDlet Vendor TLR Inc MIDlet Jar URL http 192 168 1 3 datafiles MyTest jar MIDlet Description My very important test MIDlet 1 MyTest example mytest MyTest MiDlet Jar Size 1442 MicroEdition Profile IMP NG MicroEdition Configuration CLDC 1
35. 006 06 12 JAVA User s Guide SIEM ENS Confidential Released Please keep in mind that you have to remove this emulator option before starting debugging session with download of Java files The Java files are not updated in the Flash files system of the module while option noload is set The same procedure is used for all different JBuilder IDE versions 11 3 4 Borland JBuilder 2005 and JBuilder 2006 Enterprise Developer If JBuilder 2005 or JBuilder 2006 Enterprise Developer is not installed run the JBuilder 2005 or JBuilder 2006 Enterprise Developer install program and follow the installation wizard instructions Use the SMTK installation routine in maintenance mode The SMTK will find the installed JBuilder 2005 or JBuilder 2006 Enterprise Developer IDE Select JBuilder 2005 or JBuilder 2006 Enterprise Developer to integrate the SMTK into JBuilder 2005 or JBuilder 2006 Enterprise Developer After the integration of the SMTK into JBuilder 2005 or JBuilder 2006 Enterprise Developer you can examine the integration by opening the menu Tools gt Configure gt JDKs see Figure below Configure JDKs B Project JDK Settings E areri Eu Name Siemens IMP NG TC65 R2 Wireless Toolkit JDK home path C Program Files Siemens SMTK TC6S_R2 WTK Always debug with classic p Class Source Documentation Micro Name Unified Emulator Interface Profile IMP NG Configuration CLDC 1 1 Target device IMP_
36. 1 IP Service Apart from the standard Java IP networking interfaces UDPDatagramConnection SocketConnection the ME also supports a set of Internet Services controlled by AT command There are some correlations between the Java and the AT IP Services e The connection profile 0 is also used by Java when Java starts up a networking connection it tries to set and activate connection profile 0 with the parameters configured by at4sjnet or in the connector open method e Java tries to re use an active Internet Service profile if using connection profile O fails because e g this or another connection profile is already used by the Internet Services Java networking also uses this already active profile e Deactivation of the connection profile happens when all applications are finished Java has its networking idle time For the Internet Services an inactivity timeout referred to as parameter lt inactTO gt is available configurable by at sics and at scfg So that means that Java networking and AT Internet Services can be used in parallel but care has to be taken about configuring and activation of the connection profile In the simplest case use connection profile O for the Internet Services and set the parameters to the same values as the Java networking parameters This way it makes no difference whether the connection is activated by the Internet Services or Java There are some aspects which have to be kept in mind for all
37. 2 Emulator The ME emulator is part of the SMTK and is used as the controlling entity for on device debugging Some values can be configured in the file wtk bin WM_Debug_config ini The emulator is running fine without changes in WM_Debug_config ini file because the settings for the serial interface COM port and baudrate are configured during installation of SMTK Debugging information between the Debugger IDE and the JVM is transferred over an IP connection In order to establish this IP connection between the PC and the module the emulator needs a special Dial Up Network DUN ISP name IP connection for remote debugging Modem either Standard 19200 bps Modem or lt productname gt 14400 bps Modem Phone number 88 Disable the Redial if line dropped option Enable Connect automatically This Dial Up Network DUN connection is installed automatically together with a standard modem during installation of SMTK The emulator use always the COM port settings configured for this Dial Up Network connection You can use any of the three serial interfaces ASC0 ASC1 USB to connect with module but you will lose the functionality which is normally present on the interface Because of this loss and because of its speed it is recommended that the USB interface be used Please keep in mind that if you like to use an USB modem connection you have to install and configure that modem connection after SMTK installat
38. 75_JAVA User s Guide_V08 Page 77 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 11 3 3 2 Starting debugging session without download of Java files It is possible to start a debugging session without download of the Java files jad and jar again The emulator has to be started with an additional parameter noload and downloading of the Java files is suppressed Please add the parameter in the following emulator running configuration line as described in the figures above Select the project properties e g HelloWorld jpx and edit the emulator configuration 0 Properties for HelloWorld jpx Paths Run General Runtime configurations Find Classes Filter Default Context Menu Group Type Name Unit Testing Filter MiDlet HelloVorld Build Java Resource Javadoc Ant Menu Items Formatting Server Personality OK Cancel Help Figure 48 JBuilder X Edit project properties for starting the emulator Please add additional emulator parameter noload and press Ok G Edit Runtime Configuration Name HelloVYorld Build target Make Run Run Egun Debug Type MiDlet Optimize JDK Library Main class example helloworld HellovYorld O JAD file OTA URL Emulator parameters noload Ernulator device IMP_NG_TCB5_R2 MiDlet parameters Parameter Figure 49 JBuilder Runtime Configuration TC65_AC75_JAVA User s Guide_V08 Page 78 of 105 2
39. A TAA EE AA 28 ST IP SENEE aaen ott a a a ok ere Ae ata eth A O Aa 28 5 2 Remote SIM ACCceSS ise i hs te ta et ooh Leen 28 5 3 Power SAVING Assn c2 acca caves ieusentinnd a RE aea sae AAE deaa A aaa aas 29 5 4 Charging ssicscieseletectcclentsdck asores tesoros obede testadon ebi do rideta derodekadoredakidaynderddovedtkdatdivia 29 5 5 Airplane MOde oriee a E N E e ar 30 O Ala a a aaa aa aa at 30 Bede ONGONA E E IR AR A dont ren seers etre eee 30 5 7 1 Automatic ShutdoOWn e seseseseenenenenrenonenenorrrrnnorrrrenrrrnrenrnrnronrrrnrerrnnnne 30 5 7 2 Manual Shutdown 2 20 cee ceecceecceeeccecceeccueccueecaeecauecaueeaueeaeeeaeeeaeeeaeeeaeesaeees 31 5 7 3 Restart atter Swite hiOtth acs esos ees fe all ates 2h Seat ah ito ble Std a 31 5 8 Special AT Command Set for Java Applications cceeeeeeeeeeseeeeeeeeeeeeeeees 31 5 8 1 Switching from Data Mode to Command Mode ccccceceeeeeeeeeeees 31 5 8 2 Mode Indication after MIDlet Startup cccccccccccccceeeceeeeeeeeeeeeeeeeeees 31 5 831 LONG Responses scssi cuteten athe anna selebesueu tere e wiegte Oh Lenina tel 31 5 8 4 Configuration of Serial Interface cc ccccceeeeeeesseecceeeeeeeeeeteseteaeeeeeees 32 5 8 5 Java COMMAMNAS 20 0 EPEE E TA T E E E E EA 32 5 94 System Q t ienen e a e aE e a e E O N ANEN 32 5 9 1 Serial iNtSMACES 32ssewsd sh ahead A a eh at ot Ge ee 32 A Pilati eae te te nek Laat E aaah Nine tt aon 33 5 93 UDR
40. EOAE Seuaatente mastaxies 83 12 1 1 Create a Secure Data Transfer Environment Step by Step 85 12 2 Execution Control 0 cccccccccccccccceeeeceeeeeeceeeeeeeeeeeaaaeaaeeeeeeeeeeeaaeaaeeeeeeeeeeeeaaeaneees 87 12 2 1 Change to Secured Mode Concept eeeecccccceeeeeeeeeeeeeeceeeeeeeeeeeeees 88 12 2 2 Concept for the Signing the Java MIDlet ccceececseeeeeeeeeeeeteeeeees 89 12 3 Application and Data Protection cccccccceeeeccceeeeeeeeeeeeeeeeaaeeaeeeeeeeeeeesaaeaneees 90 12 4 Structure and Description of the Java Security Commands ccceeeeeeeee 90 12 4 1 Structure of the Java Security Commands cc eeeceeeeeeteeeetteeeeeeeeeeeeeee 91 12 4 2 Build Java Security COMMANGA ccc eeeeeeeeeeeeeeeeeeeeettteeeeeeeeeeeeees 92 12 4 3 Send Java Security Command to the Module cceeeeeeeeeeeeeeeees 93 12 5 Create a Java Security Environment Step by Step eee reer eee eeeees 94 125 1 Greate Key store ws ccs ee ee A oe A ee 94 12 5 2 Export X 509 Root Certificate sasi scniscenestietece wleiece winviete we senestiedtecameneds 94 12 5 3 Create Java Security COMMANAS 0000 eeeeceeeeee eee eeeeeeeeeeeeeeeeeeeeeees 94 12 5 4 Sign a MIDlet css cccstelsscccecdecoveeeseeday sxnestceesananysvseeshlecveudaseveaantaceneancaevacae 96 TO Attention senna an a Bete vaneboasane a ATEAN 96 13 Java TLULOM al ennaa sativa cdateecsbeccaties ca cucedececaercasees
41. For the full AT command set refer to 3 There are differences in the behaviour AT commands issued from a Java application in comparison to AT commands issued over a serial interface 5 8 1 Switching from Data Mode to Command Mode Cancellation of the data flow with is not available in Java applications see 3 for details To break the data flow use breakConnection Refer to wtk doc index html 5 5 8 2 Mode Indication after MIDlet Startup After starting a module without autobauding on the startup state is indicated over the serial interface Similarly after MIDlet startup the module sends its startup state SYSSTART SYSSTART ALARM MODE etc to the MIDlet This is done via a URC to the AT Command API instance which executes the very first AT Command from within Java To read this URC it is necessary to register a listener see 5 on this AT Command API instance before passing the first AT Command 5 8 3 Long Responses The AT Command API can handle responses of AT commands up to a length of 1024 bytes Some AT commands have responses longer than 1024 bytes for these responses the Java application will receive an Exception Existing workarounds e Instead of listing the whole phone book read the entries one by one e Instead of listing the entire short message memory again list message after message e Similarly read the provider list piecewise e Periods of monitoring commands have to be handled by Java e g at m
42. Gh ews as diiidan diui 75 Figure 45 JBuilder X Siemens Library o c sc sccecees seevees stat eteeeatees Anat eee setaveen sereeeeneeeeceueneeeee 75 Figure 46 JBuilder X Sample Projects ccccccecceeeeeeeeeeeeeeeeeeeaeeaeaeaeaaaaaeeeaaeaeaaaeeaee 76 Figure 47 JBuilder X Starting the debugging SESSION ceeeeeeeeeeeeeeeeeeeeeneeeeeeeeeeteees 77 Figure 48 JBuilder X Edit project properties for starting the emulator eeeeeeee 78 Figure 49 JBuilder Runtime Configuration c cccceceeesssecccceeeeeeeeeeeeenaeeeeeeeeeeeeeenaaees 78 Figure 50 JBuilder 2006 Enterprise Developer JDK settings seeeeseeeeeeeeeeeeeeeeees 79 Figure 51 JBuilder 2006 Enterprise Developer Siemens Library sssseeeeeeeeeeees 80 Figure 52 JBuilder 2006 Enterprise Developer Sample Projects ssssseeeeeeeeeeees 80 TC65_AC75_ JAVA User s Guide_V08 Page 7 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released Figure 53 Emulator configuration file switching Java System out to serial port 81 Figure 54 Mode 1 Customer Root Certificate does not eXiSt ccccceeeeeeeeeetteeeeeeeeeeteee 83 Figure 55 Mode 2 Server Certificate and Certificate into module are identical 84 Figure 56 Mode 2 Server Certificate and self signed root Certificate in module form a chain84 Figu
43. I EM ENS Confidential Released 13 Java Tutorial This small tutorial includes explanations on how to use the AT Command API and suggestions for programming MIDlets The developer should read about MIDlets Threads and AT commands as a complement to this tutorial 13 1 Using the AT Command API Perhaps the most important API for the developer is the AT command API This is the API that lets the developer issue commands to control the module This API consists of the ATCommand class and the ATCommandListener and ATCommandResponseListener interfaces Their javadocs can be found in wtk doc htmil index html 5 13 1 1 Class ATCommand The ATCommand class supports the execution of AT commands in much the same way as they would be executed over a serial interface It provides a simple way to send strings directly to the device s AT parsers 13 1 1 1 Instantiation with or without CSD Support There can be only exactly as many ATCommand instances as there are parsers on the device If there are no more parsers available the ATCommand constructor will throw ATCommandFailedException All AT parser instances support CSD However from a Java application point of view it may make sense to have one dedicated instance for CSD call handling Therefore and also for historical reasons only one parser with CSD support may be requested through the constructor If more then one parser with CSD support is requested the constructor will throw ATComma
44. I EM ENS Confidential Released 3 2 1 Components 3 2 1 1 Module Exchange Suite The Module Exchange Suite allows the developer to access the Flash file system on the cellular engine from the development environment over a serial interface File transfers from PC to module are greatly facilitated by this suite The Module Exchange Suite MES will be installed under the following directories e MES executables e g MESCopy exe etc in the windows system directory e g C WINDOWS system32 The version of the MES executables can be read out by using the Windows Explorer context menu gt Properties and selecting the Version tab e g MESCopy exe Version 1 0 0 12 etc e MES server files under ModuleExchange directory e g C Program Files Module Exchange The version of the dll files can be read out by using the Windows Explorer context menu gt Properties and selecting the Version tab e g MESShellExt dll Version 2 0 0 19 MESServer exe Version 2 0 0 38 MESSearchApp exe Version 2 0 0 5 The MES installation version can be found under Control Panel gt Add or Remove Programs selecting the installed MES program and clicking on support information e g version 1 00 0008 3 2 1 2 WTK wtk is the directory where all the necessary components for product specific Java application creation and debugging are stored The version of the installed WTK is stored under the root of the WTK directory in a text file e g C Progr
45. IP Services Java and AT command e When an open TCP connection is cut e g the other side dies is switched off it takes around 10 minutes during which retransmissions are send until the situation is detected as an error in Java an exception is thrown e The number of IP services used in parallel should be kept small An active IP service uses up resources and may deteriorate the overall performance e For information about the bearer state use the specific IP service command at sici and in addition the general network commands at cops and or at creg 5 2 Remote SIM Access While Remote SIM Access RSA is normally closely coupled with the GSM 07 10 multiplexer there are some things to keep in mind when using it with Java e Java must not be started when RSA and or the GSM 07 10 multiplexer is activated e When activating the RSA mode at srsa via a Java AT Command channel while Java is running the parameter lt muxChan gt of the at srsa command is ignored and RSA is activated on the channel where the command was issued The Input and Outputstream can then be used to transfer RSA protocol data The TC65 does not feature RSA mode under Java TC65_AC75_ JAVA User s Guide_V08 Page 28 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 5 3 Power Saving The module supports several power saving modes which can be configured by the AT command at cfun 3 Power saving affects the Java application in two way
46. Java Application Server HTTP Server HTTP TCP IP puo teh a jar file i over GPRS CSD ee jad file Jarg OTAP Controller SMS Sender Figure 19 OTAP Overview The Java Application Server http Server contains the jar and the jad file to be loaded on the device Access to these files can be protected by http basic authentication The OTAP Controller SMS Sender controls the OTAP operations It sends SMs with or without additional parameters to the devices that are to be operated These devices then try to contact the http server and download new application data from it The OTAP Controller will not get any response about the result of the operation Optionally the server might get a result response over http There are two types of OTAP operations e Install Update A new JAR and JAD file are downloaded and installed e Delete A complete application jar jad all application data and its directory is deleted TC65_AC75_JAVA User s Guide_V08 Page 44 of 105 2006 06 12 JAVA User s Guide SIEMENS Confidential Released 8 3 OTAP Parameters There is a set of parameters that control the OTAP procedures These parameters can either be set by AT command at sjotap refer to AT Command Set 7 during the production of the device or by SM see Section 8 4 during operation of the device in the field None of the parameters which are set by AT command can be overwritten by SM JAD File U
47. K TC65_AC75_JAVA User s Guide_V08 Page 73 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 11 3 2 7 Starting debugging session without download of Java files It is possible to start a debugging session without download of the Java files jad and jar again The emulator has to be started with an additional parameter noload and downloading of the Java files is suppressed Please add the parameter in the following emulator configuration line as described in the figure above Create manage and run configurations Configurations Name TC65 Rel 2 emulator E5 Java Applet AS gep ane midlet 8 Emulation Ey Source E Common Je JUnit Plug in Test Platform Definition ral Remote Java Applicatior Run time Workbench 8 Wireless Toolkit Emulate Siemens IMP NG TC65 R2 Module Platform TC65 emulator 3 4 TC65Rel 2emulato Device IMP_NG_TC65_R2 Project Platform Definition Security Domain Extra Emulator Parameters noload Apply Revert Figure 43 Eclipse Configuration Please keep in mind that you have to remove this emulator option before starting debugging session with download of Java files The Java files are not updated in the Flash files system of the module while option noload is set TC65_AC75_JAVA User s Guide_V08 Page 74 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 11 3 3 Borland JBuilder X If you want to use JBuilder X and it
48. NG_TC65_R2 Preverify options lt gt Emulator JDK New Add Folder Delete OK Cancel Help Figure 50 JBuilder 2006 Enterprise Developer JDK settings TC65_AC75_JAVA User s Guide_V08 Page 79 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released The libraries included with the SMTK can be examined by opening the menu Tools gt Configure gt Libraries see Figure below gG Configure Libraries f E Atii Library Settings f JUnit Layoutassistant Sample Name Siemens IMP NG TC65 R2 Open Tools SDK F 5 SHTML Handler fiai Siemens IMP NG TC65 R2 E Struts 1 0 2 C Program Files Siemens SMTK TC65_R2 WTK dacjhtml Class Source Documental 1 Framework Required Libraries bf Struts 1 1 fF Struts 1 2 of Unit Test fF Web Start oof xalan oof Xerces off XmiBeans E sof XMLDBMS New Add Folder Delete Figure 51 JBuilder 2006 Enterprise Developer Siemens Library 11 3 4 1 Examples There are sample projects provided with the SMTK These projects can be found in the JBuilderSamples directory of the SMTK installation directory This directory is accessed by opening a project using the menu File gt Open Project see Figure below G Open Project or Project Group E Heloworid o Menda Directory B C SMTK Nj fen Helloworld jpx B E Tc65_R2 Home H EclipseSamples 5 EJ JBuilderSamples Bf lowers W E
49. P EE ETSE PANAT tte es ee eee ee 33 510 IRESIrICHONS a fis EHS ease dtc se Relves Pina ened eave te sane aaea 33 5 10 1 Flash File System e c2 c cccccde cece seeave sinc cos ceveveanestadees geeesanesincen comes 33 VO 2s MeMO ee eaa eere ainara EEEE Eea rA e e AEEA nE eae EEEa E S iaaa aa 33 S1 Pena mante 25 sea 8 ood Sic vase a Nin ve Nv vd a a 34 e FA Ld Ged gt h gt Fee nce SR RO PS PP TA SAN 34 Het 2 PIN Orie a AE a ie ei ieee etree ed te es ook 35 5 11 3 Data Rates on RS 232 API oo ce ccccccccceecceseceeeceeeceeeceeecseceeeceeecueeneeenees 35 5 11 3 1 Plain Serial Interface 2 20 0 ce ceccceeceeceeeceeeceeeceeeceeeceeceeceeceecneeeneeees 36 5 11 3 2 Voice Call in Parallel 0c eeecceeeceeeceeeececeeeseceeeceseneeeneeenees 36 5 11 3 3 Scenarios with GPRS Connection cee ccceeececeeeseeeeeeeeeeeeaes 37 ITS 1 Uploader aaa a ea ded aa aaa a a 37 5 11 3 3 2 D wnloa d rr i ana a n hn a ve A se ee 38 6 IMD OCS carea a E T A E E aA 39 6 1 MiDletDo umentati Ms s einado a a a a a Aia a ead ia RES 39 E MIDlet E ERO e e T E E E E 39 6 3 Hello World MIDlet iicxic ts Cee REO A RS OE IS 41 7 File Transfer to MOGUle ices iota cece eat et ee ea eA ee ne 42 7 1 Module Exchange Suite 3s cccccccececctets acetate ceteeetduescdedaceeedeheevadedncetiienevereneauanrnees 42 7 1 1 Windows Based ta lees A ee A tN a kN te ete hE ad cake oe 42 7 1 2 Command Line BaSed a E a ENAA 42 7 2 Over the Air Provisioning s viccsscniccatncnsase
50. RL the location of the JAD file is used to install or update procedures The JAD file needs to be located on the net e g http someserver net somefile jad or http 192 168 1 2 somefile jad Application Directory this is the directory where a new application JAD and JAR file is installed The delete operation deletes this directory completely When entering the application directory with at sjotap or a short message ensure that the path name is not terminated with a slash For example type a or a otap rather than a or a otap See examples provided in Chapter 8 4 http User a username used for authentication with the http server http Password a password used for authentication with the http server Bearer the network bearer used to open the HTTP TCP IP connection either GPRS or CSD APN or Number depending on the selected network bearer this is either an access point name for GPRS or a telephone number for CSD Net User a username used for authentication with the network Net Password a password used for authentication with the network DNS a Domain Name Server s IP address used to query hostnames NotifyURL the URL to which results are posted This parameter is only used when the MiDlet Install Notify attribute or MIDlet Delete Notify attribute is not present in the descriptor There is one additional parameter that can only be set by AT command SM Password it is used to authenticate incoming OTAP SMs Se
51. a Java IDE such as NetBeans IDE 5 0 Eclipse 3 0 1 Eclipse 3 0 2 Eclipse 3 1 0 Eclipse 3 1 1 Eclipse 3 1 2 JBuilder X 2005 or 2006 Enterprise is installed it can be integrated into the SMTK environment during the installation of the SMTK To install one of the IDEs follow the installation instructions in Section 3 4 3 and Section 3 4 4 respectively 3 2 Installation CD The Siemens Mobility Toolkit Installation CD includes e Module Exchange Suite e WTK bin various tools doc html java docs for APIs lib classes zip src various examples e Java SDK J2sdk 1_4 2 09 windows i586 p exe e NetBeans IDE 5 0 netbeans 5_0 windows exe NetBeans IDE 5 0 netbeans_mobility 5_O win exe NetBeans Mobility package 5 0 e Eclipse 3 1 2 eclipse SDK 3 1 2 win32 zip Eclipse 3 1 2 e EclipseME plugin 1 2 3 eclipseme feature_1 2 3_site zip Eclipse ME Plugin 1 2 3 e EclipseME plugin WM only required for Eclipse 3 0 1 and Eclipse 3 0 2 e Documents DSB75_HW_Description pdf lt productname gt _AT_Command_ Set pdf lt productname gt _HW _Description pdf lt productname gt _HW _Description pdf lt productname gt _ReleaseNote pdf WM_AN_24 Dev_Guide pdf lt productname gt _Java_UserGuide pdf this document Some of the content can only be accessed after the installation EclipseME plugin 1 2 1 is also supported but not distributed as part of the CD TC65_AC75_ JAVA User s Guide_V08 Page 12 of 105 2006 06 12 JAVA User s Guide S
52. acsecedsSveavecsstaaceteds 97 13 1 Using the AT Command Pie hse c ccen cette actin cactaleete ataeatsteitee atcha ataieere cteteabse ise 97 13 11 Class AT COMMA ace cn ceset ead ssutnenuneed send A EA 97 13 1 1 1 Instantiation with or without CSD Suppott sesesseeeeeeeeeeees 97 13 1 1 2 Sending an AT Command to the Device the send Method 98 13 1 1 3 Data Connections 200 000 ccc ccccecc cece cece ee eeeeeeeeeeeeeeaaaeaaeeeeeeeeeeeaaeaneees 98 TIAA Synchronization neiseitu eta aaa a a whee E 100 13 1 2 ATCommandResponseListener Interface cccccseseeeeeeeeeeeeeeeees 100 13 1 2 1 Non blocking ATCommand send Method seeeeeeeeeeeeees 100 13 1 3 ATCommandListener Interface sssseseeseeeseeessseeesseseeeseseeees 101 13 131 PRT EVORMS aort eterna ete asap svadesanatoleceperadssdmrentseusredenetas 101 A32 implementation s iad teats sein iain 101 13 1 3 3 Registering a Listener with an ATCommand Instance 102 13 2 Programming the MIDlet insisi erinadi didining iiaiai 103 13 21 TRC AGS sie ccs mane a a a e aa a Aa E E 103 13 2 27 Example pe i a a a aa aia 103 14 Differences to the TEAB ueriiureunineusneniieuiuunineniuunsnenuuabn eun una risna hneisa n nEaN 105 TC65_AC75_JAVA User s Guide_V08 Page 6 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released Figures Figure 1 VIO Sid ic acne a ea a erat ct aa gente tema
53. ad command The read command can be used to request the current status of java security AT SJSEC Response ASJSEC lt state gt lt HTTPS state gt lt OBEX state gt lt untrusted domain gt lt certificate content gt lt state gt Java security mode 0 Unsecured mode i e security mode not active default 1 Secured mode i e security mode active lt HTTPS state gt 0 The HTTPS connection or Secure Connection is possible if the server certificate or certificate chain is valid default 1 The HTTPS Connection or Secure Connection is possible only if the server certificate is signed by the customer owner of root certificate in device lt OBEX state gt 0 Start of Module Exchange Suite is not permitted 1 Start of Module Exchange Suite is permitted default lt untrusted domain gt 0 Untrusted domain does not exist MIDlets must be signed default 1 Untrusted domain does exist unsigned MIDlets have limited rights of access to the Java API Certificate Information default no certificate Issuer SerialNumber Subject Signature algorithm Thumbprint algoritm Thumbprint TC65_AC75_JAVA User s Guide_V08 Page 93 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 12 5 Create a Java Security Environment Step by Step 12 5 1 Create Key store The key store contains the key pairs for signing data For producing the key store with keys the tool keytool exe can be used The program
54. am Files Siemens SMTK lt product name gt WTK VersionWTK txt 3 2 1 3 SDK JDK This is software provided by SUN to support Java application development SMTK emulator uses the following JDK stored in JavaSoft Registry key for starting the Debug Agent e Registry path HKEY_LOCAL_MACHINE SOFTWARE WavaSoft Java Development Kit 1 4 e Registry key JavaHome e g C j2sdk1 4 2_09 e Registry path HKEY_LOCAL_MACHINE SOFTWARE WavaSoft Java Runtime Environment 1 4 e Registry key JavaHome e g C Program Files Java j2re1 4 2_09 TC65_AC75_ JAVA User s Guide_V08 Page 13 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 3 2 1 4 NetBeans IDE 5 0 This is a Java IDE provided by SUN to support Java application development 3 2 1 5 Eclipse 3 1 2 IDE and Eclipse ME Plugin 1 2 3 This is a Java IDE provided by the Eclipse Foundation to support Java application development The installed Eclipse Version and ME Plugin can be read out after starting Eclipse and selecting e Eclipse menu Help gt About Eclipse SDK and looking for the Eclipse version e g Version 3 1 2 Build id M20060118 1600 e Eclipse menu Help gt About Eclipse SDK press button lt Feature Details gt and look for the ME Plugin version e g EclipseME J2ME Development Tools for the Eclipse Version 1 2 3 Used JDK from IDE e g selecting Eclipse menu Help gt About Eclipse SDK gt Configuration Details and look for java version and java vm ve
55. an be used as an RS 232 port or and System out Refer to the Java doc 5 for details 4 2 2 General Purpose I O There are ten I O pins that can be configured for general purpose I O One pin can be configured as a pulse counter All lines can be accessed under Java by AT commands See 3 and 4 for information about usage and startup behavior 4 2 3 DAC ADC There are two analogue input lines and one analogue output line They are accessed by AT commands See 3 and 4 for details The TC65 Terminal does not feature DAC interface 4 2 4 ASC1 ASC1 is the second serial interface on the module This is a 4 pin interface RX TX RTS CTS It can be used as a second AT interface when a Java application is not running or by a running Java application as RS 232 port or and System out The TC65 Terminal does not feature ASC1 4 2 5 Digital Audio Interface DAI The ME has a seven line serial interface with one input data clock line and input output data and frame lines to support the DAI Refer to the AT Command Set 3 and Hardware Interface Description 4 documents for more information TC65 Terminal does not feature a DAI interface 4 2 6 12C SPI There is a 4 line serial interface which can be used as 2C or SPI interface It is described in the Hardware Interface Description 4 The at sspi at command configures and drives this interface For details see 4 TC65_AC75_ JAVA User s Guide_V08 Page 22 of 105 2006 06 12
56. an switch to the SMTK emulator project dependent using the context menu for project properties e g HelloSample lt properties gt and select the emulator platform and the device e g Siemens IMP NG TC65 R2 Wireless Toolkit and IMP_NG_TC65_R2 for TC65 Release 2 See Figure 32 HelloSample p Project Configuration DefaultConfiguration v Manage Configurations Category General oh Platform oy Abilities Emulator Platform Siemens IMP NG TC65 R2 Wireless Toolkit Manage Emulators J2ME Wireless Toolkit 2 2 Siemens IMP NG TC65 R2 Wireless Toolkit ola Fr gt Application Descriptor ES Attributes midlets E Push Registry Device Configuration caoc 1 1 L API Permissions j Build Device Profile IMP NG Sources Filtering 8 Compiling S Libraries amp Resources amp obfuscating 3B Creating JAR E Signing F Generating Javadoc gt Running Deploying v OK Cancel Help Device v Optional Packages Figure 32 NetBeans IDE 5 0 Switching to IMP NG emulator TC65_AC75_JAVA User s Guide_V08 Page 65 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 11 3 1 2 Templates Templates for a Siemens MIDlet can be found in the file explorer and under NetBeans IDE 5 0 menu File gt New File The MIDlet template provides the skeleton of an IMP NG MIDlet application A wizard New File will be opened Please select category IMP NG and File Ty
57. aram data UINT16 UINT16 part of the cmd structure for the creation of the signature total len all bytes of the command structure including size of total len param len all bytes of the parameter structure including size of param len 0x0001 certificate data content of der file 0x0002 0x0005 0x00 or 0x01 on off switch 0x00 off 0x01 on 0x0003 0x0014 IMEI numeric numbers in ASCII format zero terminated string 0x0004 D signature data SHA 1signature the of command base64 coded zero terminated string List of commands D depend from the length of parameter a 0x0001 Set Customer Root Certificate 0x0002 Del Customer Root Certificate 0x0003 Switch on off Certificate Verification for HTTPS Connections 0x0004 Switch on off OBEX Functionality 0x0005 Switch on off Security Mode of the module 0x0006 Switch on off Untrusted Domain inside of the Security Mode Set Customer Root Certificate total len 0x0001 0x0003 param unit certificate param unit IMEI param unit signature Del Customer Root Certificate total len 0x0002 0x0002 param unit IMEI param unit signature Switch on off Certificate Verification for HTTPS Connections total len 0x0003 0x0003 param unit switch param unit IMEI param unit signature Switch on off OBEX Functionality total len 0x0004 0x0003 param unit switch
58. arted when the keyword START possibly with a parameter is contained in the SM and the parameter set is valid for the requested operation It always ends with a reboot either when the operation is completed an error occurred or the safety timer expired This also means that all parameters previously set by SM are gone Apart from the first and the last line in this example these are the parameters described in the previous section Possible parameters for the START keyword are install delete or nothing In the last case an install operation is done by default The network does not guarantee the order of SMs So when using multiple SMs to start an OTAP operation their order on the receiving side might be different from the order in which they were sent This could lead to trouble because the OTAP operation might start before all parameters are received If you discover such problems try waiting a few seconds between each SM 8 5 Java File Format In general all Java files have to comply with the IMP NG and ME specifications There are certain components of the JAD file that the developer must pay attention to when using OTAP e MlDlet Jar URL make sure that this parameter points to a location on the network where your latest JAR files will be located e g http 192 168 1 3 datafiles mytest jar not in the filesystem like file a java mytest mytest jar Otherwise this JAD file is useless for OTAP e MlDlet Install Notify
59. ate e g 115200 for debugging connection and MES transfer for downloading the MIDlet to the module in dialog box Select COM Port After that MES will be installed without further user action Please wait until setup is complete Please click lt Finish gt in the summary dialog to confirm the completed installation A detailed description of the SMTK installation is given in the following chapters TC65_AC75_JAVA User s Guide_V08 Page 16 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 3 4 Siemens Mobility Toolkit Installation The SMTK comes with an installation CD The installation program automatically installs the necessary components and IDE integrations Software can be uninstalled and updated with the install program The next sections cover the installation and removal of the SMTK and the installation of the SDK and the supported IDEs 3 4 1 Installing the Standard Development Toolkit 1 The JDK version 1 4 2_09 is provided on the SMTK installation disk in the subdirectory JDK 1 4 To begin the installation start the j2sdk 1_4_2_09 windows i586 p exe and follow the instructions of the JDK setup procedure If there is no JDK installed on the target machine the installation of the provided JDK will be offered automatically during the SMTK installation process 2 Once the toolkit has been installed the environment variable path can be altered to comfortably use the JDK tools This i
60. ate 1 Default No Java Running This is the default state The Java application is inactive and there is an AT interface with CSD on ASCO as well as ASC1 The initial state of the pins is according to 4 AT parser AT parser with CSD with CSD ASC 0 REEI ED 10 GPIO I2C SPI_ pins unused Figure 8 Module State 1 4 4 1 2 State 2 No Java Running General Purpose I O and I2C SPI The Java application is inactive There is an AT parser with CSD on ASCO as well as ASC1 Up to ten I O pins are used as general purpose I O plus a I2C SPI interface The pins are configured by at scpin and at sspi refer to AT Command Set 3 AT parser AT parser with CSD with CSD ASC 1 or USB upto 10 GRIO pins 120A Figure 9 Module State 2 4 4 1 3 State 4 Default Java Application Active The Java application is active and ASCO and ASC1 are used as System out and or CommConnection Java instances of AT commands are connected to the available AT parsers The Java application is activated with at sjra refer to AT Command Set 3 or autostart Java access to serial ASCO Java AT command API Java AT command API Java AT command API PSSA with CSD without CSD without CSD Figure 10 Module State 4 4 4 1 4 State 5 Java Application Active General Purpose I O and I2C SPI The Java application is active and ASCO and ASC1 are used as System out and or CommConnection The Java application is act
61. bugger from an IDE The configuration can be done at any time using the AT command at scfg see 3 for details and is non volatile 5 9 1 Serial interfaces System out can be written to any of the serial interfaces ASCO ASC1 or USB If System out is redirected to one of the interfaces used for the Java CommConnection the interface will be shared between System out and the CommConnection This will result in mixed output if data is written to the CommConnections OutputStream and something is printed via System out at the same time Using System out and CommConnection on the same serial interface may be done if a device connected to the serial port is only transmitting data to the module It is recommended to ensure already in the HW design that output from the module cannot be transferred to a connected device TC65_AC75_ JAVA User s Guide_V08 Page 32 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 5 9 2 File The System out print can be redirected into log files within the module s flash file system The output will be written alternatingly into two files which can be concatenated afterwards to have a single log file Writing the output to a file will slow down the virtual machine To reduce the impact of logging the output may be written first to a buffer before it is written to the file buffered mode The buffered output is written either if the buffer is filled or after 200 ms If the buffer is not used
62. by URC SYSSTART AIRPLANE MODE Since the radio is off all classes related to networking connections e g SocketConnection UDPDatagramConnection SocketServerConnection HTTPConnection will throw an exception when accessed 5 6 Alarm The ALARM can be set with the aftcala AT command Please refer to the AT Command Set 3 and Hardware Interface Description 4 for more information One can set an alarm switch off the module with at smso and have the module restart at the time set with at cala When the alarm triggers the module restarts in a limited functionality mode the airplane mode Only a limited number of AT commands are available in this mode although the JVM is started when autostart is enabled A Java application must be able to handle this mode and reset the module to reinstate the normal mode The mode of a module started by an alarm is indicated by the URC ASYSSTART AIRPLANE MODE Note For detailed information which functionality is available in this mode see 3 and 4 The mode indicating URC is created after issuing the very first AT command on any opened channel 5 7 Shutdown If an unexpected shutdown occurs data scheduled to be written will get lost due to a buffered write access to the flash file system The best and safest approach to powering down the module is to issue the AT SMSO command This procedure lets the engine log off from the network and allows the software to enter a secure state and save
63. call The data rates are also up to 180kbit s Test conditions same as in Sect 5 11 3 1 ac yo awe aco Xo TC65 Java application looping data LOSY Figure 16 Scenario for testing data rates on ASC1 with a voice call in parallel TC65_AC75_JAVA User s Guide _V08 Page 36 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 5 11 3 3 Scenarios with GPRS Connection The biggest challenges to the module performance are setting up a GPRS connection receiving data on javax microedition io interfaces and sending or receiving the data on the RS232 API with the help of a Java application 5 11 3 3 1 Upload Since the ME supports GPRS class 12 up to four timeslots for upload data are available The Java application receives data over RS232 API and sends them over GPRS to a server Table 1 Download data rate with different number of timeslots CS2 Upload data rate with x timeslots Coding scheme 2 kbit s L 9 12 75 net transmission rates for LLC layer Table 2 Download data rate with different number of timeslots CS4 Upload data rate with x timeslots Coding scheme 4 kbit s theor from theor from theor from theor from Value theor Value theor Value theor Value theor value value value value 13 20 65 22 40 55 20 60 33 13 80 16 net transmissi
64. cate by the module 2 22 2222 aS a e aaa a YannannnnnannnnnnnnnnannanenT v rr Cc Be pill TCP IP Connection O oom HTTPS Server Module Figure 54 Mode 1 Customer Root Certificate does not exist TC65_AC75_ JAVA User s Guide_V08 Page 83 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released CA Root Certificate X 509 Q a self singned private key public key from from owner of owner of the the certificate certificate CA 5s TCP IP Connection gt ome HTTPS Server meee a Module oaa lee test whether certificates are identical Figure 55 Mode 2 Server Certificate and Certificate into module are identical chain of certificates j Yili etme ones ee x Server CA Root Certificate Certificate X 509 X 509 A Sign self singned signature of ed the a R the CA Ver o 0 Ertis private key blic key f tificate z rivate ke from owner of PUDNC Fil polo con eee owner of the owner of the Pe A certificate certificate CA the CA certificate 4 AY NG E 3 HPSS Ishaan TCP IP Connection erver Tt ww eee test whether i certificates i are identical re SS Server CA root oo 5 Certificate Certificate k Figure 56 Mode 2 Server Certificate and self signed root Certificate in module
65. cc eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees 53 9T B ild Results aiti erin a a aea a a a AA a e aea 53 9 2 eTa aO e E AE E Gass A aa ae Rake 54 9 3 Run on the Module with Manual Start ccceeeeeseeeseeeeeseeeeeeeeeeeeeeeseeeeeeees 54 9 4 Run on the Module with Autostart cccceeeeceeeeeeeeeeeeeeeeeeeeeeeeeeaaeeaeeeeeeeeeeeaaes 54 9 4 1 SSWHCHOMAULOStOM ce tcanzccricstdcerdsaatsaxuiddecerdcans cartasie cand saae dardedbecerdearinaatens 55 942 Switch Off Autosta eenn ea iin otitis eho ss aired doen ae 55 10 Compile and Run a Program with a Java IDE 0 eee eee eeeeeeeeeeeeeeeeeeeeeeeeeeees 56 10 1 Eclipse 3 1 2 with ME Plugin 12 23 000 eas a cee cnt eeenndasneegenn ceocedavdansty inten opadadianegte 56 10 1 1 Setup a New PROlSCE lace ce canes sus dertnatico acer tas tesa rind cert cavene s taser teenies ee 56 11 Debug Environment ccieccisenweisiercimusiducuwusauustwaraducuesssuestweraducuuisaeustwiwarucauestawekwanciwetuenscus 61 11 1 Data Flow of a Java Application in the Debug Environment ee 61 AZ EmUlatO E E E E E E E T 62 A cad Ne D EE T E A E cteacaaritys 63 TOs NetBeans DESO desees a ea ep TE OEE EE cath TETKE NE IEEE 64 11 3 1 1 Switching emulator to IMP NG emulator ecceeeeeeeeeeeeeeeeeeteees 65 11 312 Templates a a r a e ae a aa a a aaea 66 aS a e A e aaO E E hss A E EA EA A 67 TESA Compile and TUM ncen a a E tonnes 68 11 3 1 5 Starting debugging session without
66. chapter explains how to compile and run a Java application without a Java IDE 9 1 Build Results A JAR file must be created by compiling an SMTK project A JAR file will contain the class files and auxiliary resources associated with an application A JAD file contains information file name size version etc on the actual content of the associated JAR file It must be written by the user The JAR file has the jar extension and the JAD file has the jad extension A JAD file is always required no matter whether the module is provisioned with the Module Exchange Suite as described in Section 7 1 or with OTA provisioning OTA provisioning is described in Chapter 8 In addition to class and resource files a JAR file contains a manifest file which describes the contents of the JAR The manifest has the name manifest mf and is automatically stored in the JAR file itself An IMP manifest file for packag xample mytest public class MyTest extends MIDlet includes at least Manifest Version 1 0 MIDlet Name MyTest MIDlet Version 1 0 1 MIDlet Vendor Siemens MIDlet 1 MyTest example mytest MyTest MicroEdition Profile IMP NG MicroEdition Configuration CLDC 1 1 A JAD file must be written by the developer and must include at least MIDlet Name MyTest MIDlet Version 1 0 1 MIDlet Vendor Siemens MIDlet 1 MyTest example mytest MyTest MIDlet Jar URL http 192 168 1 3 datafiles MyTest jar
67. cted limited device configuration hot spot implementation IMP NG the information module profile ou generation this is for the most part identical to MIDP 2 0 but without the Icdui package e Additional Java virtual machine interfaces AT Command API File I O API The data flow through these interfaces is shown in Figure 7 and Figure 30 e Memory space for Java programs Flash File System around 1700k RAM around 400k Application code and data share the space in the flash file system and in RAM e Additional accessible periphery for Java applications e A maximum of ten digital I O pins usable for example as Output status LEDs Input Emergency Button One I2C SPI Interface One Digital Analog Converter and two Analog Digital Converters Serial interface RS 232 API This standard serial interface could be used for example with an external GPS device or a current meter For detailed information see chapter 4 2 TC65_AC75_ JAVA User s Guide_V08 Page 21 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 4 2 Interfaces 4 2 1 ASCO Serial Device ASCO an Asynchronous Serial Controller is a 9 wire serial interface It is described in the Hardware Interface Description 4 Without a running Java application the module can be controlled by sending AT commands over ASCO Furthermore ASCO is designed for transferring files from the development PC to the module When a Java application is started ASCO c
68. ction are synchronized in the user implementation 13 1 2 ATCommandResponseListener Interface The ATCommandResponseListener interface defines the capabilities for receiving the response to an AT command sent to one of the module s AT parsers When the user wants to use the non blocking version of the ATCommand send function of an implementation class of the ATCommandResponseListener interface must be created first The single method of this class ATResponse must contain the processing code for the possible response to the AT command sent class MyListener implements ATCommandResponseListener String listen for public MyListener String awaited response listen for awaited_response void ATResponse String Response if Response indexOf listen for gt 0 System out println received strRcv 13 1 2 1 Non blocking ATCommand send Method After creating an instance of the ATCommandResponseListener class the class instance can be passed as the second parameter of the non blocking ATCommand send method After the AT command has been passed to the AT parser the function returns immediately and the response to the AT command is passed to this callback class later when it becomes available Somewhere in the application MyListener connect list new MyListener CONNECT atc send ATD CALLED NO r connect list Application continues while the AT command is processed When
69. d signature In addition the device will only accept special commands from the customer if they are marked with a signature The device examines each command with the public key of the customer root certificate The secured mode supports a simple protection domain concept providing a domain for unsigned MlDlets If this domain domain for untrusted MIDlets is active then an unsigned MIDlet is assigned to this domain and has only limited access to the Java API The untrusted domain is activated by use of Java Security Command Switch ON Untrusted Domain see chapter 12 5 3 untrusted domain HTTP Connection is permitted TCP IP Socket Connection is permitted Standard behavior of the module Siemens supplies modules with unsecured mode as the default configuration Insert the certificate The module changes into the mode trusted for MIDlet execution Untrusted Domain is OFF HTTPS certificate verification is OFF MES is ON Remove the certificate The module changes into the mode untrusted for MIDlet execution HTTPS certificate verification is OFF MES is ON TC65_AC75_JAVA User s Guide _V08 Page 87 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 12 2 1 Change to Secured Mode Concept Create and insert a customer root certificate A condition for the change to the secured mode is the existence of a customer root certificate inside of the module generate key pair
70. d for it to enter the Active state The application management software no longer needs the application be active so it signals it to stop performing its service by calling the M Dlet pauseApp method The application management software has determined that the MIDlet is no longer needed or perhaps needs to make room for a higher priority application in memory so it signals the MIDlet that it is a candidate to be destroyed by calling the MlDlet destroyApp method TC65_AC75_JAVA User s Guide_V08 Page 40 of 105 MIDlet The default no argument constructor for the MIDlet is called it is in the Paused state The MIDlet acquires any resources it needs and begins to perform its service The MIDlet stops performing its service and might choose to release some resources it currently holds If it has been designed to do so the MIDlet saves state or user preferences and performs clean up 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 6 3 Hello World MIDlet Here is a sample HelloWorld program HelloWorld java Ei package example helloworld import javax microedition midlet import java io public class HelloWorld extends MIDlet HelloWorld default constructor public HelloWorld System out println HelloWorld Constructor startApp public void startApp throws MIDletStateChangeException System out printin HelloWorld startApp
71. d jpx gi public class HelloWorld extends MIDlet S Project Source 26 4 HellovWorld java 29 fret gt example helloworld 30 Default constructor 3 MiDlet Suite 1 121 bytes 3i Bi HelloWorld jar 327 public HelloWorla New gt System out println nConstructor n Open Rename Helloworld jad grt This is the main application entry point Here we simply give some text output and close the application immediately again d public void startApp throws MIDletStateChangeException System out println nstartApp n Delete HelloWorld jad Micro Run using Helloworld Project File Bri Bas Properties k m System out println nHello World n uig ejs B Egli 43 E Ba Javadoc Conflicts destroyApp true E 5 Imports 45 Hellaworla 46 E midlet 47 jee Hetlowioridc 48 Called when the application has to be temporary paused 49 50 public void pauseApp 51 System out printiln npauseApp n ay 52 54 ft 55 Called when the application is destroyed Here we must clean 56 oun_everethine not handled he the narhane colleerar vi P os an gt 20 Helowworid java Insert 441 CUA Qe Source Design Bean Doc History Screens Debug the MiDlet s contained in the selected JAD file with the emulator using HelloVVorld Figure 47 JBuilder X Starting the debugging session TC65_AC
72. d over several SMs There is one single keyword to start the OTAP procedure For parameters that are repeated in several SMs only the last value sent is valid For example an SM could look like this Install operation First SM OTAP_IMPNG PWD secret JADURL hittp www greatcompany com coolapps mega jad APPDIR a work appdir HTTPUSER user HTTPPWD anothersecret Second SM OTAP_IMPNG PWD secret BEARER gprs APNORNUMaccess to thenet net NETUSER nobody NETPWD3 nothing DNS 192 168 1 2 START install Delete operation OTAP_IMPNG PWD secret APPDIR a work appdir START delete The first line is required it is used to identify an OTAP SM All other lines are optional and their order is insignificant each line is terminated with an LF n including the last one The keywords in capital letters are case sensitive A colon separates the keywords from their values TC65_AC75_ JAVA User s Guide_V08 Page 46 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released The values of APPDIR BEARER and START are used internally and must be lower case The password PWD is case sensitive The case sensitivity of the other parameter values depends on the server application or the network It is likely that not all parameters can be sent in one SM They can be distributed over several SMs Every SM needs to contain the identifying first line OTAP_IMPNG and the PWD parameter if a mandatory password has been enabled OTAP is st
73. d to die if runThreads true System out printlin Thread loops Stopped from outside Leave thread return Print loop counter and wait 1 second do something useful here instead TC65_AC75_JAVA User s Guide_V08 Page 103 of 105 2006 06 12 JAVA User s Guide Confidential Released System out println Thread loops try Thread sleep 1000 catch InterruptedException e System out println e System out printlin Thread loops ThreadDemo constructor public ThreadDemo System out printin ThreadDemo threadl new DemoThread 2 thread2 new DemoThread 6 Constructor startApp ay public void startApp throws MIDletStateChang SIEMENS Loop 1 Finished naturally creating threads System out printin ThreadDemo startApp threadl start thread2 start System out printin ThreadDemo try Thread sleep 4000 catch InterruptedException e System out printlin e destroyApp true System out printin ThreadDemo pauseApp public void pauseApp System out println ThreadDemo destroyApp BY public void destroyApp boolean cond System out printin ThreadDemo destroyApp System out printin ThreadDemo runThreads false try System out printin ThreadDemo hreadl join hread2 join
74. d3 S att cpin AT Cmd4 R CPIN READY AT Cmd5 R 70K AT Cmd6 5 atAscfg userware debuginterface 192 168 0 2 192 168 0 1 0 AT CMd7 R ASCFG Userware DebugInterface 192 168 0 2 192 168 0 1 0 AT cmd8 R 20K AT Cmd9 S at scfg userware mode debug a 2000 AT Cmd10 R ASCFG Userware Mode debug a 2000 AT Cmd11 R 0K AT Cmd12 5 atAscfg userware stdout UDP AT Cmd13 R ASCFG Userware Stdout UDP AT Cmd14 R 0K System out port used UDP port number range 1024 65535 comment out the following line for switching off Java System out displaying in the IDE window UDPport 12345 z Figure 53 Emulator configuration file switching Java System out to serial port The following line of the WM Debug _config ini file is used for switching the Java System out direction UDPport 12345 To switch the Java System out direction to the UDP socket and displaying it on a IDE window please remove The configuration line looks as follows UDPport 12345 To switch the Java System out direction to serial port output please add default setting The configuration line looks as follows UDPport 12345 Remarks Please keep in mind that the handling of Java System out is done asynchronous It is possible that not all Java System out data are written into the IDE window To avoid this problem please set a breakpoint in front of the Java function cal
75. de_V08 Page 89 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 12 3 Application and Data Protection In addition to the Java secured mode it is possible to prevent the activation of the Module Exchange Suite When Module Exchange Suite access is deactivated with at sjsec it is no longer possible to access to the Flash file system on the module A condition for the deactivation of the access to the Flash file system is the existence of a customer root certificate inside of the module see 12 2 1 The default state of MES is ON 12 4 Structure and Description of the Java Security Commands Special commands are used in the Java security environment These commands are transferred to the module with the help of the special AT command at sjec This command makes it possible to send binary data to the module After at sjsec is issued the module changes into a block transfer mode Now binary data in a fixed format can be sent These binary data contain the actual Java security commands TC65_AC75_JAVA User s Guide _V08 Page 90 of 105 2006 06 12 JAVA User s Guide Confidential Released 12 4 1 Structure of the Java Security Commands SIEMENS General structure List of a signature unit UINT16 UINT16 signature total len cmd param num parameter unit UINT16 UINT16 UINT16 parameter unit OOO 7 param len param id p
76. desutscnncerabsassasadaasaasudwonsnsassessncacececncadeusancadae 43 Ted SRDS CUNY SSUES ne a a a a A 43 7 3 1 Module Exchange Suite nn nnneeeeeeoeeennnrneeeeeererrrnrrrserrrerernnrrserrrrrrrne 43 ESQ SOVWAP a r oa Ue aos be hte 43 TC65_AC75_JAVA User s Guide_V08 Page 4 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 8 Over The Air Provisioning OTAP s seeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees 44 8 1 Introduction to OTAP va5 ice loo ysedaa ca seieleie yea iustd a E O roS 44 8 2 OTAP OvemMiow e a e a aaa a a a aa SEEE E OE EEE 44 8 3 OF AP Paramcte rs rpari GEEAE EAE EEEE E EAE ER Ede aiaiai 45 8 4 Short Message Fortmatiiccsccseccccccectetedavsecit cctetechcgbvscatcceececk Conve stectvoecscgeveess cadences 46 8 5 Java Fle Format receret ae te ovens iuaeehacn odede lasvaehd be e aaraa 47 8 6 PrOCCOUUIES i225 e a T a a a ae ae ea A E 48 8 6 1 Install Ud f ire EAEE EEE 48 8 6 2 Deletei sd wieniecioiawicss ce tivWuaminetene A a N 49 8 7 Time Out Values and Result Codes cseeeeeeeesseeeeeeeeeeeeseeseeseeeeeeeeeeeeeeees 50 8 8 TIPS anal Tricks TORO TAP sas Creen edert ner Epa sas pa tau deta OTE ERTER REPARE Tepr S 50 8 9 OTAP Traen ree aeaaea aer TEE rS EEE PENTE IEI ot Err tatesicsent carscateateoaas 51 8 10 SECUTI Y ireo a e e aig eee te n EEE eck eta eats meee 51 B 11 m 011 Eo E A E E 52 9 Compile and Run a Program without a Java IDE c
77. e AT parser we have two ATCommands instances atcl and atc2 ATListenerA reminder listener new ATListenerA ATListenerB card listener new ATListenerB atcl addListener reminder listener atc2 addListener card listener The ATCommand removeListener method removes a listener object that has been previously added to the internal list table of listener objects After it has been removed from the list it will not be called when URCs occur If it was not previously registered the list remains unchanged The same ATCommandListener may be added to several ATCommand instances and several ATCommandListeners may be added to the same ATCommand TC65_AC75_JAVA User s Guide_V08 Page 102 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 13 2 Programming the MIDlet The life cycle and structure of MIDlets are described in Chapter 6 Since the MIDlets will run on J2ME all of J2ME s features including threads are available Small applications such as those without any timer functions or those used only for tests and simple examples can be written without using threads Longer applications should be implemented with threads 13 2 1 Threads Although small applications can be written without using threads longer applications should use them The Java programming language is naturally multi threaded which can make a substantial difference in the performance of your application Therefore we
78. e Suite or OTA provisioning See Chapter 7 TC65_AC75_ JAVA User s Guide_V08 Page 54 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 9 4 1 Switch on Autostart e There is an AT command at scfg for configuring the autostart functionality Please refer to the AT Command Set 8 e Restart the module 9 4 2 Switch off Autostart There are three methods for switching off the autostart feature e the at4scfg AT command or e the graphical autoexec_off exe tool included in the Installation CD software under wtk bin or e the command line cmd_autoexec_off exe tool included in the Installation CD software under wtk bin To disable the automatic start of a user application in a module these steps must be carried out Using the graphical autoexec_off exe tool Connect the module to the PC Make sure that the module is switched off Start the Autoexec_Off program Select the COM Port Press the AutoExec Off button oe ely Ss Using the command line tool cmd_autoexec_off exe 1 Connect the module to the PC 2 Make sure that the module is switched off 3 Start the command line tool cmd_autoexec_off with option lt com port gt com1 up to com99 for com port selection TC65_AC75_ JAVA User s Guide_V08 Page 55 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 10 Compile and Run a Program with a Java IDE 10 1 Eclipse 3 1 2 with ME Pl
79. e found on their respective homepages Once the proper emulator has been selected as described in the relevant IDE sections below your Java application can be built debugged and executed 11 1 Data Flow of a Java Application in the Debug Environment system out ASC0 1 o 4 Flash File wM JM System _ AT parser gt AT command API File I O API IMP NG gt TCP IP ASC0 1 GPIO I2C SPI DAC ADC ASCO 1 or USB Module PC Com Port IDE Debug environment Figure 30 Data flow of a Java application in the debug environment In the debug environment the module is connected to a PC via a serial interface This can be a USB or an RS232 line The application can then be edited built debugged or run within an IDE on the PC When running or debugging the MIDlet under IDE control it is executed on the module on device execution not on the PC This can be either debugging mode where the midlet execution can still be controlled from the IDE on device debugging or normal mode where the midlet is copied to the module and started normally This ensures that all interfaces behave the same whether debugging mode is used or not TC65_AC75_ JAVA User s Guide_V08 Page 61 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 11
80. es Figure 45 JBuilder X Siemens Library TC65_AC75_JAVA User s Guide_V08 Page 75 of 105 2006 06 12 JAVA User s Guide Confidential Released 11 3 3 1 Examples SIEMENS There are sample projects provided with the SMTK These projects can be found in the JBuilderSamples directory of the SMTK installation directory This directory is accessed by opening a project using the menu File gt Open Project see Figure below Q Open Project or Project Group EJ Helloworid zi 7 Siemens S E smTk w Teas w Tees 2 Tc6s_R2 ef EclipseSamples Eg JBuilderSamples a E sre m fo NetBeansSamples wrk fd hin File name HelloWWorld jpx _ File type All JBuilder Projects jpx jpr bpar jpar Figure 46 JBuilder X Sample Projects TC65_AC75_ JAVA User s Guide _V08 Page 76 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released Open the Project e g HelloWorld jpx rebuild the sources and start the debugger using the micro edition context menu HelloWorld jad gt Micro Debug using HelloWorld JBuilder X C Program Files Siemens SMIK 1C65_R2 JBuilderSamples HelloWorld src example helloworld HelloWorld java File Edit Search Refactor View Project Run Team Wizards Tools Window Help D ESDAS Ooo RM KA THAWED w M e o OB XIE Herora 8 8E Heloworlajox 26 7 Hee i fey Hellovvorl
81. executed in the connected module and therefore uses the modules real interfaces The emulation of interfaces such as networking file system or serial interface on the PC side no longer exists jad files required A suitable descriptor file is now not only required for OTAP but in all cases An absent or invalid jad file causes an error when starting an application at sjra or autostart Mandatory attributes the attributes MicroEdition Profile and MicroEdition Configuration are now mandatory attributes in the manifest and jad file Flexible echo When using the ATCommand class the echo is can be switched on and off as in non Java mode The default is echo on In the TC45 the echo was always off activeCount result The method activeCount of class Thread returns the number of threads currently present in the VM In the TC45 only the non sleeping or waiting threads were counted TC65_AC75_ JAVA User s Guide_V08 Page 105 of 105 2006 06 12
82. h the I O stream methods see chapter 12 1 1 3 Some data services i e FTP transfer the data so quickly that the CONNChanged start and close events are received even parallel to the response of the AT command which originated the data connection The user s application must realize that the data connection had taken place and read the data with the I O stream read methods afterwards 13 1 3 1 ATEvents An ATEvent or a URC is a report message sent from the module to the application An unsolicited result code is either delivered automatically when an event occurs or as a result of a query the module previously received However a URC is not issued as a direct response to an executed AT command Some URCs must be activated with an AT command Typical URCs may be information about incoming calls a received SM temperature changes the status of the battery etc A summary of URCs is listed in the AT Command Set document 3 13 1 3 2 Implementation class ATListenerA implements ATCommandListener public void ATEvent String Event if Event indexOf CALA Reminder 1 gt 0 take desired action after receiving the reminder else if Event indexOf CALA Reminder 2 gt 0 take desired action after receiving the reminder else if Event indexOf CALA Reminder 3 gt 0 take desired action after receiving the reminder No action taken for these events public vo
83. he SMTK environment 6 At this point the installation software checks for a Java IDE to be integrated with the SMTK A Java IDE is not necessary to use the SMTK The IDE installation can be done at any time even if the SMTK is already installed To integrate the SMTK into the Java IDE run the SMTK setup program in maintenance mode again However you can continue the setup procedure and install the IDE installation later or cancel the setup program at this stage and restart it after installing one of the supported Java IDEs In case you wish to install a Java IDE please follow the instructions below and in Section TC65_AC75_JAVA User s Guide_V08 Page 17 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 3 4 3 If no installed IDE is found the SMTK offers to install NetBeans IDE 5 0 and NetBeans Mobility package 5 0 Alternatively you can install the SUN IDE by following the instructions in Section 3 4 3 7 Ifthe SDK and one or more Java IDEs are found you will be asked to choose which IDE you want integrated into the development environment Once an IDE has been found and selected press Next to continue Ensure that your Java IDE is closed 8 Select the folder where the SMTK will be installed A folder will be suggested to you but you may browse to select a different one 9 Choose the path that SMTK will appear under in the Start Menu 10 You will be asked to select the COM port for installing the standard modem a
84. i system out ASC0 1 USB Flash File AA System gt AT SE File I O API a IMP NG a gt TCP IP GPIO 12C SPI DAC ADC ASC0 1 Figure 7 Data flow of a Java application running on the module The diagram shows the data flow of a Java application running on the module The data flow of a Java application running in the debug environment can be found in Figure 30 The compiled Java applications are stored as JAR files in the Flash File System of module When the application is started the JVM interprets the JAR file and calls the interfaces to the module environment The module environment consists of the e Flash File System available memory for Java applications e TCP IP module internal TCP IP stack e GPIO general purpose I O e ASCO Asynchronous serial interface 0 e ASC1 Asynchronous serial interface 1 e 12C I2C bus interface e SPI Serial Peripheral Interface e DAC digital analog converter e ADC analog digital converter e AT parser accessible AT parser The Java environment on the module consists of the e JVM Java Virtual Machine e AT command API Java API to AT parser e File API Java API to Flash File System e IMP NG Java API to TCP IP and ASCO TC65_AC75_JAVA User s Guide_V08 Page 24 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 4 4 Handling Interfaces and Data Service Resources To develop Java applications the developer mu
85. id RINGChanged boolean SignalState public void DCDChanged boolean SignalState public void DSRChanged boolean SignalState he class ATListenerB implements ATCommandListener public void ATEvent String Event if Event indexOf SCKS 0 gt 0 System out println SIM Card is not inserted TC65_AC75_ JAVA User s Guide_V08 Page 101 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released perform other actions else if Event indexOf SCKS 1 gt 0 System out println SIM Card is inserted perform other actions public void RINGChanged boolean SignalState take some action when the RING signal changes if you want to public void DCDChanged boolean SignalState take some action when the DCD signal changes if you want to public void DSRChanged boolean SignalState take some action when the DSR signal changes if you want to public void CONNChanged boolean SignalState take some action when the state of a connection changes if you want to 13 1 3 3 Registering a Listener with an ATCommand Instance After creating an instance of the ATCommandListener class it must be passed as a parameter to the ATCommand addListener method The callback methods of the instance will be called by the runtime system each time the corresponding events URCs or signal state changes occur on the corresponding devic
86. ion manually There are some points to notice in case of using the USB interface in a debugging session If you are starting a debugging session very quickly once again after end of a previous debugging session the emulator is not able to select the USB interface and is selecting a standard modem connection Please wait some seconds to avoid this operation system dependent problem because the Windows operation system needs some seconds to enable the USB port once again after the IP connection for remote debugging is closed If necessary the IP addresses used for the debug connection can also be changed This is done in the file wtk bin WM_Debug_config ini For details see also the at scfg command and its Userware DebugInterface parameters described in 3 Please keep in mind that the IP address range 10 x x x is not supported for the configuration of debugging During installation of SMTK some new programs are installed for handling the debugging session in conjunction with the IDE The installation routine of the SMTK doesn t change any configuration of an existing firewall on your PC In the case that a firewall is installed on your PC and the local configured and used IP connection Dial Up Network connection for debugging is blocked or disturbed by this firewall please configure the firewall or the Dial Up Network connection manually to accept the new installed programs and the port or to use another port or contact your local PC
87. is in the Java SDK for a description see http java sun com j2se 1 3 docs tooldocs solaris keytool html Example keytool genkey alias keyname keypass keypassword keystore customer ks storepass keystorepassword sigalg SHAlwithRSA keyalg RSA 12 5 2 Export X 509 Root Certificate For exporting the x 509 root certificate use keytool exe The program is in the Java SDK for description see http java sun com j2se 1 3 docs tooldocs solaris keytool html keytool export v keystore customer ks storepass keystorepassword alias keyname gt certificate der 12 5 3 Create Java Security Commands For producing the java security commands the tool jseccmd jar can be used This program is in the folder wkt bin Command for inserting the Customer Root Certificate In consequence of the command java security mode ON untrusted domain OFF HTTPS certificate verification OFF MES state ON java jar jseccmd jar cmd SetRootCert certfile customer der imei 012345678901234 alias keyname storepass keystorepassword keypass keypassword keystore customer ks gt SetRootCert bin Command for removing the Customer Root Certificate In consequence of the command all switches are reset java security mode OFF untrusted domain OFF HTTPS certificate verification OFF MES state ON java jar jseccmd jar cmd DelRootCert imei 012345678901234 alias keyname storepass keystorepassword keypass keypassword keystore cust
88. ivate key file cakey pem gt openssl pkcs8 in demoCA private cakey pem inform PEM out demoCA private cakey der outform DER nocrypt topk8 2 Create server certificate and java keystore execute command gt keytool genkey alias server keypass keypass keystore customer ks storepass keystorepass sigalg SHAlwithRSA keyalg RSA the field name of the certificate is the domain name or the IP address of the server 3 Create certificate request for server certificate execute command gt keytool certreq alias server file server csr keypass keypass keystore customer ks storepass keystorepass 4 SAJNE certificate request by CA execute command gt openssl ca in server csr out server pem convert file format from PEM to DER gt openssl x509 in server pem inform PEM out server der outform DER TC65_AC75_ JAVA User s Guide_V08 Page 85 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 5 Import CA root certificate and CA private key into java keystore Use the CA Root Certificate for the creation of Java Security Command see chapter 12 5 3 execute command gt java jar setprivatekey jar alias dummyca storepass keystorepass keystore customer ks keypass cakeypass keyfile democa private cakey der certfile democa cacert der 6 Export private key from server certificate The private key is needed for the HTTPS or Secure Connection server configuration execute command gt
89. ivated with at sjra The I O pins are configured with at4scpin the I2C SPI interface with at sspi Refer to the AT Command Set 3 for AT command details Java access to serial andi AT parser 0 AT parser AT parser interface CommComection ee with CSD without CSD without CSD Java AT command API Java AT command API Java AT command API A 1 sit ia o wc Figure 11 Module State 5 TC65_AC75_JAVA User s Guide_V08 Page 26 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 4 4 2 Module State Transitions no Java autostart Java autostart start java at sjra State 1 Default no Java appl running State 4 Default destroy java application Jaa e close I2C SPI open I2C SPI close I2C SPI open I2C SPI State 2 no Java appl running using I2C SPI start java at sjra State 5 Java active using I2C SPI destroy Java application Figure 12 Module State Transition Diagram Note No AT parser is available over serial interface ASCO or ASC1 while a Java application is running on the module TC65_AC75_ JAVA User s Guide_V08 Page 27 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 5 Maintenance The basic maintenance features of the ME are described below Explicit details of these functions and modes can be found in the AT Command Set 3 and the Hardware Interface Description 4 5
90. java jar getprivatekey jar alias server keystore customer ks storepass keystorepass keypass keypass keyfile server privkey der 7 Send CA Root Certificate to the module Create Java Security Command SetRootCert see chapter 12 5 3 Send this command with ATASJSEC 12 4 3 to the module 8 Send Java Security Command Switch on Certificate Verification for HTTPS Connections to the module Result You have a keystore for the configuration of the Java Security of the module You have a signed server certificate files server pem or server der You have a private key file for your server configuration the module contains the CA Root Certificate HTTPS certificate verification is activated TC65_AC75_ JAVA User s Guide_V08 Page 86 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 12 2 Execution Control The Java environment of the ME supports two modes Unsecured mode The device starts all Java applications MIDlets Secured mode A condition for the secured mode of the device is the existence of a certificate inside of the module The customer can activate the secured mode of the device To do so the customer sends a root certificate x 509 certificate and the command Switch ON Security Mode to the device over an AT Interface The device changes from unsecured mode to the secured mode From this time the module will only start Java applications with a vali
91. l notifyDestroyed inside your Java source Java System out using IDE window is only supported during debugging session TC65_AC75_JAVA User s Guide_V08 Page 81 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 12 Java Security The Java Security Model follows the specification of MIDP 2 0 and is IMP NG conforming It integrates only a simple protection domain concept since protection domains are not needed for module use cases Java Security is divided into two main areas e secure MIDlet data links HTTPS Secure Connection see chapter 12 1 e execution of signed unsigned MIDlets see chapter 12 2 The interface of Java Security offers the following functionality e insert delete X 509 certificate default is no certificate see 12 2 1 e switch between trusted and untrusted mode for the execution of MIDlet default is trusted after inserting the certificate see 12 2 1 e enable disable untrusted domain in trusted mode default is disabled e switch MES default is ON see 12 3 e switch https certificate verification default is OFF see 12 1 TC65_AC75_ JAVA User s Guide_V08 Page 82 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 12 1 Secure Data Transfer This feature makes it possible for MIDlets to use safe data links to external communications partners The specification IMP NG defines two java classes with this characteristic HTTPSConnection and SecureCon
92. lular phones must be followed Siemens or its suppliers shall regardless of any legal theory upon which the claim is based not be liable for any consequential incidental direct indirect punitive or other damages whatsoever including without limitation damages for loss of business profits business interruption loss of business information or data or other pecuniary loss arising out the use of or inability to use the documentation and or product even if Siemens has been advised of the possibility of such damages The foregoing limitations of liability shall not apply in case of mandatory liability e g under the German Product Liability Act in case of intent gross negligence injury of life body or health or breach of a condition which goes to the root of the contract However claims for damages arising from a breach of a condition which goes to the root of the contract shall be limited to the foreseeable damage which is intrinsic to the contract unless caused by intent or gross negligence or based on liability for injury of life body or health The above provision does not imply a change on the burden of proof to the detriment of the recipient Subject to change without notice at any time The interpretation of this general note shall be governed and construed according to German law without reference to any other substantive law Copyright Transmittal reproduction dissemination and or editing of this document as well as utilizatio
93. n of its contents and communication thereof to others without express authorization are prohibited Offenders will be held liable for payment of damages All rights created by patent grant or registration of a utility model or design patent are reserved Copyright Siemens AG 2006 Trademark notices MS Windows is a registered trademark of Microsoft Corporation Java and Sun NetBeans IDE 5 0 are registered trademarks of Sun Microsystems Inc Borland JBuilder is a registered trademark of Borland Software Corporation TC65_AC75_JAVA User s Guide_V08 Page 2 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released Table of Contents 1 2 PrelaGe SRE T 9 OVEN VIG Woo EEA E EA E A 10 2 1 Related DOCUMENHS ccc ceceecceeeeccceceeeeeeeeeeeeceeeaeaaaaeeeeeseeeeaaeasaeeeeeeeseeeaaeees 10 2 2 Terms and Abbreviations is jearen drae eea aE e RE EEA a Ea ERE AERES 11 IStallatin iiss ied civic a apaa aaea aare aaa aaea arasman Ea eaa ae A aana apara Saboia anina 12 3 1 System Requirements eenen ennnen ennnen nennen nenene 12 3 2 Installation GD si aeneere nunen E NE ENE 12 3 2 1 Components iis A a a A a a ee Ea 13 3 2 1 1 Module Exchange Suite 2 21 23 s ccce ee i eee heehee ee 13 3 2 1 2 WV TK AE E A hea ateaatonssem tas 13 3 2 1 3 SDKI JDK a Sistas anena ses sa eleva secede cadena ESAE ETEEN 13 3 2 1 4 NetBeans IDE D O sitet haces ene ase eaten 14 3 2 1 5 Eclipse 3 1 2 IDE and Eclipse ME Plugin 1 2 3
94. na J com Figure 39 Eclipse Project import TC65_AC75_JAVA User s Guide_V08 Page 70 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released The following figure shows the Hello World example in the IDE Java HelloWorld java Eclipse Platform DAR File Edit Source Refactor Navigate Search Project Run Window Help 0 Q JEEG e 7 7 EY tava Resource D Helloworld java 2 B Outline 23 asy LRL tv 2 HelloWorld 26 Default constructor example helloworld E example helloworld 27 id import declarations 1 He java public HelloWorld j HelloWorld J2ME library Siemens IMP NG Default System out println Constructor HelloWorld classes zip C siemens smtk TC6S a startApp gt deployed a pauseApp verified itt a destroyApp boolean HelloWorld jad This is the main application entry point Here we simply text output and close the application immediately again Ry public void startdpp throws MIDletStateChangeException System out println starta pp System out println nHello World n notifyDestroyed ft Called when the application has to be temporary paused ae public void pauseapp System out printin pausedpp lt Problems 3 Javadoc Declaration v 10 errors 0 warnings 0 infos Description Resource In Folder Locati
95. nd Dial Up Network connection DUN needed for on device debugging If standard modem and Dial Up Network connection DUN is already installed for another Siemens IMP NG product you will be asked to reconfigure this connection e g selecting another COM port for all IMP NG on device debugging by pressing Yes or to use the configured COM settings by pressing No Note You can reconfigure the COM port for the Dial Up Network connection any time after installation by starting SMTK setup in maintenance mode and selecting Repair mode If you like to use an USB modem connection please install and configure that USB modem connection after SMTK installation manually Therefore please plug in the USB cable in the module and PC install the USB modem driver and select the USB modem connection using windows Control Panel gt Network Connections for the network connection IP connection for remote debugging 11 A brief summary of all entries made is shown Press Next to continue 12 A status message box will inform you that the Module Exchange Suite MES will be installed in the next step A separate setup wizard for the Module Exchange Suite will be opened Please follow the setup wizard s instructions 13 After step 12 all necessary files will be copied from the CD into the target folder 14 This is the final step Again a listing of all installed components appears Please press Finish to end the installati
96. ndFailedException try d4 ATCommand atc new ATCommand false An instance of ATCommand is created CSD is not explicitly requested catch ATCommandFailedException e System out println e The csdSupported method returns the CSD capability of the connected instance of the device s AT parser The method checks as well if the current mode of the module supports CSD Please notice that this check has not been done when opening the ATCommand instance boolean csd support atc csdSupported release releases the resources held by the instance of the ATCommand class After calling this function the class instance cannot be used any more but the resources are free to be used by a new instance TC65_AC75_ JAVA User s Guide_V08 Page 97 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 13 1 1 2 Sending an AT Command to the Device the send Method An AT command is sent to the device by using the send method The AT command is sent as a string which must include the finalizing line feed r or the corresponding line end character String response atc send at tcpin r method returns when the module returns a response System out println response Possible response printed to System out CPIN READY OK This send function is a blocking call which means that the calling thread will be interrupted until the module returns a response The function returns the response
97. nection The Siemens implementation follows the recommendations in IMP NG HTTPSConnection e HTTP over TLS as documented in RFC 2818 and TLS Protocol Version 1 0 as specified in RFC 2246 SecureConnection e TLS Protocol Version 1 0 as specified in RFC 2246 Two modes exist for safe data links Mode 1 e No examination of the server certificate takes place when setting up the connection The authenticity of the server certificate is not verified Figure 54 Mode 1 Customer Root Certificate does not exist Mode 2 see 12 2 1 Change to Secured Mode 1 Step e Customer Root Certificate is inside of the module e Command Switch on Certificate Verification for HTTPS Connections was sent e The server certificate is examined when setting up a connection Two configurations are valid The server certificate is identical to the certificate in the module both certificates are self signed root certificates or the server certificate forms a chain with the certificate of the module Thus the authenticity of the server certificate can be examined with the help of the certificate of the module Figure 55 Mode 2 Server Certificate and Certificate into module are identical and Figure 56 Mode 2 Server Certificate and self signed root Certificate in module form a chain Server Certificate Qn X 509 public key from owner of the certificate private key from owner of the certificate no check of the certifi
98. ns IDE 5 0 installed emulators 0 ce eeeeeeeeeeeeeeeeeeteeeeeeeteneeeeeeeeeeeeeeee 64 Figure 32 NetBeans IDE 5 0 Switching to IMP NG emulator 65 Figure 33 NetBeans IDE 5 0 Selecting an IMP NG MIDlet template e g project Test 66 Figure 34 NetBeans IDE 5 0 selecting sample project Hello World Sample 0 67 Figure 35 NetBeans IDE 5 0 confirmation of sample project Hello World Sample 67 Figure 36 NetBeans IDE 5 0 add emulator option noload e g project HelloSample 68 Figure 37 Eclipse Display of different integrated emulators cc ccceeeeeeeeeeeeeeeeeeeeeeeeeeees 69 Figure 38 Eclipse J2ME platform nnnnnnnrrrrrrrrtrrttrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrtrtrrrrtttt 70 Fig re 39 Eclipse Project imports 2e2c2 ce nccnncreneacicenceieesnt ed ein ad ninais rir ninn iiia nia 70 Figure 40 Eclipse Example ccccccccccseceeeececeeeaeeseeeeeeeeecaeaaeaaeeeeeeseeeeaaaaseeeeeeeeeseeaenees 71 Figure 41 Eclipse Create package ssossseeeneeessorreetttttrnrrtsstttttrrrnnreserrrtrrrnnnrsoeernne ne 72 Figure 42 Eclipse Configuration cccccceeseeesecceeeeeeeeeeeeeeeeeeneaeeeeeeeeeeeeenecaaaaeeeeeeeeneeea 73 Figure 43 Eclipse Configuration c 2 cccc ccc cetccechyenne dennehcenccdennatedenbueneedeetoboteetbencedesnotetenthene 74 Figure 44 gt J Builder X JDK SQUINGS sics sais seta ale cs cede Neen cae ta
99. number as a fixed parameter This way applications can only be downloaded from one specific server e Asa side effect OTAP can be used to simply reboot the module Simply start an OTAP procedure with a parameter set which will not really do anything such as a delete operation on a nonexistent directory e f you do not want to start OTAP by SMS let your Java application do it by issuing the at sjotap command This triggers an install update operation as described in chapter 8 6 1 but without the SMS part Note If a malfunctioning Java application is loaded the SM method will still be needed for another update e The OTAP procedure cannot be tested in the debug environment e Be aware that the module needs to be logged into the network to do OTAP That means that either the Java application must enter the PIN the PIN needs to be disabled or Autopin see AT Command Set 3 needs be used e The OTAP procedure might fail due to call collision e g an incoming call when OTAP tries to start a CSD connection TC65_AC75_ JAVA User s Guide_V08 Page 50 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 8 9 OTAP Tracer For easy debugging of the OTAP scenario the OTAP procedure can be traced over the serial interface The trace output shows details of the OTAP procedure and the used parameters To enable the OTAP trace output use the at command at scfg e g AT SCFG Trace Syslog OTAP 1 The serial interface on which you
100. o World Sample Please press lt Next gt button E New Project Steps IMP NG Sample Project 1 Choose Project Project Name IEEE 2 IMP NG Sample Project Project Location C Documents and Settings Administrator 2 Project Folder C Documents and Settings Administrator HelloSample Finish Cancel Help Figure 35 NetBeans IDE 5 0 confirmation of sample project Hello World Sample Please press lt Finish gt button to end selection of the sample project TC65_AC75_JAVA User s Guide_V08 Page 67 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 11 3 1 4 Compile and run Ensure that the proper emulator will be used and compile the project as normal Any output will be shown in the output window in the IDE together with some debugging information of the IDE The html help files of the SMTK can be accessed directly by pressing Alt F1 11 3 1 5 Starting debugging session without download of Java files It is possible to start a debugging session without download of the Java files jad and jar again The emulator has to be started with an additional parameter noload and downloading of the Java files is suppressed If you like to suppress downloading of jar and jad file please use the project context menu Properties select category Running and type in noload as extra parameter for the emulator as shown in the following figure z HelloSample Project C
101. omer ks gt DelRootCert bin TC65_AC75_JAVA User s Guide _V08 Page 94 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released Command switch on Java Security Mode java jar jseccmd jar cmd TrustedModeOn imei 012345678901234 alias keyname storepass keystorepassword keypass keypassword keystore customer ks gt TrustedModeOn bin Command switch off Java Security Mode java jar jseccmd jar cmd TrustedModeOff imei 012345678901234 alias keyname storepass keystorepassword keypass keypassword keystore customer ks gt TrustedModeOff bin Command switch on Untrusted Domain it is possible only inside of the Java Security Mode java jar jseccmd jar cmd UntrustedDomainon imei 012345678901234 alias keyname storepass keystorepassword keypass keypassword keystore customer ks gt UntrustedDomainOn bin Command switch off Untrusted Domain java jar jseccmd jar cmd UntrustedDomainoff imei 012345678901234 alias keyname storepass keystorepassword keypass keypassword keystore customer ks gt UntrustedDomainoOff bin Command switch on Certificate Verification for HTTPS Connections java jar jseccmd jar cmd HttpsVerifyOn imei 012345678901234 alias keyname storepass keystorepassword keypass keypassword keystore customer ks gt HttpsVerifyOn bin Command switch off Certificate Verification for HTTPS Connections java jar jseccmd jar cmd HttpsVerifyOff imei 012345678901234 alias keyname
102. on gt example helloworld Helloworld java HelloWorld Figure 40 Eclipse Example The html help files of the SMTK can be accessed directly by pressing Shift F2 while the cursor points to a Java expression in a Java source file TC65_AC75_JAVA User s Guide_V08 Page 71 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 11 3 2 6 Compile and debug To build the jar and jad files you have rebuild the project with the create package function Open the context menu of the project and go to J2VE gt Create Package eet 26 Default constructor a ww Gaza 8 e New gt pr J Go Into lic HelloWorldt JZ System out println Co Open in New Window E de Open Type Hierarchy F4 tt i 15 Copy Ctrl C i he This is the main appl 5 Paste Ctrl V text output and close 3 Delete Delete 7 Source Alt Shift 5 Mblic void startApp tl Refactor Ak Shift T gt peee E System out printlni n y Import notifyDestroyed e Export o amp Refresh F5 paa Called when the appli ae Close Project gab R lic void pauseadpp i Debug gt System out println pa Team gt Compare With gt i Restore From Local History a Geos Mareen J2ME d Create Package Create Obfuscated Package Properties Alt Enter ee a Figure 41 Eclipse Create package Export Antenna Build Files Now you are ready to debug your projec
103. on Using Control Panel gt Add or Remove Programs for SMTK installation and selecting Modify or Repair Please keep in mind that windows system requires the same location of the installation CD if you like to use Modify or Repair for SMTK installation The installer is searching for msi file and an installer message box will pop up telling the user to locate the installation CD in the corresponding drive and path If the installation CD is not located on the displayed drive and path please insert the CD or copy the CD contents into the required location drive and path Note for installing the SMTK environment on Windows 2000 systems Please delete all modems with device name Standard 19200 bps Modem before installing the SMTK environment on a Windows 2000 system because this modem device is used during automatic modem installation and on device debugging TC65_AC75_ JAVA User s Guide_V08 Page 18 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 3 4 3 Installing NetBeans IDE 5 0 1 NetBeans IDE 5 0 is provided on the SMTK installation disk in the subdirectory NETBEANS_5_0 To begin installation start first netbeans 5_0 windows exe and follow the NetBeans IDE 5 0 setup procedure instructions 2 Please install next the Mobility package of Sun NetBeans IDE 5 0 The Mobility package is required before integration of SMTK Note The integration of the SMTK into
104. on rates for LLC layer Java application transfer data i I BPS LOSY Figure 17 Scenario for testing data rates on ASC1 with GPRS data upload TC65_AC75_JAVA User s Guide _V08 Page 37 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 5 11 3 3 2 Download The data rate for downloading data over GPRS depends on the number of assigned timeslots and the coding schemes given by the net Since ME supports GPRS class 12 the number of assigned timeslots can be up to 4 For the measurements the Java application receives data from the server over GPRS and sends them over RS232 to an external device got TC65 Java application transfer data LOSY Figure 18 Scenario for testing data rates on ASC1 with GPRS data download The tables below show the download data rates that can be achieved if hardware flow control is enabled on the CommConnection interface and the port speed is set to 230400 Table 3 Download data rate with different number of timeslots CS2 Download data rate with x timeslots Coding scheme 2 kbit s theor from theor from theor from theor from Value theor Value theor Value theor Value theor Value Value Value Value net transmission rates for LLC layer Table 4 Download data rate with
105. onfiguration DefaultConfiguration v Manage Configurations Category General fy Platform fi Abilities Emulator Command Line Options noload 2 Application Descriptor e g xverbose gt attributes miblets Push Registry Specify the Security Domain E API Permissions j Build Execute through OTA Over The Air Provisioning Regular Execution Sources Filtering 6B Compiling S Libraries amp Resources obfuscating Creating JAR E Signing GR Generating Javadoc gt Running Deploying OK Cancel Help Figure 36 NetBeans IDE 5 0 add emulator option noload e g project HelloSample Please keep in mind that you have to remove this emulator option before starting debugging session with download of Java files The Java files are not updated in the Flash Files System of the module while option noload is set Remark This feature is not working in current NetBeans IDE 5 0 version included on the SMTK CD TC65_AC75_JAVA User s Guide_V08 Page 68 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 11 3 2 Eclipse 3 0 and Eclipse 3 1 We recommend that Eclipse 3 0 1 or higher is to be used 11 3 2 1 Eclipse 3 0 Please use the customized Eclipse ME Plugin version that is distributed with the SMTK CD under the directory EclipseMEplugin WM only for Eclipse 3 0 1 and 3 0 2 and install Eclipse ME as described in chapter 3 3 Howeve
106. oni at smong These AT commands have to be used without parameters e g for at moni the periods must be implemented in Java TC65_AC75_ JAVA User s Guide_V08 Page 31 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 5 8 4 Configuration of Serial Interface While a Java application is running on the module only the AT Command API is able to handle AT commands All AT commands referring to a serial interface are ignored This includes the commands e AT IPR sets a fixed local bit rate e AT Q1 AT Q2 and AT Q3 sets type of flow control If Java is running the firmware will ignore any settings from these commands Responses to the read write or test commands will be invalid or deliver ERROR Note When a Java application is running all settings of the serial interface are done with the class CommConnection This is fully independent of any AT commands relating to a serial interface 5 8 5 Java Commands There is a small set of special Java AT commands e atsjra start a Java application e atsjnet configuration of Java networking connections e atsjotap start and configuration of over the air provisioning e atsjsec security configuration Refer to the AT command Set 8 5 9 System Out Any output printed to the System out stream by a Java application can be redirected to one of the serial interfaces a file a NULL device i e the output will be discarded or a UDP socket for using the de
107. param unit IMEI param unit signature Switch on off Security Mode total len 0x0005 0x0003 param unit switch param unit IMEI param unit signature Switch on off Untrusted Domain total len 0x0006 0x0003 param unit switch param unit IMEI param unit signature TC65_AC75_JAVA User s Guide_V08 Page 9 1 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 12 4 2 Build Java Security Command cmd param num parameter unit enerate HASH HASH SHA1 GF 8 m private key Se ahs scot with private key NI p Customer Environment signature buia total command cmdlen cmd param num parameter unit ici i signature unit Figure 59 Build Java Security Command TC65_AC75_ JAVA User s Guide _V08 Page 92 of 105 2006 06 12 JAVA User s Guide SIEMENS Confidential Released 12 4 3 Send Java Security Command to the Module Use a terminal program enter at sjsec wait for the answer CONNECT JSEC READY SEND COMMAND Now you can send the binary data of the command for example from a file with the binary data of the command The module s answer depends on the result of the operation The read command at sjsec can be used to request the current Java security status Re
108. pe IMP NG MIDlet and press lt Next gt button for working with this skeleton New File Steps Choose File Type 1 Choose File Type Project Test Eons E Categories File Types IMP NG B B mP Java Classes xm Ant Build Scripts Other Description Create a basic executable class for IMP NG wireless devices Figure 33 NetBeans IDE 5 0 Selecting an IMP NG MIDlet template e g project Test TC65_AC75_JAVA User s Guide_V08 Page 66 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 11 3 1 3 Examples There are three IMP NG MIDlet sample projects HelloSample NetDemo and RS232Sample included Each sample project can be selected directly in NetBeans IDE 5 0 You can open the sample project e g HelloSample using the NetBeans IDE 5 0 menu File gt New Project A New Project wizard will be opened Please select Category Samples gt Mobile gt IMP NG and select e g Hello World Example New Project Steps Choose Project 1 Choose Project Categories Projects Et te i Mobile Hello World Example NetBeans Plug in Modules Network Example a amp Samples R5232 Example O General O web NetBeans Plug in Modules Mobile IMP NG MIDP 1 0 Samples MIDP2 0Samples lt E Description Sample Hello World Project Figure 34 NetBeans IDE 5 0 selecting sample project Hell
109. ployed directory default setting of Eclipse Download Jad and Jar file into the Flash File System of the module and start the Java application a Manual download and start of Java application Copy Jad and Jar files manually using MES e g MES Windows Explorer into the module Start the Java application by using at command at sjra a Project01 jar e g using ASC1 The Java System out is printed via ASC1 default setting and is displayed on terminal programs e g Print this line b Automatic download and start of Java application using IDE Open context menu of printme java and select Emulated J2ME Midlet from item Run As The SMTK emulator downloads Jar and Jad file into the Flash File of the module transmission via MES port that was selected during installation and automatically starts the Java application The Java System out is printed via ASC1 default setting and is displayed on terminal programs e g Print this line Further information about importing an existing Java project into Eclipse based on the Hello World example is described in chapter 11 3 2 5 TC65_AC75_ JAVA User s Guide_V08 Page 60 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 11 Debug Environment Please note that this section is not intended as a tutorial in debugging or how to use Netbeans IDE 5 0 Borland JBuilder or Eclipse Documents for these IDEs can b
110. py protection will refuse access to open copy or rename such directories 7 3 2 OTAP e A password should be used to update with OTA SMS Authentication e Parameters should be set to fixed values at sjotap whenever possible so that they cannot be changed over the air e The http server should be secure e g Access control via basic authentication TC65_AC75_ JAVA User s Guide_V08 Page 43 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 8 Over The Air Provisioning OTAP 8 1 Introduction to OTAP OTA Over The Air Provisioning of Java Applications is a common practice in the Java world OTAP describes mechanisms to install update and delete Java applications over the air The ME implements the Over The Air Application Provisioning as specified in the IMP NG standard JSR228 The OTAP mechanism described in this document does not require any physical user interaction with the device it can be fully controlled over the air interface Therefore it is suitable for Java devices that are designed not to require any manual interaction such as vending machines or electricity meters 8 2 OTAP Overview To use OTAP the developer needs apart from the device fitted with the Java enabled module an http server which is accessible over a TCP IP connection either over GPRS or CSD and an SMS sender which can send Class1 PID 7d short messages This is the PID reserved for a module s data download
111. r instead of selecting eclipseme feature_1 2 3 site zip choose EclipseMEpluging_WM plugin zip from SMTK CD after clicking the New Archived Site button 11 3 2 2 Eclipse 3 1 If Eclipse is not installed please follow the steps as described in chapter 3 3 Please use and install EclipseME plugin 1 2 1 or 1 2 3 for Eclipse 3 1 0 3 1 1 or 3 1 2 11 3 2 3 Additional Configuration of integrated emulator The following configuration is displayed after SMTK integration into Eclipse by using the Eclipse menu Window Preferences gt J2ME Platform Components Preferences Workbench Platform Components Ant Build Order Sted Wireless Toolkits Help Siemens IMP NG TC65 R2 Wireless Toolkit Install Update Siemens IMP NG Wireless Toolkit J2ME amp Platform Definitions New Midlet Suite 5 Siemens IMP NG Default Device Platform Over the Air 5 Siemens IMP NG TC65 R2 Module Platform Packaging amp Profiles Platform Components BA IMP NG Siemens IMP NG Default Device Java Ba IMP NG Siemens IMP NG TC65 R2 Module Plug in Development Configurations Run Debug CLDC 1 1 Siemens IMP NG Default Device Team gt CLDC 1 1 Siemens IMP NG TC65 R2 Module Restore Defaults Apply Import Export Cancel Figure 37 Eclipse Display of different integrated emulators To use the debugger it is necessary to increase the debug server delay timeout of Eclipse IDE Please set the timeou
112. r s Guide_V08 Page 34 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 5 11 2 Pin I O The pin I O test was designed to find out how fast a Java MIDlet can process URCs caused by Pin I O and react to these URCs The URCs are generated by feeding an input pin with an external frequency As soon as the Java MIDlet is informed about the URC it tries to regenerate the feeding frequency by toggling another output pin becececeasupeeenss external frequency AIG JL ommandListener ATEvent send URC ATCommand send generated frequency Figure 14 Test case for measuring Java MIDlet performance and handling pin lO The results of this test show that the delay from changing the state on the input pin to a state change on the output pin is at least around 50 ms but that time strongly depends on the amount of garbage to collect and number of threads to be served by the virtual machine Consequently pin I O is not suitable for generating or detecting frequencies 5 11 3 Data Rates on RS 232 API For details about the software platform and interfaces refer to Chapter 4 Software Platform This section summarises limitations and preconditions for performance when using the interface CommConnection from package com siemens mp io refer to 5 The data rate on RS232 depends on the size of the buffer used for reading from and writing to the serial interface It is recommended that me
113. re 57 Insert Customer Root Certificate cicccscicicccaces scene ctexsectactenent sven cele neanecenenescdevenestened 88 Figure 58 Prepare MIDlet for Secured Mode 2 ccs0s csctec cere eee cesses 89 Figure 59 Build Java Security COMMANG eee 92 Tables Table 1 Download data rate with different number of timeslots CS2 0 22 ceeeeeeeteeeeeeees 37 Table 2 Download data rate with different number of timeslots CS4 ee eeeeteeeeeees 37 Table 3 Download data rate with different number of timeslots CS2 ce eeeeeeeetteeeeeeees 38 Table 4 Download data rate with different number of timeslots CS4 oo eeeeeteeeeetees 38 Table 5 A typical sequence of MIDlet execution cee eeccceeccccceeeeeeeeeeeeeeeeeaeeneeeeeeeeeeeaaes 40 Table 6 Parameters and keywords oc lt c0cccccccecccencoteecetegencecneceneeetecenecenetepnesteeeanecteeeveesteereeeed 45 TC65_AC75_ JAVA User s Guide_V08 Page 8 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 1 Preface This document covers the full range of IMP NG Java products from Siemens currently including e TC65 Module e TC65 Terminal e AC75 Module Differences between the products are noted in the particular chapters Throughout the document all supported products are referred to as ME Mobile Equipment For use in file directory or path names the string lt productname gt represents the actual name of a product for example TC65
114. red or the safety timer expired If there is any error during an update operation the old application is kept untouched with one exception If there is not enough space in the file system to keep the old and the new application at the same time the old application is deleted before the download of the new one therefore it is lost when an error occurs If install update was successful autostart is set to the new application 8 6 2 Delete OTAP Java Application Controller Server Parameter SMS TC65 al Parameter SMS with START delete HTTP Post Result SMS password check Parameters collection valle Combination of SMS parameter set and AT parameter set If parameter set complete Close running Java application yno w UMOPaSO D Start delete procedure Delete application dir reboot Figure 21 OTAP Delete Information Flow messages in brackets are optional jnoauly Mees Reboot When an SM with keyword START delete is received and there is a valid parameter set for this operation the module reboots either when the operation completed an error occurred or the safety timer expired If there is any error the application is kept untouched Autostart is not changed TC65_AC75_ JAVA User s Guide_V08 Page 49 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 8 7 Time Out Values and Result Codes Timeouts e Closedown Timeout 10 seconds e Safety Timeout
115. rsion TC65_AC75_ JAVA User s Guide_V08 Page 14 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 3 3 Setup Java Development Environment with Eclipse IDE Quick Start up Please complete the following steps to set up your Eclipse Java development environment Step 1 Step 2 Step 3 Install JDK 1 4 2_09 gt JDK 1 4 j2sdk 1_4 2 09 windows i586 p exe Install Eclipse 3 1 2 gt Unzip from CD Eclipse eclipse SDK 3 1 2 win32 zip to C Program Files Eclipse Installation Eclipse ME plugin 1 2 3 Start Eclipse IDE Select the default workspace suggested by Eclipse Start ME plugin installer using Eclipse menu Help gt Software Updates gt Find and Install Install Update Feature Updates Choose the way you want to search for features to install Search for updates of the currently installed features elect thisepttor i you want to Searckfar updates of the Features you already have installed ing or new update sites Some sites may already be Install Update sites to visit Select update sites to visit while looking For new features Sites to include in search O Seciipse org update site Import sites Export sites IV Ignore Features not applicable to this environment Figure 3 Installation of Eclipse ME Plugin 1 2 3 Dialog box Updates sites to visit TC65_AC75_JAVA User s Guide_V08 Page 15 of 105 2006 06 12 JAVA User s Guide SIEM ENS
116. s First it limits access to the serial interface RS 232 API and the GPIO pins Second power saving efficiency is directly influenced by the way a Java application is programmed Java hardware access limitations e In NON CYCLIC SLEEP mode cfun 0 the serial interface cannot be accessed Toggling RTS does end NON CYCLIC SLEEP mode In CYCLIC SLEEP mode CFUN 7 or 9 the serial interface can be used with hardware flow control CTS RTS e In all SLEEP modes the GPIO polling frequency is reduced so that only signal changes which are less than 0 2Hz can be detected properly Furthermore the signal must be constant for at least 2 7s to detect any changes For further details see at scpol in 3 or refer to 4 Java power saving efficiency e As long as any Java thread is active power consumption cannot be reduced regardless whether any SLEEP mode has been activated or not A Java application designed to be power efficient should not have any unnecessarily active threads e g no busy loops Threads waiting in a blocking method e g read do not hinder power saving e When using networking functionality close all connectors and hang up the bearer manually using ath when CSD is used or at cgatt 0 in case of GPRS every time you intend to reduce power consumption Disable the network idle timeout 0 When going to low power mode there always might be a transition time of around 10s till low power consumption state is reached
117. s nactetinschotentore see a n tea oece estate a a a N O ede 22 424 ASC Irnan ee a ho ers ieee eit Ot ree ee 22 4 2 5 Digital Audio Interface DAI ccceeecieeeeteeeeeeeeeeeeeeeeeeetneeeeeeeeeeeeees 22 BiG J E SP exert Acosta E A A E erate maoee ts oma teaeu meacas ats 22 AQT INMINNCH ACES innia eea Setdeteus do E rE e EErEE Ten 23 4 2 1 1 IP Networking r ii ee os ie ar led Cente aided be ite ca dit ees 23 4 2 7 2 M dia rneer detains ta subsoataacuae Sudabsontadetanntacecaeadatacaue tates 23 4 2 7 3 Other Interacess 5 A A eer anie er riete aertara sareari darani Seethi r ae dekanas eaten 23 4 3 Data Flow of a Java Application Running on the Module cccceeseeeeees 24 4 4 Handling Interfaces and Data Service Resources ccceeeeeeeeeeettteeeeeeeeeeeees 25 4 4 1 Module States csi cies cued aE e RES E tesertendss EE EEE 25 4 4 1 1 State 1 Default No Java RUNNING eeeeeeeeeeeeeeeeeeeeeetnteeeeeeees 26 4 4 1 2 State 2 No Java Running General Purpose I O and 2C SPI 26 4 4 1 3 State 4 Default Java Application Active ccccceeeeeeeeteeeeeees 26 4 4 1 4 State 5 Java Application Active General Purpose I O and I2C SPI 26 4 4 2 Module State Transitions sssssssssssssssssssssessssssssssssssesssseeseeeeees 27 TC65_AC75_JAVA User s Guide_V08 Page 3 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 5 MaintenanGe E E A EA
118. s not necessary for using the Siemens SMTK 3 Open the Control Panel a Open System b Click on Advanced c Click on the Environment Variables button d Choose path from the list of system variables e Append the path for the bin directory of the newly installed SDK to the list of directories for the path variable 3 4 2 Installing the SMTK Environment Before you start the installation please make sure all applications especially the IDEs are closed 1 Insert CD start setup exe When the dialog box appears simply press the Next button to continue the procedure 2 You will be asked to read the license agreement If you accept the agreement press Yes to continue with the installation 3 A file including special information about the installation and use of the SMTK is shown Press Next to continue 4 You will be asked to enter the path name where Eclipse 3 0 1 3 0 2 3 1 0 3 1 1 or 3 1 2 is installed Please type in the folder where Eclipse with the ME plugin is installed and press Next If you have not installed Eclipse or do not want to integrate the SMTK into Eclipse please press Next without typing in a selected folder 5 The installation software checks for the Java SDK If there is no SDK on the system the installation procedure now offers to install the provided JDK If this step is refused the setup process will not continue because a properly installed JDK is mandatory for using t
119. second The scope of this measurement is only the statement execution time not the execution delay Java command on AT interface gt Java instruction execution gt reaction on GPIO Send URC start performance test ATCommandListener ATEvent Reference loop for frequency A Generated frequency A ATCommand send reference sequence Change output Measurement loop for frequency B measurement sequence q ATCommand send Figure 13 Test case for measuring Java command execution throughput The following Java instruction was used for calculation of the typical jPS value 2 x number of calculation statements 1 frequencyB 1 frequencyA Measurement and calculation were done using e duration of each loop 600 s e number of calculation statements 50 result CONSTANT_VALUE variable_value Instructions executed twice per pin cycle frequencyA as measured with a universal counter frequencyB as measured with a universal counter The reference loop has the same structure as the measurement loop except that the measurement sequence is moved State jPS Value mean ME in IDLE mode Not connected 49000 CSD connection 46000 Since only a small amount of Java code is executed in this test it is easily optimized by the CLDC s HI just in time compiler More complex applications might not reach that execution speed TC65_AC75_ JAVA Use
120. st know which resources data services and hardware access are available e There are three AT parsers available e There is hardware access over e two serial interfaces ASC1 and ASCO both fully accessible e general purpose I O To configure the hardware access please refer to the AT Command Set 3 and the Hardware Interface Description 4 e 2C SPI e All restrictions of combinations are described in section 4 4 1 e A Java application has e three instances of the AT command class one with CSD and two without each of which would in turn be attached to one of the three AT parsers e two instances of access to a serial interface ASCO and ASC1 through the CommConnection API e System out over any serial interface or into the file system 4 4 1 Module States The module can exist in the following six states in relation to a Java application the serial interfaces GPIO and I2C SPI See the AT Command Set 3 for information about any AT commands referenced A state transition diagram is shown in Figure 12 This section shows how Java applications must share AT parsers GPIO pins and I2C SPI resources DAC ADC and DAI are not discussed here Default configuration of module Default configuration when Java application is started configured by AT Command Color legend for the following figures TC65_AC75_ JAVA User s Guide_V08 Page 25 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 4 4 1 1 St
121. t Run gt Debudg An emulator launcher with pre settings is provided for starting the debugging session Please ensure that you have selected the right project and executable midlet TC65_AC75_JAVA User s Guide_V08 Page 72 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released Create manage and run configurations Configurations Name TC65 Rel 2 emulator Java Applet Ju ae iene midlet Emulation Source E common JE JUnit Plug in Test ral Remote Java Application Project Run time Workbench 8 Wireless Toolkit Emulator Helloworld i TC65 emulator TC65 Rel 2 emulator Executable Midlet example helloworld Helloworld Search C Over the Air Apply Revert Debug Close Figure 42 Eclipse Configuration Restriction The integration of the SMTK using the SMTK installer depends selecting the offered default workspace workspace of Eclipse e g Eclipse 3 0 1 and 3 0 2 eclipse workspace or Eclipse 3 1 0 3 1 1 and 3 1 2 Documents and Settings lt user name gt workspace If you like to use the SMTK integration inside other workspaces please integrate SMTK manually in these workspaces using Eclipse menu Window Preferences gt J2ME Platform Components as shown in Figure 37 Eclipse Display of different integrated emulators Please keep in mind that all manually integrated SMTKs have to be removed manually as well in case of removing SMT
122. t under Windows gt Preferences gt J2ME gt Debug Server Delay to 15000 If you develop an extremely large application you may have to increase this timeout TC65_AC75_JAVA User s Guide_V08 Page 69 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released 11 3 2 4 Switching Emulators You can easily switch between different installed emulators by using the preferences of a project and choosing e g Siemens IMP NG TC65 R2 Module see figure below Info J2ME Builders J2ME Java Build Path Java Compiler Build properties Javadoc Location J2ME Platform Definition Java Task Tags Siemens IMP NG TC65 R2 Module Platform m Project References Siemens IMP NG Default Device Platform Siemens IMP NG TC65 R2 Module Platform I Sign project Project Figure 38 Eclipse J2ME platform 11 3 2 5 Import Example You can import an existing Eclipse project using the following steps Open menu File gt Import DExisting Project into Workspace choose the root directory of the Eclipse project e g Hello World example of the SMTK CD see figure below Select Create a new Project from an Eclipse project in the file system This does not copy the project to the workspace Select an import source HF Checkout Projects from CYS 3 Existing Ant Buildfile Existing Project into Workspace Lok External Features E External Plug ins and Fragments File system Team Project Set Zip file
123. tDataInputStream out streaming dataOut write new String n rHello world n r getBytes dataOut write new String n rThis data was sent by a Java MIDlet n r getBytes dataOut write new String Press Q to close the connection n r getBytes and in streaming System out println Waiting for incoming data currently dataIn available bytes in buffer rev 0 TC65_AC75_JAVA User s Guide_V08 Page 98 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released while char rcv q amp amp char rcv Q amp amp rev 1 rev dataIn read if rev gt 0 System out print char rev The example continues after the next block of text In _ Siemens SMTK lt productname gt wtk src example e g TC65 Release 2 Siemens SMTK TC65_R2 wtk src example a complete data connection example DataConnectionDemo java can be found These streams behave slightly differently than regular data streams The streams are not closed by using the close method A stream remains open until the release method is called A module can be switched from the data mode to the AT command mode by calling the breakConnection method continue example if rev 1 Now break the data connection System out printin n n rBreaking connection try strRcev ATCmd breakConnection catch Exception e System out prin
124. ta tet alee kona cach 10 Figure 2 Installation of Eclipse ME Plugin 1 2 3 Dialog box Feature Updates 15 Figure 3 Installation of Eclipse ME Plugin 1 2 3 Dialog box Updates sites to visit 15 Figure 4 Installation of Eclipse ME Plugin 1 2 3 dialog box Search Results ee 16 Figure 5 Installation of Eclipse ME Plugin 1 2 3 dialog box Restart Eclipse 16 Figure 6 Interface Configuration cccccccceeeeeeeesencceeeeeeeeeeeeecaaeeeaaeeeeeeeeeeeenesaaaaeeeeeeeeeeenee 23 Figure 7 Figure 8 Data flow of a Java application running on the MOdUIE eeeeeeeeeeeeeeeeeeeeees 24 Mod le State T eene o a e E can sivescgraveactaisivescsti caved reins 26 Figure 3 Module State 2 seers ran ee ee ee ee ee ore 26 Figure 10 Module State 4 c2 t2 cc scces ice cian ats caed hive atacand ed ee a ted ive a teat ie dee 26 Figure 11 Module State i c2s cie2s ee ideeae sl Shwe sc deals Cen ae aay Rates cfeea aaa Gove attan sect eee 26 Figure 12 Module State Transition Diagram ccceeeeeeeeeeeeeeeeeceeeeeeeeeeeeeeeenteeeeeeeeeeeeees 27 Figure 13 Test case for measuring Java command execution throughput eee 34 Figure 14 Test case for measuring Java MIDlet performance and handling pin lO 35 Figure 15 Scenario for testing data rates on ASC1 oo ee eerie teeter renee 36 Figure 16 Scenario for testing data rates on ASC1 with a voice call in parallel
125. te a New J2ME Midlet TC65_AC75_JAVA User s Guide_V08 Page 58 of 105 2006 06 12 JAVA User s Guide Confidential Released Step 2 SIEMENS Modify Java source file printme java template Java printme java Eclipse SDK BA File Edit Source Refactor Navigate Search Project Run Window Help M HS O Q 8H CO V7 4B 8 F oee S ava E Package Explorer 52 Hierarchy O BE Outline 3 ial Step 3 TC65_AC75_JAVA User s Guide_V08 AS public printme BRON E Projecto super a src src TODO Auto generated constructor stub import declarations 3 printme java 3 printme J2ME library Siemens IMP NG TC65 R2 printme a classes zip C Program Files Siem protected void startApp throws MIDletStateChangeException a startApp verified a eee ETETETEC Meisels a pauseApp Ey classes d System out printin Print this line a destroyApp boolean amp lbs destroyApp true Projecto jad i protected void pauseApp TODO Auto generated method stub gt protected void destroyapp boolean arg0 throws MIDletStatec j qrooeyenesated method stub notifyDestroyed EL Problems 3 Javadoc Declaration x 70 O errors 0 warnings 0 infos Description Resource _ 1n Folder Location lt gt Writable Smart Insert 15 9 Figure 28 Create new Eclipse project Edit some Java commands This application prints the given line
126. the correct jar and jad files were loaded into the correct location Analyze errors If the above test failed looking at your device s behavior and your http servers access log can give you a hint as to what went wrong e If the device did not terminate the running Java application and did not reboot not even after the safety timeout either your SM was not understood probably in the wrong format or it did not properly authenticate probably used the wrong password or your parameter set is incomplete for the requested operation e If the device terminated the running Java application but did not access your http server and rebooted after the safety timeout there were most likely some problems when opening the network connection Check your network parameters e If the device downloaded the jad and possibly even the jar file but then rebooted without saving them in the file system most likely one of the errors outlined in chapter 8 5 occurred These are also the only errors which will return a response They are posted to the http server if the jad file contains the required URL Start update of remote devices If you were able to successfully update your local device which is hopefully a mirror of all your remote devices you can start the update of all other devices TC65_AC75_ JAVA User s Guide_V08 Page 52 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 9 Compile and Run a Program without a Java IDE This
127. the module delivers its response to the AT command the callback method ATResponse is called If the response is CONNECT we will see the printed message from ATResponse in MyListener A running AT command sent with the non blocking send function can be cancelled with ATCommand cancelCommand Any possible responses to the cancellation are sent to the waiting callback instance Note Using the send methods with incorrect AT command syntax in the strings will cause errors TC65_AC75_JAVA User s Guide_V08 Page 100 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 13 1 3 ATCommandListener Interface The ATCommandListener interface implements callback functions for e URCs e Changes of the serial interface signals RING DCD and DSR e Opening and closing of data connections The user must create an implementation class for ATCommandListener to receive AT events The ATEvent method of this class must contain the processing code for the different AT Events URCs The RINGChanged DCDChanged DSRChanged and CONNChanged methods should contain the processing code for possible state changes This code shall leave the listener context as soon as possible i e running a new thread While the callback method does not return it cannot be called again if changes occur lt br gt The CONNChanged method indicates the start and the end of data connections During a data connection it is possible to transfer data wit
128. the target directory in the Module gt Module Disk A 7 1 2 Command Line Based A suite of command line tools is available for accessing the module s Flash file system They are installed in the Windows System directory so that the tools are available from any directory The module s file system is accessed with mod The tools included in this suite are MESdel MEScopy MESxcopy MESdir MESmkdir MESrmdir MESport MESclose and MESformat Entering one of these commands without arguments will describe the command s usage The tools mimic the standard directory and file commands A path inside the module s file system is identified by using mod followed by the module disk which is always A e g MESdir mod a lists the contents of the module s root directory TC65_AC75_ JAVA User s Guide_V08 Page 42 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 7 2 Over the Air Provisioning See Chapter 8 for OTA provisioning 7 3 Security Issues The developer should be aware of the following security issues Security aspects in general are discussed in chapter 12 7 3 1 Module Exchange Suite The serial interface should be mechanically protected The copy protection rules for Java applications prevent opening reading copying moving or renaming of JAR files It is not recommended that the name of a Java application for example lt name gt jar be used for a directory since the co
129. thod read byte b be used for reading from the serial interface The recommended buffer size is 2kbyte To achieve error free data transmission the flow control on CommConnection must be switched on lt autorts gt and lt autocts gt the same for the connected device Different use cases are listed to give an idea of the attainable data rates All applications for measurement use only one thread and no additional activities other than those described were carried out in parallel TC65_AC75_ JAVA User s Guide_V08 Page 35 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 5 11 3 1 Plain Serial Interface Scenario A device is connected to ASCO refer to 4 2 4 The Java application must handle data input and output streams A simple Java application with only one thread which loops incoming data directly to output reaches data rates up to 180kbit s Test conditions hardware flow control enabled lt autorts gt and lt autocts gt 8N1 and baud rate on ASCO set to 230kbaud gt theoretical maximum 184kbit s net data rate TC65 Java application looping data LOSY Figure 15 Scenario for testing data rates on ASC1 5 11 3 2 Voice Call in Parallel Same scenario as in section 5 11 3 1 but with a voice call added The application reflects incoming data directly to output and additionally handles an incoming voice
130. tln e System out println received strRcv else Received EOF somebody else broke the connection System out printin n n rSomebody else switched to command mode System out printin Hanging up strRcev ATCmd send ATH r System out println received strRcv catch IOException e System out println e else System out println No data connection established An IOException is thrown if any function of the I O streams are called when the module is in AT command mode except for read functions The read function case is explained in more detail in chapter 13 1 3 The ATCommand class does not report the result codes returned after data connection release Data Connections are not only used for data transfer over the air but also to access external hardware Here is a list of at commands which open a data connection e atd for data calls e atsspi for access to I2C SPI e atsis commands for Internet services For data connection signaling see also chapter 13 1 3 TC65_AC75_JAVA User s Guide_V08 Page 99 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 13 1 1 4 Synchronization For performance reasons no synchronization is done in the ATCommand class If an instance of this class has to be accessed from different threads ensure that the send functions the release function the cancelCommand function and the breakConnection fun
131. tting this password gives an extra level of security Note If a password set by AT command all SMs must include this password Table 6 Parameters and keywords Parameters Max Length AT Keyword SM Install update delete JAD File URL 100 JADURL mandatory unused Application Directory 50 APPDIR mandatory mandatory HTTP User 32 HTTPUSER optional unused HTTP Password 32 HTTPPWD optional unused Bearer BEARER mandatory optional P APN or Number 65 APNORNUM mandatory for CSD optional P Net User 32 NETUSER optional optional P Net Password 32 NETPWD optional optional P DNS DNS optional optional P Notify URL 100 NOTIFYURL optional optional P SM Password 32 PWD optional optional TC65_AC75_JAVA User s Guide _V08 Page 45 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released The length of the string parameters in the AT command is limited see Table 6 the length in the SM is only limited by the maximum SM length The minimum set of required parameters depends on the intended operation see Table 6 optional P indicates that this parameter is only necessary when a POST result is desired 8 4 Short Message Format An OTAP control SM must use a Submit PDU with Class1 PID 7d and 8 bit encoding As a fallback for unusual network infrastructures the SM can also be of ClassO and or PID 00 The content of the SM consists of a set of keywords and parameter values all encoded in ASCII format These parameters can be distribute
132. ugin 1 2 3 The following description assumes that Eclipse 3 1 2 is installed from SMTK CD as described in chapter 3 3 10 1 1 Setup a New Project Step 1 Create new Java Project Select Eclipse menu File gt New gt Other Select J2ME Midlet Suite Select a wizard Create a J2ME MIDP Midlet Suite Wizards G Class Interface g Java Project B Java Project From Existing Ant Buildfile G Plug in Project E Product Configuration CVS J2ME ME Midle ig J2ME Midlet Suite ava amp Plug in Development Simple Figure 22 Create new Eclipse project Create a J2ME MIDP Midlet Suite Type in the used name e g Project01 and path for the new project New J2ME Project New J2ME Project Create New J2ME Project Project naffe Project01 Project conter IV Use default a Figure 23 Create new Eclipse project New J2ME Project TC65_AC75_JAVA User s Guide_V08 Page 56 of 105 2006 06 12 JAVA User s Guide SIEM ENS Confidential Released Select e g TC65 Release 2 emulator New J2ME Project Midlet Suite Properties Choose the initial properties for the Midlet Suite sitable Platform Definitions C Siemens IMP NG TC65 R2 Module Platform an Descriptor ProjectOt jad Figure 24 Create new Eclipse project Midlet Suite Properties Anew Java Project has been created Fle Edt Source Refactor Navigate Semci Protect fun Window Hep 0 Q
133. ule Exchange Suite MES The Module Exchange Suite MES is installed during the SMTK installation If you would like to install the Module Exchange Suite separately repair or remove it please use the Module Exchange Suite MES setup exe which is located on the SMTK installation disk in the subdirectory MES TC65_AC75_ JAVA User s Guide_V08 Page 19 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released 3 5 SMTK Uninstall The SMTK install package comes with an uninstall facility The entire SMTK or parts of the package can be removed To start the uninstall facility open the Control Panel select Add Remove Programs select the desired SMTK e g TC65 Software Development Kit and follow the instructions The standard modem and Dial Up Network connection DUN are uninstalled automatically if no SMTK IMP NG product is installed in parallel The user will be asked for uninstall of standard modem and Dial Up Network DUN in the case that another SMTK IMP NG product is installed The Module Exchange Suite MES is not uninstalled automatically with the SMTK If you would like to uninstall the Module Exchange Suite MES as well please run the MES uninstall facility To run the uninstall program open the Control Panel select Add Remove Programs select Siemens Module Exchange Suite MES and follow the instructions Please keep in mind that standard modem Dial Up Network connection and Module Exchange Suite MES
134. via ASC1 default setting Please keep in mind to add notifyDestroyed in destroyApp method Please refer to chapter 6 MIDlets for more details about Midlet life cycles Configure Jad file Double click on Project01 jad to open the editor and add deployed path in Midlet Jar URL edit line Java Application Descriptor Editor Eclipse SOK b Cdk irage Seyh Project Gun Winco Helo 3 i O Q 8H CG 8V7 Ge E Packege Cxplorer ET gt Mewerchry 2D pertres pore grioto Edhar 0 3 Required Properties ra es PropectOt sc Required miet ate properties Marit be specified on thes page 2 ponte joes B 12E ibrary Sirens IHP NG TOOS RZ g cresp C Program FiesiSiri Mt Jar URL i vertit me gt dres Midi Marre Projecti Midst Suke MNidiet Vendor Mida Suke vendor Nidi Version 1 00 Mercedition Configs abore Connmeched Untied Orke Configuration 1 1 Meroedtion Profile Ieformabon Mockie Profile 3 Requred Madets Optional OTA User Defined E Protieres Mado Oedaration Figure 29 Create new Eclipse project Edit deployed path to Jar file Page 59 of 105 2006 06 12 JAVA User s Guide SI EM ENS Confidential Released Step 4 Step 5 Create Jad and Jar file Select Project01 Open context menu of Project01 and select Create Package from item J2ME Jad and Jar file are be created under the de
135. you want to allow to be changed over the air by SMS and which you do not This is mainly a question of security and what can fit into a short message Then set the unchangeable parameters with the AT command at sjotap Prepare the http server The server must be accessible from your device over TCP IP That means there is a route from your device over the air interface to the http server and back When in doubt write a small Java application using the httpConnection Interface to test it Prepare the JAR and JAD files which are to be loaded over the air Make sure that these files conform to the requirements listed in chapter 8 5 and that they represent a valid application which can be started by at sjra Put the files JAR and JAD on the http Server The files can either be publicly available or protected through basic authentication When in doubt try to download the files from the server by using a common web browser on a PC which can reach your http server over TCP IP Prepare the SM sender The sender must be able to send SMs which conform to chapter 8 4 to your device When in doubt try to send normal SMs to your device which can than be read out from the AT command interface Test with a local device Send a suitable short message to your device which completes the necessary parameter sets and starts the operation The operation is finished when the device reboots You can now check the content of the file system and if

Download Pdf Manuals

image

Related Search

Related Contents

BEDIENUNGSANLEITUNG MODE D´EMPLOI USER MANUAL  Your Loyola Health Care Plan for Students  livro grace.pmd - Rede Comum de Conhecimento  DS7 Soft Starters  Osram Eco Pro Classic P  Detector multigaz pentru patru gaze  luglio PIANOCOORDINAMENTOSICUREZZA - Bandi on-line  C329-SPI User Manual  Targus THZ33803EU  取扱説明書 - デロンギ・ジャパン  

Copyright © All rights reserved.
Failed to retrieve file