CINTERION TC65i, TC65i-X, EGS5, EGS5-X User Manual

Java User’s Guide
Version: 19 DocId: wm_java_usersguide_v19
Products: TC65i, TC65i-X, EGS5, EGS5-X
User’s Guide
Java User’s Guide
2
Document Name:
Version: Date: DocId: Status Supported Products:
Java User’s Guide
19 2012-01-27 wm_java_usersguide_v19 Confidential / Released TC65i, TC65i-X, EGS5, EGS5-X
GENERAL NOTE
THE USE OF THE PRODUCT INCLUDING THE SOFTWARE AND DOCUMENTATION (THE "PROD­UCT") IS SUBJECT TO THE RELEASE NOTE PROVIDED TOGETHER WITH PRODUCT. IN ANY EVENT THE PROVISIONS OF THE RELEASE NOTE SHALL PREVAIL. THIS DOCUMENT CON­TAINS INFORMATION ON CINTERION PRODUCTS. THE SPECIFICATIONS IN THIS DOCUMENT ARE SUBJECT TO CHANGE AT CINTERION'S DISCRETION. CINTERION WIRELESS MODULES GMBH GRANTS A NON-EXCLUSIVE RIGHT TO USE THE PRODUCT. THE RECIPIENT SHALL NOT TRANSFER, COPY, MODIFY, TRANSLATE, REVERSE ENGINEER, CREATE DERIVATIVE WORKS; DISASSEMBLE OR DECOMPILE THE PRODUCT OR OTHERWISE USE THE PRODUCT EXCEPT AS SPECIFICALLY AUTHORIZED. THE PRODUCT AND THIS DOCUMENT ARE PROVIDED ON AN "AS IS" BASIS ONLY AND MAY CONTAIN DEFICIENCIES OR INADEQUACIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, CINTERION WIRELESS MODULES GMBH DIS­CLAIMS ALL WARRANTIES AND LIABILITIES. THE RECIPIENT UNDERTAKES FOR AN UNLIMITED PERIOD OF TIME TO OBSERVE SECRECY REGARDING ANY INFORMATION AND DATA PRO­VIDED TO HIM IN THE CONTEXT OF THE DELIVERY OF THE PRODUCT. THIS GENERAL NOTE SHALL BE GOVERNED AND CONSTRUED ACCORDING TO GERMAN LAW.
Copyright
Transmittal, reproduction, dissemination and/or editing of this document as well as utilization of its con­tents 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 © 2012, Cinterion Wireless Modules GmbH
Trademark Notice
Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other coun tries. All other registered trademarks or trademarks mentioned in this document are property of their respective owners.
wm_java_usersguide_v19 Page 2 of 109 2012-01-27 Confidential / Released
Java User’s Guide

Content

109
Content
1 Preface.......................................................................................................................10
2 Overview....................................................................................................................11
2.1 Related Documents .........................................................................................11
2.2 Terms and Abbreviations.................................................................................12
3 Installation.................................................................................................................13
3.1 System Requirements......................................................................................13
3.2 Installation CD Content....................................................................................13
3.3 Cinterion Mobility Toolkit Installation................................................................14
3.3.1 Installation Prerequisites.....................................................................14
3.3.2 Installing CMTK...................................................................................15
3.4 CMTK Uninstall................................................................................................19
3.5 Upgrades .........................................................................................................19
4 Software Platform.....................................................................................................20
4.1 Software Architecture.......................................................................................20
4.2 Interfaces.........................................................................................................21
4.2.1 ASC0 - Serial Device..........................................................................21
4.2.2 General Purpose I/O........................................................................... 21
4.2.3 DAC/ADC............................................................................................21
4.2.4 ASC1...................................................................................................21
4.2.5 Digital Audio Interface (DAI) ...............................................................21
4.2.6 I2C/SPI................................................................................................21
4.2.7 JVM Interfaces....................................................................................22
4.2.7.1 IP Networking......................................................................22
4.2.7.2 Media ..................................................................................22
4.2.7.3 Other Interfaces ..................................................................22
4.3 Data Flow of a Java Application Running on the Module ................................23
4.4 Handling Interfaces and Data Service Resources...........................................24
4.4.1 Module States.....................................................................................24
4.4.1.1 State 1: Default – No Java Running....................................24
4.4.1.2 State 2: No Java Running, General Purpose I/O and
I2C/SPI................................................................................25
4.4.1.3 State 4: Default – Java Application Active........................... 25
4.4.1.4 State 5: Java Application Active, General Purpose I/O and
I2C/SPI................................................................................25
4.4.2 Module State Transitions....................................................................26
5 Maintenance ..............................................................................................................27
5.1 IP Service.........................................................................................................27
5.2 Remote SIM Access ........................................................................................28
5.3 Power Saving...................................................................................................28
5.3.1 Power Saving While GPRS is Active..................................................28
5.4 Charging ..........................................................................................................29
wm_java_usersguide_v19 Page 3 of 109 2012-01-27 Confidential / Released
Java User’s Guide
Content
109
5.5 Airplane Mode..................................................................................................29
5.6 Alarm................................................................................................................29
5.7 Shutdown.........................................................................................................30
5.7.1 Automatic Shutdown........................................................................... 30
5.7.2 Manual Shutdown...............................................................................30
5.7.3 Restart after Switch Off.......................................................................30
5.7.4 Watchdog............................................................................................30
5.8 Special AT Command Set for Java Applications .............................................31
5.8.1 Switching from Data Mode to Command Mode..................................31
5.8.2 Mode Indication after MIDlet Startup ..................................................31
5.8.3 Long Responses.................................................................................31
5.8.4 Configuration of Serial Interface .........................................................31
5.8.5 Java Commands.................................................................................32
5.8.6 AutoExec Function..............................................................................32
5.9 System Out......................................................................................................32
5.9.1 Serial interfaces..................................................................................32
5.9.2 File......................................................................................................32
5.9.3 UDP ....................................................................................................33
5.10 GPIO................................................................................................................33
5.11 Restrictions......................................................................................................33
5.11.1 Flash File System ...............................................................................33
5.11.2 Memory...............................................................................................33
5.11.3 JAD File Size ......................................................................................33
5.12 Performance ....................................................................................................34
5.12.1 Java ....................................................................................................34
5.12.2 Pin I/O.................................................................................................35
5.12.3 Data Rates on RS-232 API................................................................. 35
5.13 System Time....................................................................................................39
5.12.3.1 Plain Serial Interface...........................................................36
5.12.3.2 Voice Call in Parallel ...........................................................36
5.12.3.3 Scenarios with GPRS/EGDE Connection........................... 36
5.12.3.4 Upload.................................................................................37
5.12.3.5 Download............................................................................38
6 MIDlets.......................................................................................................................40
6.1 MIDlet Documentation .....................................................................................40
6.2 MIDlet Life Cycle..............................................................................................40
6.3 Hello World MIDlet...........................................................................................42
7 File Transfer to Module.............................................................................................43
7.1 Module Exchange Suite...................................................................................43
7.1.1 Windows Based..................................................................................43
7.1.2 Command Line Based ........................................................................43
7.2 Over the Air Provisioning.................................................................................43
wm_java_usersguide_v19 Page 4 of 109 2012-01-27 Confidential / Released
Java User’s Guide
Content
109
7.3 Security Issues.................................................................................................44
7.3.1 Module Exchange Suite...................................................................... 44
7.3.2 OTAP..................................................................................................44
8 Over The Air Provisioning (OTAP) ..........................................................................45
8.1 Introduction to OTAP .......................................................................................45
8.2 OTAP Overview...............................................................................................45
8.3 OTAP Parameters............................................................................................46
8.4 Short Message Format ....................................................................................47
8.5 Java File Format..............................................................................................48
8.6 Procedures.......................................................................................................49
8.6.1 Install/Update......................................................................................49
8.6.2 Delete..................................................................................................50
8.7 Time Out Values and Result Codes.................................................................51
8.8 Tips and Tricks for OTAP.................................................................................51
8.9 OTAP Tracer....................................................................................................52
8.10 Security............................................................................................................52
8.11 How To.............................................................................................................52
8.12 Incremental OTAP ...........................................................................................53
9 Compile and Run a Program without a Java IDE................................................... 55
9.1 Build Results....................................................................................................55
9.2 Compile............................................................................................................56
9.3 Run on the Module with Manual Start..............................................................56
9.4 Run on the Module with Autostart....................................................................57
9.4.1 Switch on Autostart.............................................................................57
9.4.2 Switch off Autostart.............................................................................57
10 Compile and Run a Program with a Java IDE.........................................................58
10.1 Debug Environment.........................................................................................58
10.1.1 Data Flow of a Java Application in the Debug Environment...............58
10.1.2 Emulator..............................................................................................59
10.1.3 Change Baud Rate .............................................................................60
10.2 Using Eclipse for Java Development...............................................................62
10.2.1 Installing the "Mobile Tools for Java" Plugin.......................................62
10.2.2 Integrating Cinterion WTK Manually...................................................63
10.2.3 Import the provided WTK Samples.....................................................66
10.2.4 Creating a new MIDlet ........................................................................68
10.2.5 Using Eclipse Workspaces .................................................................75
10.3 Using NetBeans for Java Development........................................................... 76
10.3.1 Installing the "Mobility" Plugin.............................................................76
10.3.2 Integrating Cinterion WTK Manually...................................................77
10.3.3 Opening the Provided WTK Samples.................................................79
10.3.4 Creating a New MIDlet........................................................................79
10.4 Switching Java "System.out" to IDE Debug Window.......................................83
wm_java_usersguide_v19 Page 5 of 109 2012-01-27 Confidential / Released
Java User’s Guide
Content
109
11 Java Security.............................................................................................................85
11.1 Secure Data Transfer.......................................................................................85
11.1.1 Create a Secure Data Transfer Environment Step by Step................ 87
11.2 Execution Control.............................................................................................90
11.2.1 Change to Secured Mode Concept.....................................................91
11.2.2 Concept for the Signing the Java MIDlet ............................................92
11.3 Application and Data Protection.......................................................................93
11.4 Structure and Description of the Java Security Commands ............................93
11.4.1 Structure of the Java Security Commands .........................................94
11.4.2 Build Java Security Command............................................................95
11.4.3 Send Java Security Command to the Module.....................................96
11.5 Create a Java Security Environment Step by Step..........................................97
11.5.1 Create Key Store ................................................................................97
11.5.2 Export X.509 Root Certificate .............................................................97
11.5.3 Create Java Security Commands.......................................................97
11.5.4 Sign a MIDlet ......................................................................................99
11.6 Attention...........................................................................................................99
12 Java Tutorial............................................................................................................100
12.1 Using the AT Command API..........................................................................100
12.1.1 Class ATCommand...........................................................................100
12.1.1.1 Instantiation with or without CSD Support.........................100
12.1.1.2 Sending an AT Command to the Device,
the send() Method.............................................................101
12.1.1.3 Data Connections..............................................................102
12.1.1.4 Synchronization.................................................................104
12.1.2 ATCommandResponseListener Interface.........................................104
12.1.2.1 Non-Blocking ATCommand.send() Method....................... 104
12.1.3 ATCommandListener Interface......................................................... 105
12.1.3.1 ATEvents...........................................................................105
12.1.3.2 Implementation..................................................................106
12.1.3.3 Registering a Listener with an ATCommand Instance...... 107
12.2 Programming the MIDlet................................................................................108
12.2.1 Threads.............................................................................................108
12.2.2 Example............................................................................................108
wm_java_usersguide_v19 Page 6 of 109 2012-01-27 Confidential / Released
Java User’s Guide

Tables

7
Tables
Table 1: GPRS upload data rate with different number of timeslots, CS2................... 37
Table 2: GPRS upload data rate with different number of timeslots, CS4................... 37
Table 3: EDGE upload data rate with two timeslots, CS5............................................ 37
Table 4: EDGE upload data rate with two timeslots, CS9............................................ 37
Table 5: GPRS Download data rate with different number of timeslots, CS2.............. 38
Table 6: GPRS Download data rate with different number of timeslots, CS4.............. 39
Table 7: EDGE Download data rate with different number of timeslots, CS5.............. 39
Table 8: EDGE Download data rate with different number of timeslots, CS9.............. 39
Table 9: A typical sequence of MIDlet execution......................................................... 41
Table 10: Parameters and keywords ............................................................................. 46
wm_java_usersguide_v19 Page 7 of 109 2012-01-27 Confidential / Released
Java User’s Guide

Figures

9
Figures
Figure 1: Overview........................................................................................................ 11
Figure 2: CMTK - InstallShield Wizard.......................................................................... 15
Figure 3: Module Exchange Suite - InstallShield Wizard.............................................. 16
Figure 4: IMP Debug Connection - InstallShield Wizard............................................... 17
Figure 5: Scan COM ports for available JAVA module ................................................. 17
Figure 6: Scan for supported JAVA IDEs...................................................................... 18
Figure 7: Query to install Eclipse IDE as part of CMTK installation .............................. 18
Figure 8: Interface Configuration................................................................................... 22
Figure 9: Data flow of a Java application running on the module.................................. 23
Figure 10: Module State 1............................................................................................... 24
Figure 11: Module State 2............................................................................................... 25
Figure 12: Module State 4............................................................................................... 25
Figure 13: Module State 5............................................................................................... 25
Figure 14: Module State Transition Diagram................................................................... 26
Figure 15: Test case for measuring Java command execution throughput..................... 34
Figure 16: Test case for measuring Java MIDlet performance and handling pin-IO....... 35
Figure 17: Scenario for testing data rates on ASC1........................................................ 36
Figure 18: Scenario for testing data rates on ASC1 with a voice call in parallel............. 36
Figure 19: Scenario for testing data rates on ASC1 with GPRS data upload ................. 38
Figure 20: Scenario for testing data rates on ASC1 with GPRS data download............. 38
Figure 21: OTAP Overview............................................................................................. 45
Figure 22: OTAP: Install/Update Information Flow (messages in brackets are optional) 49
Figure 23: OTAP: Delete Information Flow (messages in brackets are optional) ........... 50
Figure 24: Data flow of a Java application in the debug environment............................. 58
Figure 25: Specify maximum port speed for modem device........................................... 60
Figure 26: Configure debug connection.......................................................................... 61
Figure 27: Specify baud rate for debug connection......................................................... 61
Figure 28: Installing the "Mobile Tools for Java" plugin................................................... 62
Figure 29: Integrating Cinterion WTK manually - Select preference............................... 63
Figure 30: Integrating Cinterion WTK manually - Browse............................................... 64
Figure 31: Integrating Cinterion WTK manually - Edit..................................................... 64
Figure 32: Integrating Cinterion WTK manually - Library................................................ 65
Figure 33: Integrating Cinterion WTK manually - Add WTK documentation................... 65
Figure 34: Import the provided WTK Samples - Select................................................... 66
Figure 35: Import the provided WTK Samples - Copy..................................................... 67
Figure 36: Creating a new MIDlet - Select wizard........................................................... 68
Figure 37: Creating a new MIDlet - Create project.......................................................... 69
Figure 38: Creating a new MIDlet - Configure project..................................................... 70
Figure 39: Creating a new MIDlet - Project overview...................................................... 71
Figure 40: Creating a new MIDlet - Configure compliance level..................................... 72
Figure 41: Creating a new MIDlet - Program name......................................................... 73
Figure 42: Creating a new MIDlet - HelloWorld.java....................................................... 74
Figure 43: Using Eclipse workspaces............................................................................. 75
Figure 44: Installing "Mobility" plugin............................................................................... 76
Figure 45: Integrating Cinterion WTK manually - Select platform................................... 77
Figure 46: Integrating Cinterion WTK manually - Select type ......................................... 78
Figure 47: Integrating Cinterion WTK manually - Platform folder.................................... 78
Figure 48: Integrating Cinterion WTK manually - Finish.................................................. 79
Figure 49: Creating a new MIDlet - Choose project........................................................ 80
wm_java_usersguide_v19 Page 8 of 109 2012-01-27 Confidential / Released
Java User’s Guide
Figures
9
Figure 50: Creating a new MIDlet - Enter name and location......................................... 80
Figure 51: Creating a new MIDlet - Configure platform................................................... 81
Figure 52: Creating a new MIDlet - Program name......................................................... 81
Figure 53: Creating a new MIDlet - HelloWorld.java....................................................... 82
Figure 54: Mode 1 – Customer Root Certificate does not exist....................................... 86
Figure 55: Mode 2 - Server Certificate and Certificate into module are identical............ 86
Figure 56: Mode 2 - Server Certificate and self signed root Certificate in module form
a chain ........................................................................................................... 87
Figure 57: Insert Customer Root Certificate.................................................................... 91
Figure 58: Prepare MIDlet for Secured Mode................................................................. 92
Figure 59: Build Java Security Command....................................................................... 95
wm_java_usersguide_v19 Page 9 of 109 2012-01-27 Confidential / Released
Java User’s Guide

1 Preface

10
1Preface
This document covers the full range of IMP-NG Java products from Cinterion Wireless Mod­ules, currently including:
1. TC65i Module
2. TC65i-X Module
3. EGS5 Module
4. EGS5-X Module Differences between the products are noted in the particular chapters. Throughout the docu-
ment, all supported products are referred to as ME (Mobile Equipment). For use in file, directory or path names, the string “<productname>” represents the actual name of a product, for ex­ample TC65i. Screenshots are provided as examples and, unless otherwise stated, apply to all supported products.
wm_java_usersguide_v19 Page 10 of 109 2012-01-27 Confidential / Released
Java User’s Guide

2 Overview

12
2Overview
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 an d the tools provided on the installation CD.
Figure 1: Overview

2.1 Related Documents

List of documents referenced throughout this manual: [1] AT Command Set of your Cinterion Wireless Modules product [2] Hardware Interface Description of your Cinterion Wireless Modules product [3] Java doc \wtk\doc\html\index.html [4] IMP-NG, JSR228, Standard
wm_java_usersguide_v19 Page 11 of 109 2012-01-27 Confidential / Released
Java User’s Guide

2.2 Terms and Abbreviations

12
2.2 Terms and Abbreviations
Abbreviation Description
API Application Program Interface ASC Asynchronous Serial Controller CLDC Connected Limited Device Configuration CMTK Cinterion Mobility Toolkit CSD Circuit-Switched Data DAI Digital Audio Interface DCD Data Carrier Detect DSR Data Set Ready GPIO General Purpose I/O GPRS General Packet Radio Service HTTP Hypertext Transfer Protocol
I/O Input/Output IDE Integrated Development Environment IP Internet Protocol Java ME Java SE JAD Java Application Description JAR Java Archive JDK Java Development Kit JVM Java Virtual Machine LED Light Emitting Diode ME Mobile Equipment MES Module Exchange Suite MIDP Mobile Information Device Protocol OTA Over The Air OTAP Over The Air Provisioning of Java Applications PDP Packet Data Protocol PDU Protocol Data Unit
Java Micro Edition (also known as J2ME) Java Standard Edition
SDK Standard Development Kit SMS Short Message Service TCP Transfer Control Protocol URC Unsolicited Result Code URL Universal Resource Locator VBS Visual Basic Script WTK Wireless Toolkit
wm_java_usersguide_v19 Page 12 of 109 2012-01-27 Confidential / Released
Java User’s Guide

3 Installation

19
3Installation

3.1 System Requirements

The Cinterion Mobility Toolkit (CMTK) requires that you have:
Windows XP, Windows Vista or Windows 7 installed
110 Mbytes free disk space for the CMTK (without JDK and IDE)
Administration privileges
Java SE Development Kit 6 Update 25. To install the JDK version 1.6.0_25 provided on CD,
follow the instructions in Section 3.3.1.
If a Java IDE such as NetBeans (as of 6.5 - 6.9.1) or Eclipse (as of 3.6.0 - Helios SR2) is in­stalled, the CMTK environment can be integrated into it during installation of the CMTK. To in­stall one of the IDEs, follow the installation instructions in Section 3.3.1.
If you wish to access the module via USB ensure that the USB cable is plugged between the module’s USB interface and the PC.

3.2 Insta llation CD Content

The Cinterion Mobility Toolkit Installation CD includes:
Wireless Toolkit. The WTK is the directory where all the necessary components for product
specific Java application creation and debugging are stored. The WTK version is stored in a text file under "Program Files\Cinterion\CMTK\<product name>\WTK\VersionWTK.txt". The WTK is distributed on the CD under "program files\Cinterion\CMTK\ABC2\WTK" with
-bin various tools
- doc html
- lib classes.zip
WTK samples are distributed on the CD under "All Users\Cinterion ABC2 WTK Examples"
Module Exchange Suite. The MES setup is distributed on CD under "Installer\MES­Setup.exe". The MES provides tools to access the Flash file system on the module from the development environment over a serial interface. The MES may be installed separately, but can also be installed as part of CMTK - see Section 3.3.
IMP Debug Connection. The setup is found under "Installer\IMPDbgConnectionSetup.exe". The setup installs an IDE debug modem for on device debugging (see Chapter 10). The IMP Debug Connection may be installed separately, but can also be installed as part of CMTK - see Section 3.3.
Java SDK
- jdk-6u25-windows-i586.exe
NetBeans IDE 6.9.1
- netbeans-6.9.1-ml-javase-windows.exe
Eclipse Helios SR2 (v3.6.1)
- eclipse-pulsar-helios-SR2-win32.zip
Eclipse Helios SR2 (64-bit) (v3.6.1)
- eclipse-pulsar-helios-SR2-win32-x86_64.zip
Documentation is distributed on the CD under "program files\Cinterion\CMTK\ABC2\<prod­uct name> Documentation" and includes AT Command Set, Hardware Interface Descrip­tion as well as this Java Users Guide.
wm_java_usersguide_v19 Page 13 of 109 2012-01-27 Confidential / Released
Java User’s Guide

3.3 Cinterion Mobility Toolkit Installation

19
3.3 Cinterion Mobility Toolkit Installation
The CMTK is distributed on CD. The installation program automatically installs the necessary components and IDE integrations. The software can be uninstalled and updated with the install program.
This section covers the installation and removal of the CMTK including the installation of the prerequisite JDK and supported IDEs.

3.3.1 Installation Prerequisites

Before the CMTK is installed from CD a standard Java Development Kit (JDK) should be in­stalled
The Java SE Development Kit 6 Update 25 is distributed as part of the installation CD under "Contribution\jdk-6u25-windows-i586.exe". To install the JDK please call the contribution file and follow the instructions on the screen. If there is no appropriate JDK installed, the installation of the provided JDK will be offered automatically during the CMTK installation process. Once the JDK has been installed, the environment variable “path” can be altered to comfortably use the JDK tools without IDE (this is not necessary for using the Cinterion CMTK):
- Open the Control Panel:
Open System. Click on Advanced. Click on the Environment Variables button. Choose path from the list of system variables. Append the path for the bin directory of the newly installed SDK to the list of directories for the path variable.
Apart from the JDK installation it is recommended to install a Java Development Environment (IDE):
The Eclipse IDE as well as the NetBeans IDE are distributed as part of the installation CD under "Contribution\eclipse-pulsar-helios-SR2-win32.zip" resp. "Contribution\eclipse-pul­sar-helios-SR2-win32-x86_64.zip" (for 64-bit systems) or "Contibution\netbeans-6.9.1-ml­javase-windows.exe". To install any of these IDEs please call the contribution setup file (resp. unzip the contribution archive and call the setup file). An Eclipse IDE may also be installed as part of the CMTK installation described in Section 3.3.2. Note that the Eclipse IDE provided on the installation CD is a special Eclipse Mobile T ools Platform called Pulsar. Pulsar already includes "Mobile Tools for Java" required for devel­oping Java applications for Cinterion Java modules. If employing any other Eclipse IDE vari­ant or the NetBeans IDE also provided on the installation CD, it is necessary to install additional plugins containing mobile resp. mobility tools. Please refer to Chapter 10 for more information on how to install these plugins for Eclipse and NetBeans.
wm_java_usersguide_v19 Page 14 of 109 2012-01-27 Confidential / Released
Java User’s Guide
3.3 Cinterion Mobility Toolkit Installation
19

3.3.2 Installing CMTK

Before you start the installation please make sure all applications - especially possible IDEs ­are closed:
1. Insert the installation CD and start Setup.exe. When the dialog box appears press the Next button to start the CMTK installation.
Figure 2: CMTK - InstallShield Wizard
2. Read the CMTK license agreement. If you accept the agreement, press Yes to continue with the installation.
3. Read the information about the installation and the use of the CMTK. Press Next to con­tinue.
wm_java_usersguide_v19 Page 15 of 109 2012-01-27 Confidential / Released
Java User’s Guide
3.3 Cinterion Mobility Toolkit Installation
19
4. Install the Module Exchange Suite (MES) as part of the CMTK installation. The MES pro­vides tools to access the Flash file system on the module from the development environ­ment over a serial interface. File transfers between PC and module are greatly facilitated by this suite. The MES is installed to "Program Files\Cinterion\Module Exchange Suite".
Figure 3: Module Exchange Suite - InstallShield Wizard
5. Read the MES license agreement. If you accept the agreement, press Yes to continue with the installation.
6. Click Finish to complete the MES installation.
wm_java_usersguide_v19 Page 16 of 109 2012-01-27 Confidential / Released
Java User’s Guide
3.3 Cinterion Mobility Toolkit Installation
19
7. Install the IMP debug connection as part of the CMTK installation.
Figure 4: IMP Debug Connection - InstallShield Wizard
8. Continue with installation even if software did not pass the Windows logo test.
9. Scan COM ports for available Java module. The scan may be skipped and can be repeated later as part of a repair installation. This is done by selecting the Cinterion IMP Debug Con­nection from Control Panel --> Add or Remove Programs and clicking Change.
Figure 5: Scan COM ports for available JAVA module
10.Click Finish to complete the IMP Debug Connection installation.
wm_java_usersguide_v19 Page 17 of 109 2012-01-27 Confidential / Released
Java User’s Guide
3.3 Cinterion Mobility Toolkit Installation
19
11. Scan system for supported Java IDEs to automatically integrate the WTK into. Please ensure that none of the possibly installed Java IDEs is running before the scan is started. The scan may be skipped and can be repeated later as part of a repair installation. This is done by selecting the Cinterion ABC2 Software Development Kit from Control Panel --> Add or Remove Programs and clicking Change.
Figure 6: Scan for supported JAVA IDEs
12.If the above scan did not deliver any supported Java IDE, it is possible to install the Eclipse IDE ("Pulsar") provided on the installation CD.
Figure 7: Query to install Eclipse IDE as part of CMTK installation
13.Click Finish to complete the CMTK installation.
wm_java_usersguide_v19 Page 18 of 109 2012-01-27 Confidential / Released
Java User’s Guide

3.4 CMTK Uninstall

19
3.4 CMTK Uninstall
The CMTK install package comes with an uninstall facility. The entire CMTK or parts of the package can be removed. To start the uninstall facility, open the Control Panel, select Add /Re­move Programs, select the desired CMTK, e.g. Cinterion ABC2 Software Development Kit and follow the instructions. The standard modem and Dial-Up Network connection (DUN) are unin­stalled automatically.
The Module Exchange Suite (MES) is not uninstalled automatically with the CMTK. To uninstall the MES as well, please run the MES uninstall facility. To run the uninstall program, open the Control Panel, select Add/Remove Programs, select Cinterion Module Exchange Suite (MES) and follow the instructions. The MES might still be used by other CMTK versions and should in this case not be uninstalled.
Please keep in mind, that standard modem (or USB modem) and Dial-Up Network connection are required for a proper working of the CMTK on-device debugging.

3.5 Upgrades

The CMTK can be modified, repaired or removed by running the setup program on the Instal­lation CD.
wm_java_usersguide_v19 Page 19 of 109 2012-01-27 Confidential / Released
Java User’s Guide

4 Software Platform

26
4 Software Platform
In this chapter, we discuss the software architecture of the CMTK and the interfaces to it.

4.1 Software Architecture

The CMTK enables a customer to develop a Java application on a PC and have it be execut­able on the Java enabled module. The application is then loaded onto the module. The platform comprises:
•Java
Additional Java virtual machine interfaces:
Memory space for Java programs:
Additional accessible periphery for Java applications
TM
Micro Edition (Java METM), which forms the base of the architecture. The Java ME ically designed for embedded systems and has a small memory footprint. The ME uses: CLDC 1.1 HI, the connected limited device configuration hot spot implementation. IMP-NG, the information module profile 2 MIDP 2.0 but without the lcdui package.
AT Command API File I/O API The data flow through these interfaces is shown in Figure 9 and Figure 24.
Flash File System: around 1.7 MB (8 MB for TC65i-X and EGS5-X partitioned into 4 MB on A:\ drive and 4 MB on C:\ drive. The C:\ drive is intended as a temporary storage when updating the EGS5-X firmware over the air (FOTA)). RAM: around 400kB (1.7 MB for TC65i-X and EGS5-X) Application code and data share the space in the flash file system and in RAM.
- 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 current meter. For detailed information see Section 4.2.
TM
is provided by SUN Microsystems, http://java.sun.com/javame/. It is specif-
nd
generation, this is for the most part identical to
wm_java_usersguide_v19 Page 20 of 109 2012-01-27 Confidential / Released
Java User’s Guide

4.2 Interfaces

26
4.2 Interfaces

4.2.1 ASC0 - Serial Device

ASC0, an Asynchronous Serial Controller, is a 9-wire serial interface. It is described in [2]. With­out a running Java application the module can be controlled by sending AT commands over ASC0. Furthermore, ASC0 is designed for transferring files from the development PC to the module. When a Java application is started, ASC0 can be used as an RS-232 port or/and Sys­tem.out. Refer to [3] 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 config­ured as a pulse counter. All lines can be accessed under Java by AT commands or a Java API. See [1] and [2] 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 or via a Java API. See [1] and [2] for details.

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.

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 [1] and [2] for more information.

4.2.6 I2C/SPI

There is a 4 line serial interface which can be used as I2C or SPI interface. It is described in
[2]. The AT^SSPI AT command configures and drives this interface. For details see [1]. I2C
and SPI are also accessible from a Java API.
wm_java_usersguide_v19 Page 21 of 109 2012-01-27 Confidential / Released
Java User’s Guide
4.2 Interfaces
26

4.2.7 JVM Interfaces

Figure 8: Interface Configuration
Java ME, CLDC and MIDP were implemented by SUN. IMP-NG is a stripped down version of MIDP 2.0 and does not include the graphical interface LCDUI. There are also additional APIs like the File I/O and the AT command API. Documentation for Java ME a nd CLDC can be found at http://java.sun.com/javame/. Documentation for the other APIs is found in [3].
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 [1] or by parameters given to the connector open method, see [3].
4.2.7.2 Media
The playTone method and the tone sequence player are supported. For optimum performance use notes in the range of 48 to 105. Tones outside this range are affected by audio hardware filtering (see [2]).
4.2.7.3 Other Interfaces
Neither the PushRegistry interfaces and mechanisms nor any URL schemes for the Platform­Request method are supported. See [3].
wm_java_usersguide_v19 Page 22 of 109 2012-01-27 Confidential / Released
Java User’s Guide

4.3 Data Flow of a Java Application Running on the Module

26
4.3 Data Flow of a Java Application Running on the Module
Figure 9: Data flow of a Java application runn i n g on th e 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 24. 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:
Flash File System: available memory for Java applications
TCP/IP: module internal TCP/IP stack
GPIO: general purpose I/O
ASC0: Asynchronous serial interface 0
ASC1: Asynchronous serial interface 1
I2C: I2C Bus interface
SPI: Serial Peripheral Interface
DAC: digital analog converter
ADC: analog digital converter
AT parser: accessible AT parser The Java environment on the module consists of the:
JVM: Java Virtual Machine
AT command API: Java API to AT parser
File API: Java API to Flash File System
IMP-NG: Java API to TCP/IP and ASC0/1
GPIO API: Java API to GPIO pins and pulse counter
I2C/SPI API: Java API to access I2C/SPI Bus
ADC/DAC API: Java API to access ADC and DAC
Watchdog API: Java API to HW watchdog
Bearer Control API: Java API for bearer state information and hang-up.
wm_java_usersguide_v19 Page 23 of 109 2012-01-27 Confidential / Released
Java User’s Guide

4.4 Handling Interfaces and Data Service Resources

26
4.4 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 multiple AT parsers available
There is hardware access over
- two serial interfaces: ASC1 and ASC0 (both fully accessible).
- general purpose I/O. To configure the hardware access, please refer to [1] and [2].
- I2C/SPI
- All restrictions of combinations are described in Section 4.4.1
A Java application has:
- instances of the AT command class, one with CSD and the others without, each of which
would, in turn, be attached to one of the AT parsers.
- two instances of access to a serial interface, ASC0 and ASC1, through the CommCon-
nection API. Access to the control lines of these interfaces through CommConnection­ControlLines.
- 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 in­terfaces, GPIO and I2C/SPI. See [1] for information about the AT commands referenced. A state transition diagram is shown in Figure 13.
This section shows how Java applications must share AT parsers, GPIO pins and I2C/SPI re­sources. DAC, ADC and DAI are not discussed here. Color legend for the following figures:
4.4.1.1 Sta te 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. The initial state of the pins is according to [4].
Figure 10: Module State 1
wm_java_usersguide_v19 Page 24 of 109 2012-01-27 Confidential / Released
Java User’s Guide
4.4 Handling Interfaces and Data Service Resources
26
4.4.1.2 Sta te 2: No Java Running, General Purpose I/O and I2C/ SPI
The Java application is inactive. There is an AT parser with CSD on ASC0 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 con­figured by AT^SCPIN and AT^SSPI (refer [1]).
Figure 11: Module State 2
4.4.1.3 State 4: Default – Java Application Active
The Java application is active and ASC0 and ASC1 are used as System.out and/or CommCon­nection. Java instances of AT commands are connected to the availa ble AT parsers. The Java application is activated with AT^SJRA (refer to [1]) or autostart.
Figure 12: 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 ASC0 and ASC1 are used as System.out and/or CommCon­nection. The Java application is activated with AT^SJRA. The I/O pins are configured with AT^SCPIN, the I2C/SPI interface with AT^SSPI. Refer to [1] for AT command details.
Figure 13: Module State 5
wm_java_usersguide_v19 Page 25 of 109 2012-01-27 Confidential / Released
Java User’s Guide
4.4 Handling Interfaces and Data Service Resources
26

4.4.2 Module State Transitions

Figure 14: Module State Transition Diagram
Note: No AT parser is available over serial interface ASC0 or ASC1 while a Java application is running on the module.
wm_java_usersguide_v19 Page 26 of 109 2012-01-27 Confidential / Released
Java User’s Guide

5 Maintenance

39
5 Maintenance
The basic maintenance features of the ME are described below. Explicit details of these func­tions and modes can be found in [1] and [2].

5.1 IP Service

Apart from the standard Java IP networking interfaces (UDPDatagramConnection, SocketCon­nection, ...) the ME also supports a set of Internet Services controlled b y AT co mmand. There are some correlations between the Java and the AT IP Services.
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 AT^SJNET or in the connector.open method.
Java tries to (re-)use an active Internet Service profile: if using connection profile 0 fails,
because e.g. this (or another) connection profile is already used by the Internet Services, Java networking also uses this, already active, profile.
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 param­eter <inactTO> 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. It is recommended to use connection profile 0 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 IP Services (Java and AT com­mand):
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).
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.
If a user rapidly closes and opens TCP/IP connections (e.g. SocketConnection, HTTPCon-
nection), a ConnectionNotFoundException reading "No buffer space available" may be thrown, explaining that all TCP/IP socket resources are exhausted. In the worst case, open­ing further TCP/IP connections is locked for up to 60 seconds.
If a service is re-opened on the same port shortly after having closed the ServerSocketCon-
nection, the ServerSocketConnection may not work properly. To ensure that the service works correctly the host is required to wait at least two minutes before reopening a server.
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.
When trying to start the bearer when it is still in the process of shutting down, e.g. right after
a "network idle timeout" an IOException is thrown. Either use a delay or wait for bearer state to actually say "down".
Some Java products feature the BearerControl class. This class provides bearer state informa­tion and a method to hang-up.
wm_java_usersguide_v19 Page 27 of 109 2012-01-27 Confidential / Released
Java User’s Guide

5.2 Remote SIM Access

39
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.
Java must not be started when RSA and/or the GSM 07.10 multiplexer is activated.
When activating the RSA mode (AT^SRSA) via a Java AT Command channel while Java
is running the parameter <muxChan> 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.

5.3 Power Saving

The module supports several power saving modes which can be configured by the AT com­mand AT+CFUN [1]. Power saving affects the Java application in two ways. First, it limits ac- cess 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:
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).
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 con­stant for at least 2.7s to detect any changes. For further details see AT^SCPOL in [1] or refer to [2].
Java power saving efficiency:
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.
When using networking functionality close all connectors and hang-up the bearer manually
(using ATH for circuit switched connections) every time you intend to reduce power con­sumption. 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.

5.3.1 Power Saving While GPRS is Active

It is also possible that the module saves power while the GPRS PDP context is activated but without ongoing data traffic. To save power in GPRS mode it is required to enable a power sav­ing mode (e.g. AT+CFUN=9) and put all threads into a sleep state. Also, data connections shall be in a blocking read (serial interface and/or GPRS connections).
wm_java_usersguide_v19 Page 28 of 109 2012-01-27 Confidential / Released
Java User’s Guide

5.4 Charging

39
5.4 Charging
Please refer to [1] and [2] 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 [2] for information about the Ch arge-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 com­mand on any opened channel. To read the URC it is necessary to register a listener (see [3]) on this AT command API instance before passing the first AT command.

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 [2]. The JVM is started when autostart is enabled. A Java ap- plication must be able to handle this mode. The airplane mode is indicated by URC “SYS­START AIRPLANE MODE”. Since the radio is off all classes related to networking connections, e.g. SocketConnection, UDPDatagramConnection, SocketServerConnection, HTTPConnec­tion, will throw an exception when accessed.

5.6 Alarm

The ALARM can be set with the AT+CALA command. Please refer to the AT Command Set [1] and Hardware Interface Description [2] 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 “airplan e 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 “^SYSSTART AIRPLANE MODE”.
Note: For detailed information which functionality is available in this mode see [1] and [2]. The mode indicating URC is created after issuing the very first AT command on any opened chan­nel.
wm_java_usersguide_v19 Page 29 of 109 2012-01-27 Confidential / Released
Java User’s Guide

5.7 Shutdown

39
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 mod­ule is to issue the AT^SMSO command. This procedure lets the module log off from the network and allows the software to enter a secure state and save all data. Fu rther details can be found in [2].

5.7.1 Automatic Shutdown

The ME is switched off automatically in different situations:
under- or overtemperature
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. Un­dervoltage 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 Com­mand Set [1]. In addition, a description of the shutdown procedures can be found in [2].

5.7.2 Manual Shutdown

The module can be switched off manually with the AT command, AT^SMSO. In this case 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 [1]), e.g. after a power failure, external hardware must restart the module with th e Ignition line (IGT). The Hardware Interface Description [2] explains how to handle a switched off situation.

5.7.4 Watchdog

The Watchdog class allows to access the HW watchdog of the system from application level. Depending on the setting (at^scfg) the userware watchdog can do nothing, swit ch-off or reboot the system.
wm_java_usersguide_v19 Page 30 of 109 2012-01-27 Confidential / Released
Loading...
+ 79 hidden pages