Download Print this page

Advertisement

s
TC65 JAVA User's Guide
Siemens Cellular Engine
Version:
05
DocID:
TC65 JAVA User's Guide_V05

Advertisement

   Also See for Siemens Java TC65

   Related Manuals for Siemens Java TC65

   Summary of Contents for Siemens Java TC65

  • Page 1

    TC65 JAVA User's Guide Siemens Cellular Engine Version: DocID: TC65 JAVA User's Guide_V05...

  • Page 2

    GSM products, which also apply to cellular 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...

  • Page 3: Table Of Contents

    Components...12 3.2.1.1 Module Exchange Suite ...12 3.2.1.2 WTK ...12 3.2.1.3 SDK and Java Studio ...12 Siemens Mobility Toolkit Installation...13 3.3.1 Installing the Standard Development Toolkit ...13 3.3.2 Installing the SMTK Environment...13 3.3.3 Installing Sun Java Studio Mobility 6 ...14 3.3.4 Installing Eclipse 3.0 ...14...

  • Page 4

    TC65 JAVA User's Guide Strictly confidential / Released Maintenance ...24 IP Service ...24 Power Saving...25 Charging ...25 Airplane Mode...26 Alarm ...26 Shutdown...26 5.6.1 Automatic Shutdown ...26 5.6.2 Manual Shutdown ...27 5.6.3 Restart after Switch Off...27 Special AT Command Set for Java Applications ...27 5.7.1 Switching from Data Mode to Command Mode ...27 5.7.2...

  • Page 5

    TC65 JAVA User's Guide Strictly confidential / Released Short Message Format ...41 Java File Format ...42 Procedures ...43 8.6.1 Install/Update ...43 8.6.2 Delete...44 Time Out Values and Result Codes ...45 Tips and Tricks for OTAP ...45 OTAP Tracer...46 8.10 Security...46 8.11 How To ...47 Compile and Run a Program without a Java IDE ...48 Build Results...48...

  • Page 6

    TC65 JAVA User's Guide Strictly confidential / Released 11.4 Structure and Description of the Java Security Commands ...76 11.4.1 Structure of the Java Security Commands ...77 11.4.2 Build Java Security Command...78 11.4.3 Send Java Security Command to the Module...79 11.5 Create a Java Security Environment Step by Step...80 11.5.1 Create Key store ...80 11.5.2...

  • Page 7

    Figure 24: Sun Java Studio Mobility 6 - Selecting a template ... 57 Figure 25: JBuilderX – JDK settings... 58 Figure 26: JBuilderX – Siemens Library... 58 Figure 27: JBuilderX – Sample Projects... 59 Figure 28: JBuilderX – Starting the debugging session ... 60 Figure 29: JBuilder2005 –...

  • Page 8: Preamble

    TC65 JAVA User's Guide Strictly confidential / Released Preamble This document is also valid for the TC65 Terminal with the main exception that the terminal does not feature the USB, ASC1, DAC and DAI interface. For other exceptions and differences please see [3] and [4]. TC65 JAVA User's Guide_V05 Page 8 of 90 26.09.2005...

  • Page 9: Overview

    In addition to the Java Docs for the development API (see Chapter 4), the following documents are included with the SMTK: Multiplexer Installation Guide DSB75 Support Box - Evaluation Kit for Siemens Cellular Engines TC65 AT Command Set TC65 Hardware Interface Description Java doc \wtk\doc\html\index.html...

  • Page 10: Terms And Abbreviations

    Over The Air Provisioning of Java Applications Packet Data Protocol Protocol Data Unit Standard Development Kit Short Message Service SMTK Siemens Mobile Toolkit Transfer Control Protocol Unsolicited Result Code Universal Resource Locator Visual Basic Script Wireless Toolkit TC65 JAVA User's Guide_V05 Page 10 of 90 26.09.2005...

  • Page 11: Installation

    TC65 JAVA User's Guide Strictly confidential / Released Installation System Requirements The Siemens Mobility Toolkit (SMTK) TC65 requires that you have: 1. Windows 2000 or Windows XP installed 2. 40Mbytes free disk space for SMTK 3. Administration privileges 4. Java 2 SDK, Standard Edition 1.4. To install the JDK version 1.4.2_07 provided, follow the instructions in Section 3.3.1.

  • Page 12: Components

    TC65 JAVA User's Guide Strictly 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.

  • Page 13: Siemens Mobility Toolkit Installation

    SMTK installation process. 2. Once the toolkit has been installed, the environment variable “path” can be altered to comfortably use the JDK tools. This is not necessary for using the Siemens SMTK. 3. Open the Control Panel. a) Open System.

  • Page 14: Installing Sun Java Studio Mobility 6

    TC65 JAVA User's Guide Strictly confidential / Released 7. If the SDK and one or more Java IDEs are found, you will be asked to choose which IDE you want integrated into the TC65 development environment. Once an IDE has been found and selected, press "Next"...

  • Page 15: Smtk Uninstall

    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. Upgrades The SMTK can be modified, repaired or removed by running the setup program on the Installation CD.

  • Page 16: Software Platform

    TC65 JAVA User's Guide Strictly confidential / Released Software Platform In this chapter, we discuss the software architecture of the SMTK and the interfaces to it. Software Architecture The SMTK enables a customer to develop a Java application on a PC and have it be executable on the TC65 module.

  • Page 17: Interfaces

    TC65 JAVA User's Guide Strictly confidential / Released Interfaces 4.2.1 ASC0 - Serial Device ASC0, 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 ASC0.

  • Page 18: Jvm Interfaces

    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 J2ME and CLDC can be found at http://java.sun.com/j2me/. Documentation for the other APIs is found in …/ Java doc [5].

  • Page 19: Data Flow Of A Java Application Running On The Module

    TC65 JAVA User's Guide Strictly confidential / Released Data Flow of a Java Application Running on the Module AT Parser AT Command GPIO I2C/SPI Figure 3: 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 20.

  • Page 20: Handling Interfaces And Data Service Resources

    TC65 JAVA User's Guide Strictly confidential / Released Handling Interfaces and Data Service Resources To develop Java applications the developer must know which resources, data services and hardware access are available. • There are three AT parsers available • There is hardware access over - two serial interfaces: ASC1 (System.out only) and ASC0 (fully accessible).

  • Page 21: State 1: Default - No Java Running

    TC65 JAVA User's Guide Strictly confidential / Released 4.4.1.1 State 1: Default – No Java Running This is the default state. The Java application is inactive and there is an AT interface with CSD on ASC0 as well as ASC1. All HW interface pins are configured as inputs. AT parser with CSD ASC 0...

  • Page 22: State 5: Java Application Active, General Purpose I/o And I2c

    TC65 JAVA User's Guide Strictly confidential / Released 4.4.1.5 State 5: Java Application Active, General Purpose I/O and I2C The Java application is active, ASC1 is used as System.out and the Java instance of the RS- 232 serial interface is connected to ASC0. The Java application is activated with at^sjra. The I/O pins are configured with command details.

  • Page 23: Module State Transitions

    TC65 JAVA User's Guide Strictly confidential / Released 4.4.2 Module State Transitions no Java autostart State 1: Default, no Java appl. running close I2C open I2C State 2: no Java appl. running, using I2C close SPI open SPI State 3: no Java appl. running, using SPI Figure 10: Module State Transition Diagram Note: No AT parser is available over serial interface ASC0 or ASC1 while a Java application...

  • Page 24: Maintenance

    TC65 JAVA User's Guide Strictly confidential / Released Maintenance The basic maintenance features of the TC65 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]. IP Service Apart from the standard Java IP networking interfaces (UDPDatagramConnection, SocketConnection, ...) the TC65 also supports a set of Internet Services via AT command.

  • Page 25: Power Saving

    TC65 JAVA User's Guide Strictly confidential / Released 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 ways. 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.

  • Page 26: Airplane Mode

    TC65 JAVA User's Guide Strictly confidential / Released 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.

  • Page 27: Manual Shutdown

    TC65 JAVA User's Guide Strictly confidential / Released 5.6.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.

  • Page 28: Configuration Of Serial Interface

    TC65 JAVA User's Guide Strictly confidential / Released 5.7.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. In particular these commands: •...

  • Page 29: Performance

    TC65 JAVA User's Guide Strictly confidential / Released Performance The performance study was focused on comparable performance values under various circumstances. 5.9.1 Java This section gives information about the Java command execution throughput (“jPS”= Java statements per second). The scope of this measurement is only the statement execution time, not the execution delay (Java command on AT interface reaction on GPIO).

  • Page 30: Pin I/o

    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.

  • Page 31: Plain Serial Interface

    TC65 JAVA User's Guide Strictly confidential / Released 5.9.3.1 Plain Serial Interface Scenario: A device is connected to ASC0 (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.

  • Page 32: Scenarios With Gprs Connection

    TC65 JAVA User's Guide Strictly confidential / Released 5.9.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.9.3.3.1 Upload Since the TC65 supports GPRS class 12, up to four timeslots for upload data are available.

  • Page 33: Download

    TC65 JAVA User's Guide Strictly confidential / Released 5.9.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 TC65 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.

  • Page 34: Midlets

    MIDlet Documentation MIDP and MIDlet documentation can be found at the html document directory of the wtk, …\Siemens\SMTK\TC65\wtk\doc\index.html MIDlet Life Cycle The MIDlet life cycle defines the protocol between a MIDlet and its environment through a simple well-defined state machine, a concise definition of the MIDlet’s states and APIs to signal changes between the states.

  • Page 35: Table 5: A Typical Sequence Of Midlet Execution

    TC65 JAVA User's Guide Strictly confidential / Released 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 MIDlet appropriate time for the MIDlet.startApp...

  • Page 36: Hello World Midlet

    TC65 JAVA User's Guide Strictly confidential / Released Hello World MIDlet Here is a sample HelloWorld program. * HelloWorld.java 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.println("HelloWorld: startApp");...

  • Page 37: File Transfer To Module

    TC65 JAVA User's Guide Strictly confidential / Released File Transfer to Module 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 (ASC0, ASC1 or USB) is connected to the COM port that the Module Exchange Suite is configured to.

  • Page 38: Over The Air Provisioning

    TC65 JAVA User's Guide Strictly confidential / Released Over the Air Provisioning See Chapter 8 for OTA provisioning. Security Issues The developer should be aware of the following security issues. Security aspects in general are discussed in chapter 11. 7.3.1 Module Exchange Suite The serial interface should be mechanically protected.

  • Page 39: Over The Air Provisioning (otap)

    TC65 JAVA User's Guide Strictly confidential / Released Over The Air Provisioning (OTAP) 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.

  • Page 40: Otap Parameters

    TC65 JAVA User's Guide Strictly confidential / Released 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.

  • Page 41: Short Message Format

    TC65 JAVA User's Guide Strictly 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”...

  • Page 42: Java File Format

    TC65 JAVA User's Guide Strictly 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.

  • Page 43: Procedures

    TC65 JAVA User's Guide Strictly 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.1 A suitable Manifest file for the JAD file above might look like: Manifest-Version: 1.0 MIDlet-Name: MyTest MIDlet-Version: 1.0.1...

  • Page 44: Delete

    TC65 JAVA User's Guide Strictly confidential / Released 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 occurred or the safety timer expired. If there is any error during an update operation the old application is kept untouched, with one exception.

  • Page 45: Time Out Values And Result Codes

    TC65 JAVA User's Guide Strictly confidential / Released Time Out Values and Result Codes Timeouts: • Closedown Timeout: 10 seconds • Safety Timeout: 10 minutes Result Codes: Supported status codes in body of the http POST request: • 900 Success •...

  • Page 46: Otap Tracer

    TC65 JAVA User's Guide Strictly confidential / Released 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 issue this command is then exclusively used for the OTAP tracer.

  • Page 47: How To

    TC65 JAVA User's Guide Strictly confidential / Released 8.11 How To This chapter is a step-by-step guide for using OTAP. 1. 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.

  • Page 48: Compile And Run A Program Without A Java Ide

    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...

  • Page 49: Compile

    …\Siemens\SMTK\TC65\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-TC65- IMPNG installation. The installation process sets these environment variables. A modification is usually not necessary.

  • Page 50: Switch On Autostart

    TC65 JAVA User's Guide Strictly confidential / Released 9.4.1 Switch on Autostart • There is an AT command, at^scfg, for configuring the autostart functionality. Please refer to the AT Command Set [3]. • Restart the module. 9.4.2 Switch off Autostart There are two methods for switching off the autostart feature: •...

  • Page 51: Debug Environment

    TC65 JAVA User's Guide Strictly confidential / Released Debug Environment Please note that this section is not intended as a tutorial in debugging or how to use Sun Java Studio, Borland JBuilder or Eclipse. Documents for these IDEs can be found on their re- spective homepages.

  • Page 52: Emulator

    TC65 JAVA User's Guide Strictly confidential / Released 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.

  • Page 53: Java Ide

    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/APIs and emulators are available, and AT commands can be sent to the module.

  • Page 54: Sun Java Studio Mobility 6 2004q3

    In the Runtime Explorer, Figure 21, the installed emulators can be seen under the Device Emulator Registry. The Default Emulator is set to the Siemens Emulator. Figure 21: Sun Java Studio Mobility 6 - The installed emulators...

  • Page 55: Switching Emulators

    You can easily switch to the SMTK emulator by using the combo box in the main menu bar and choosing IMP_NG_DefaultDevice, see Figure 22. Any projects built and run when the Siemens emulator is selected will be compiled and run with the Siemens emulator. Directly after executing the IDE integration with the SMTK setup program the IMP_NG_DefaultDevice is activated by default.

  • Page 56: Projects

    The Project Manager is accessed through the Project menu. Directly after executing the IDE integration with the SMTK setup program the “Siemens TC65” project is opened by default. Figure 23: Sun Java Studio Mobility 6 - Project Manager...

  • Page 57: Templates

    Strictly confidential / Released 10.3.1.3 Templates Templates for a Siemens MIDlet can be found in the file explorer and under File->New. The MIDlet template provides the skeleton of a MIDlet application. Figure 24: Sun Java Studio Mobility 6 - Selecting a template 10.3.1.4...

  • Page 58: Borland Jbuilder X

    Tools -> Configure JDKs… (see Figure below) The libraries included with the TC65 SMTK can be examined by opening the menu Tools Configure Libraries… (see Figure below) Figure 26: JBuilderX – Siemens Library TC65 JAVA User's Guide_V05 Figure 25: JBuilderX – JDK settings Page 58 of 90 26.09.2005...

  • Page 59: Examples

    TC65 JAVA User's Guide Strictly confidential / Released 10.3.2.1 Examples There are sample projects provided with the TC65 SMTK. These projects can be found in the JBuilderSamples directory of the TC65 SMTK installation directory. This directory is accessed by opening a project using the menu File Figure 27: JBuilderX –...

  • Page 60: Figure 28: Jbuilderx - Starting The Debugging Session

    TC65 JAVA User's Guide Strictly confidential / Released Open the Project (e.g. “HelloWorld.jpx”), rebuild the sources and start the debugger using the micro edition (context menu “HelloWorld.jad” Figure 28: JBuilderX – Starting the debugging session TC65 JAVA User's Guide_V05 Micro Debug using “HelloWorld”). Page 60 of 90 26.09.2005...

  • Page 61: Borland Jbuilder 2005

    Figure 29: JBuilder2005 – JDK settings The libraries included with the TC65 SMTK can be examined by opening the menu Tools Configure Libraries… (see Figure below) Figure 30: JBuilderX – Siemens Library TC65 JAVA User's Guide_V05 JDKs… (see Figure below) Page 61 of 90...

  • Page 62: Examples

    TC65 JAVA User's Guide Strictly confidential / Released 10.3.3.1 Examples There are sample projects provided with the TC65 SMTK. These projects can be found in the JBuilderSamples directory of the TC65 SMTK installation directory. This directory is accessed by opening a project using the menu File Figure 31: JBuilder2005 –...

  • Page 63: Figure 32: Eclipse - Plug-in Installation

    TC65 JAVA User's Guide Strictly confidential / Released Figure 32: Eclipse – Plug-in installation If the installation of the plugin was successful you need to restart your IDE. (see figure below). Figure 33: Eclipse – Plug-in installation, restart Close the IDE! Now start the TC65 SMTK installation routine to automatically configure Eclipse.

  • Page 64: Switching Emulators

    TC65 JAVA User's Guide Strictly confidential / Released Figure 34: Eclipse – IMP-NG component Set the timeout under Windows develop an extremely large application you may have to increase this timeout. 10.3.4.2 Switching Emulators You can easily switch between installed SMTK by using the preferences of a project and choosing IMP_NG_DefaultDevice, see figure below.

  • Page 65: Example

    TC65 JAVA User's Guide Strictly confidential / Released 10.3.4.3 Example After the integration you can import one example. Open menu: File Import Existing Project into Workspace and choose the root directory of the example. (see figure below) The following figure shows the “Hello World” example in the IDE. TC65 JAVA User's Guide_V05 Figure 36: Eclipse –...

  • Page 66: Figure 37: Eclipse - Example

    TC65 JAVA User's Guide Strictly confidential / Released The html help files of the SMTK can be accessed directly by pressing Alt+F2 while the cursor points to a Java expression in a Java source file. TC65 JAVA User's Guide_V05 Figure 37: Eclipse - Example Page 66 of 90 26.09.2005...

  • Page 67: Compile And Debug

    TC65 JAVA User's Guide Strictly confidential / Released 10.3.4.4 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 J2ME Create Package Now you are ready to debug your project.

  • Page 68: Breakpoints

    TC65 JAVA User's Guide Strictly confidential / Released Restriction: The integration of the SMTK depends selecting the offered default workspace “\workspace” of Eclipse. 10.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.

  • Page 69: Java Security

    TC65 JAVA User's Guide Strictly confidential / Released Java Security The Java Security Model follows the specification of IMP 2.0 but does not integrate the protection domain concept. The protection domain concept is not needed. If the software is enabled, all domains are available. Java Security is divided into two main areas: •...

  • Page 70: Secure Data Transfer

    This feature makes it possible for MIDlets to use safe data links to external communications partners. The specification IMP 2.0 defines two java classes with this characteristic - HTTPSConnection and SecureConnection. The Siemens implementation follows the recommendations in IMP 2.0: HTTPSConnection • HTTP over TLS as documented in specified in 2246.

  • Page 71: Figure 41: Mode 2 - Java Security Activated (server Certificate = Certificate Into Module)

    TC65 JAVA User's Guide Strictly confidential / Released private key from owner of the certificate HTTPS Server Figure 41: Mode 2 - Java Security activated (server certificate = certificate into module) Server Certificate (X.509) signature of the CA private key public key from from owner of owner of the...

  • Page 72: Create A Secure Data Transfer Environment Step By Step

    TC65 JAVA User's Guide Strictly confidential / Released 11.1.1 Create a Secure Data Transfer Environment Step by Step The following steps describe the creation of the configuration: • Java Security Mode is activated (see 11.2.1 Change to Secured Mode) • 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)

  • Page 73: Execution Control

    The device examines each command with the public key of the customer root certificate The secured mode is activated by a special AT-command. Siemens supplies modules with unsecured mode as the default configuration. TC65 JAVA User's Guide_V05 Page 73 of 90...

  • Page 74: Change To Secured Mode Concept

    TC65 JAVA User's Guide Strictly confidential / Released 11.2.1 Change to Secured Mode Concept private key Customer Environment AT^SJSEC cmd len TC65 JAVA User's Guide_V05 generate key pair public key Customer Root Certificate (X.509) public key from issuer of the certificate binary data of certificate cmd id binary data of certificate...

  • Page 75: Concept For The Signing The Java Midlet

    TC65 JAVA User's Guide Strictly confidential / Released 11.2.2 Concept for the Signing the Java MIDlet JAR-File HASH (SHA1) private key Customer Environment encoded JAR-File HASH Figure 44: Prepare MIDlet for Secured Mode TC65 JAVA User's Guide_V05 Java-MIDlet JAR-File add the signature (is base64 encoded) into the JAD file as the value of the MIDlet-Jar-RSA-SHA1 attribute...

  • Page 76: Application And Data Protection

    TC65 JAVA User's Guide Strictly confidential / Released 11.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.

  • Page 77: Structure Of The Java Security Commands

    TC65 JAVA User's Guide Strictly confidential / Released 11.4.1 Structure of the Java Security Commands General structure total len param num UINT16 UINT16 UINT16 param len 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") List of parameters param id...

  • Page 78: Build Java Security Command

    TC65 JAVA User's Guide Strictly confidential / Released 11.4.2 Build Java Security Command param num private key Customer Environment cmd len param num Figure 45: Build Java Security Command TC65 JAVA User's Guide_V05 parameter unit HASH (SHA1) signature parameter unit Page 78 of 90 signature unit 26.09.2005...

  • Page 79: Send Java Security Command To The Module

    TC65 JAVA User's Guide Strictly confidential / Released 11.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).

  • Page 80: Create A Java Security Environment Step By Step

    TC65 JAVA User's Guide Strictly confidential / Released 11.5 Create a Java Security Environment Step by Step 11.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 is in the Java SDK.

  • Page 81: Sign A Midlet

    TC65 JAVA User's Guide Strictly 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 > 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 >...

  • Page 82: Java Tutorial

    TC65 JAVA User's Guide Strictly confidential / Released 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. 12.1 Using the AT Command API Perhaps the most important API for the developer is the AT command API.

  • Page 83: Sending An At Command To The Device, The Send() Method

    TC65 JAVA User's Guide Strictly confidential / Released 12.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.

  • Page 84

    (rcv >= 0) { System.out.print((char)rcv); /* The example continues after the next block of text */ In …/Siemens/SMTK/TC65/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.

  • Page 85: Synchronization

    TC65 JAVA User's Guide Strictly confidential / Released 12.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() function are synchronized in the user implementation.

  • Page 86: Atcommandlistener Interface

    TC65 JAVA User's Guide Strictly confidential / Released 12.1.3 ATCommandListener Interface The ATCommandListener interface implements callback functions for: • URCs • Changes of the serial interface signals RING, DCD and DSR • Opening and closing of data connections The user must create an implementation class for ATCommandListener to receive AT events.

  • Page 87: Registering A Listener With An Atcommand Instance

    TC65 JAVA User's Guide Strictly confidential / Released /* 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 */...

  • Page 88: Programming The Midlet

    TC65 JAVA User's Guide Strictly confidential / Released 12.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.

  • Page 89

    TC65 JAVA User's Guide Strictly confidential / Released try { Thread.sleep(1000); } catch(InterruptedException e) { System.out.println(e); System.out.println("Thread(" + loops + "): Finished naturally"); * ThreadDemo - constructor public ThreadDemo() { System.out.println("ThreadDemo: Constructor, creating threads"); thread1 = new DemoThread(2); thread2 = new DemoThread(6); * startApp() public void startApp() throws MIDletStateChangeException { System.out.println("ThreadDemo: startApp, starting threads");...

  • Page 90: Differences From The Tc45

    Strictly confidential / Released Differences from the TC45 For those who are familiar with the Siemens WM TC45 product this is an overview of the main differences between TC45 and TC65. • “real” TCP and UDP access interfaces: SocketConnection, ServerSocketConnection, UDPDatagramConnection.

Comments to this Manuals

Symbols: 0
Latest comments: