Download Print this page

Siemens TC45 User Manual

Cellular engine
Hide thumbs

Advertisement

Siemens Cellular Engine
JAVA™
User's
Guide
Version: 02
DocID:
TC45_JAVA User's Guide_V02

Advertisement

loading

  Also See for Siemens TC45

  Summary of Contents for Siemens TC45

  • Page 1 Siemens Cellular Engine JAVA™ User’s Guide Version: 02 DocID: TC45_JAVA User's Guide_V02...
  • 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

    TC45 TC45 JAVA User's Guide Confidential / Released Table of Contents Document history....................... 9 Introduction .......................10 Overview ......................10 Related documents ..................10 Terms and abbreviations.................11 Installation .........................12 System requirements..................12 Installation CD....................12 2.2.1 Components ..................13 2.2.1.1 WinMUX 2.1 ..................13 2.2.1.2 Module Exchange Suite................13 2.2.1.3 IMPSiemens ..................13...
  • Page 4 TC45 TC45 JAVA User's Guide Confidential / Released Shut down ......................18 3.4.1 Automatic shutdown ................18 3.4.2 Restart after switch off................18 Special AT command set for Java applications..........19 3.5.1 Switching from data mode to command mode........19 3.5.2 Mode indication after MIDlet startup .............19 3.5.3...
  • Page 5 TC45 TC45 JAVA User's Guide Confidential / Released AT Java Open Framework (AJOF)................34 AT Commands....................34 6.1.1 Mobile engine status................34 6.1.2 Voice call handling................34 6.1.3 CSD call and GPRS connection handling ..........34 6.1.4 Short Message Service ................34 6.1.5 Phonebook features ................35 6.1.6...
  • Page 6 10.2.1.3 Templates ....................54 10.2.1.4 Examples....................54 10.2.1.5 Compile and run ...................54 10.2.2 JBuilder Mobile Edition .................54 10.2.2.1 TC45 SMTK in Personal Edition ............54 10.2.2.1.1 Integration of TC45 SMTK ...............55 10.2.2.1.2 Restoring original settings..............57 10.2.2.2 TC45 SMTK in Enterprise Edition ............58 10.2.2.3 Examples....................59 10.2.2.4 Projects and templates .................60...
  • Page 7 TC45 TC45 JAVA User's Guide Confidential / Released 11.1.3.1 ATEvents....................66 11.1.3.2 Implementation..................66 11.1.3.3 Registering a listener with an ATCommand instance......67 11.2 Programming the MIDlet..................68 11.2.1 Threads ....................68 11.2.2 Example ....................68 11.3 AJOF ......................70 11.3.1 Example ....................70 TC45_JAVA User's Guide_V02 Page 7 of 72...
  • Page 8 Figure 19: Sun ONE Studio - Selecting a template...............54 Figure 20: Different JDK must be set in User Home.............55 Figure 21: Dialog box after changing the JDK to Siemens IMP Wireless Toolkit....56 Figure 22: Original setting for User Home ................57 Figure 23: JBuilder - JDK settings ..................58...
  • Page 9: Document History

    TC45 TC45 JAVA User's Guide Confidential / Released 0 Document history Preceding document: "TC45 JAVA User's Guide" Version 01 New document: "TC45 JAVA User's Guide" Version 02 Chapter Page What is new 11.3.1 Revised example TC45_JAVA User's Guide_V02 Page 9 of 72...
  • Page 10: Introduction

    SMS and fax. With Java technology and up to nine digital I/O ports, the module enables easy integration of your application. This document explains how to work with the TC45 module, the installation CD and the tools provided on the installation CD.
  • Page 11: Terms And Abbreviations

    TC45 TC45 JAVA User's Guide Confidential / Released 1.3 Terms and abbreviations Abbreviation Description Application Program Interface Asynchronous Serial Connection CLDC Connected Limited Device Configuration Circuit-Switched Data Digital Audio Interface Data Carrier Detect Data Set Ready GPIO General Purpose I/O...
  • Page 12: Installation

    TC45 TC45 JAVA User's Guide Confidential / Released 2 Installation 2.1 System requirements The Siemens Mobility Toolkit (SMTK) TC45 requires that you have: 1. Windows 2000 or Windows XP installed 2. 35 Mbytes free disk space 3. Administration privileges 4. Java 2 SDK, Standard Edition version 1.3 or 1.4. To install the JDK version 1.4.1 provided, follow the instructions in Section 2.3.1.
  • Page 13: Components

    TC45 TC45 JAVA User's Guide Confidential / Released 2.2.1 Components 2.2.1.1 WinMUX 2.1 The multiplexer mode enables one serial interface to transmit data to three different customer applications. This is achieved by providing three virtual channels using a multiplexer. The multiplexer is necessary for the SMTK environment. Information how to install the provided multiplexer sources can be found in [1].
  • Page 14: Smtk Installation

    SMTK. A Java IDE is not necessary to use the TC45 SMTK. The IDE installation can be done at any time even if the TC45 SMTK is installed already. To install the Java IDE run the setup program in maintenance mode again. However, you can continue the setup procedure and install the IDE installation later or cancel the setup program at this stage and restart it after installing one of the supported Java IDEs.
  • Page 15: Installing Sun One Studio 4.1 Mobile Edition

    12. This is the final step. Again, a listing of all installed components appears. 2.3.3 Installing Sun ONE Studio 4.1 Mobile Edition 1. Sun ONE Studio 4.1 Mobile Edition is provided on the TC45 SMTK installation disk in the subdirectory “SunOne ME” To begin installation, start the ffj_me_win32.exe and follow the instructions of the Sun ONE setup procedure.
  • Page 16: Uninstall

    Confidential / Released 2.4 Uninstall The TC45 SMTK install package comes with an uninstall facility. The entire SMTK or parts of the package can be removed. To start the uninstall facility, open the Control Panel, select Add/Remove Programs, select TC45 and follow the instructions.
  • Page 17: Maintenance

    TC45 TC45 JAVA User's Guide Confidential / Released 3 Maintenance Basic maintenance features of the TC45 are described below. Explicit details of these functions and modes can be found in the AT Command Set [4] and the Hardware Interface Description [5].
  • Page 18: Alarm Mode

    TC45 TC45 JAVA User's Guide Confidential / Released 3.3 Alarm mode The ALARM can be set by the at+cala AT command. Please refer to the AT Command Set [4] and Hardware Interface Description [5] for more information. One can set an alarm, switch off the module with at^smso, and have the module restart in ALARM mode at the time set with at+cala.
  • Page 19: Special At Command Set For Java Applications

    TC45 TC45 JAVA User's Guide Confidential / Released 3.5 Special AT command set for Java applications For the full AT command set refer to [4]. There are differences in the behaviour of issuing AT commands from a Java application compared to using AT commands over a serial interface.
  • Page 20: Restrictions

    TC45 TC45 JAVA User's Guide Confidential / Released 3.6 Restrictions 3.6.1 Flash file system The maximum length of a complete path name, including the path and the filename, is limited by the Flash file system on the module to 124 characters.
  • Page 21: Pin-Io

    The reference loop has the same structure as the measurement loop except the measurement sequence is moved. State jPS-Value (mean) TC45 module in IDLE mode / Not connected ~750 jPS CSD connection ~450 jPS These mean values may be sporadically reduced depending on dynamic conditions.
  • Page 22: Software Platform

    4.1 Software architecture The SMTK enables a customer to develop a Java application on a PC and have it be executable on the TC45 module. The application is loaded onto the module. The SMTK comprises: · A virtual machine: the Java™ 2 Micro Edition (J2ME™) The J2ME™...
  • Page 23: Interfaces

    4.2.4 Digital Audio Interface (DAI) To support the DAI function, the TC45 has a five-line serial interface with one input data clock line and input/output data and frame lines. These five pins can also be configured as general purpose I/O when not used as DAI. Refer to AT Command Set [4] and Hardware Interface Description document [5] for more information.
  • Page 24: Jvm Interfaces

    MIDP prepared by Siemens and does not include the graphical interface LCDUI. Siemens developed the File I/O API and the AT command API. TC45 also provides an RS-232 interface related to the RS-232 API of MIDP2.0. Documentation for J2ME and CLDC can be found at http://java.sun.com/j2me/.
  • Page 25: Data Flow Of A Java Application Running On The Module

    TC45 TC45 JAVA User's Guide Confidential / Released 4.3 Data flow of a Java application running on the module AT Parser system.out ASC0 Flash File System AT Command File I/O API RS232 API IMP 1.0 TCP/IP GPIO GPIO ASC1 Figure 4: Data flow of a Java application running on the module.
  • Page 26: Handling Interfaces And Data Service Resources

    TC45 TC45 JAVA User's Guide Confidential / Released 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 three AT parsers available, one parser with CSD and two without.
  • Page 27: State 1: Default - No Java Application Is Running

    TC45 TC45 JAVA User's Guide Confidential / Released 4.4.1.1 State 1: default – no Java application is running This is the default state. The Java application is inactive and there is an AT interface with CSD on ASC0. One serial interface is available for AT commands; nothing else is configured.
  • Page 28: State 5: Java Application Active, General Purpose I/O

    TC45 TC45 JAVA User's Guide Confidential / Released 4.4.1.5 State 5: Java application active, general purpose I/O The Java application is active, ASC0 is used as System.out and the four I/O pins are configured as general purpose I/O. The Java application is activated with at^sjra. The I/O pins are configured by at^scpin.
  • Page 29: Module State Transitions

    TC45 TC45 JAVA User's Guide Confidential / Released 4.4.2 Module state transitions switch on no Java autostart Java autostart start java: at^sjra State 1: Default, no Java State 4: Default, destroy java application appl. running Java active close GPIO close GPIO...
  • Page 30: Table 1: Java At Commands

    TC45 TC45 JAVA User's Guide Confidential / Released Table 1: Java AT commands Voice calls Data calls GPRS Phonebook incoming incoming incoming connection management commands outgoing outgoing outgoing Java AT command API with CSD Java AT command API without CSD...
  • Page 31: Midlets

    TC45 TC45 JAVA User's Guide Confidential / Released 5 MIDlets The J2ME™ Mobile Information Device Profile (MIDP) provides a targeted Java API for writing wireless applications. The MIDP runs on top of the Connected Limited Device Configuration (CLDC), which in turn, runs on top of the J2ME™. MIDP applications are referred to as MIDlets.
  • Page 32: Hello World Midlet

    TC45 TC45 JAVA User's Guide Confidential / Released Table 2: A typical sequence of MIDlet execution is: Application Management Software MIDlet The application management software creates a new instance of a default argument) MIDlet MIDlet constructor for the called; it is in the Paused state.
  • Page 33 TC45 TC45 JAVA User's Guide Confidential / Released * destroyApp() public void destroyApp(boolean cond) { System.out.println("HelloWorld: destroyApp(" + cond + ")"); TC45_JAVA User's Guide_V02 Page 33 of 72 30.06.2003...
  • Page 34: At Java Open Framework (Ajof)

    6 AT Java Open Framework (AJOF) 6.1 AT Commands The TC45 AT Command Set [4] contains all of the standard AT commands needed to ope- rate a GSM/GPRS mobile. Please note that no fax commands are supported when the TC45 is operated in the Java environment.
  • Page 35: Phonebook Features

    TC45 TC45 JAVA User's Guide Confidential / Released 6.1.5 Phonebook features The phonebook methods provide access to the phonebook storage media. This class provides methods to select a storage medium, list the stored entries, write into, browse through, read or delete from a storage medium.
  • Page 36: File Transfer To Module

    TC45 TC45 JAVA User's Guide Confidential / Released 7 File transfer to module 7.1 Module Exchange Suite The Module Exchange Suite allows you to view the Flash file system on the module as a directory from Windows Explorer. Make sure that the module is turned on and that ASC0 of the module is connected to the configured comport of Module Exchange Suite.
  • Page 37: Module Exchange Suite

    TC45 TC45 JAVA User's Guide Confidential / Released 7.3.1 Module Exchange Suite The serial interface should be mechanically protected. 7.3.2 OTAP · A password should be used to update with OTA (SMS Authentication) · Parameters should be set to fixed values (at^sjotap) whenever possible so that they cannot be changed over the air.
  • Page 38: Over The Air Provisioning (Otap)

    8.2 OTAP overview To use OTAP, the developer needs, apart from the device fitted with the TC45 module, an http server, which is reachable through a TCP/IP connection either over GPRS or CSD, and a SMS sender, which can send Class1, PID $7d short messages. This is the PID reserved for module’s data download.
  • Page 39: Otap Parameters

    TC45 TC45 JAVA User's Guide Confidential / Released 8.3 OTAP Parameters There is a set of parameters that control the OTAP procedures. These parameters can either be set by AT command (at^sjotap, refer to AT Command Set [7]) presumably during the production of the device, or by SM (see Section 8.4) during operation of the device in the...
  • Page 40: Short Message Format

    TC45 TC45 JAVA User's Guide Confidential / Released 8.4 Short message format An OTAP control SM must be a Submit PDU with Class1, PID $7d and 8 bit encoding. As a fallback for unusual network infrastructures the SM can also be of Class0 and/or PID $00.
  • Page 41: Java File Format

    SMs. 8.5 Java file format In general, all Java files have to comply with the IMP 1.0 and TC45 specifications. There are certain components of the JAD file that the developer must pay attention to when using OTAP: ·...
  • Page 42: Procedures

    TC45 TC45 JAVA User's Guide Confidential / Released 8.6 Procedures 8.6.1 Install/Update OTAP Java Application TC45 Controller Server Parameter SMS -SMS password check -Parameters collection Parameter SMS with "START:install" - Combination of SMS parameter set and AT parameter set - If parameter set complete:...
  • Page 43: Delete

    TC45 TC45 JAVA User's Guide Confidential / Released 8.6.2 Delete OTAP Java Application TC45 Controller Server Parameter SMS -SMS password check -Parameters collection Parameter SMS with "START:delete" - Combination of SMS parameter set and AT parameter set - If parameter set complete:...
  • Page 44: Time Out Values And Result Codes

    TC45 TC45 JAVA User's Guide Confidential / Released 8.7 Time out values and result codes Timeouts: · Closedown Timeout: 10 seconds · Safety Timeout: 5 minutes Result Codes: Supported status codes in body of the http POST request: · 900 Success ·...
  • Page 45: How To

    TC45 TC45 JAVA User's Guide Confidential / Released 8.9 How to This chapter is supposed to be a step-by-step guideline 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? The reason might be that your device is in the field and you cannot or do not want to do it over the serial line.
  • Page 46: Compiling And Running A Program Without A Java Ide

    Section 7.1, only the JAR file is needed. The JAD file is additionally necessary for OTA provisioning. OTA provisioning is described in Chapter 8. Note: The path to your installed SIEMENS\SMTK\TC45\IMPSiemens\lib\classes.zip is needed to build a JAR file. 9.1.1 JAD file In addition to class and resource files, a JAR file contains a manifest file, which describes the contents of the JAR.
  • Page 47: Compile And Run On A Pc

    The batch files for compiling and running the samples are using the system environment variables IMP_JDK_DIR that points to the root directory of the installed JDK and IMP_DIR which points to the root directory of the Siemens-SMTK-TC45-IMP installation. The installation process sets these environment variables. A modification is usually not necessary.
  • Page 48: Switch On Autostart

    TC45 TC45 JAVA User's Guide Confidential / Released 9.4.1 Switch on Autostart · There is an AT command, at^scfg, to configure the autostart functionality. Please refer to the AT Command Set [4]. · Restart the module. 9.4.2 Switch off Autostart To switch off autostart functionality there are two possibilities: ·...
  • Page 49: Debug Environment

    TC45 TC45 JAVA User's Guide Confidential / Released 10 Debug environment Please note that this section is not intended as a tutorial in debugging or how to use Sun ONE Studio or Borland JBuilder. Documents for these IDEs can be found on their respective homepages.
  • Page 50: Serial Port And Pin I/O Handling Differences

    PC emulator. JAR files used in the module must be configured according to the batch file examples given. If the SMTK install succeeded, one should be able to easily switch between the Siemens environment and Standard-JDK environment. Means that the special libraries/APIs are available, the emulators are available, AT commands sent to module.
  • Page 51: Sun One Studio 4.1 Mobile Edition

    TC45 TC45 JAVA User's Guide Confidential / Released 10.2.1 Sun ONE Studio 4.1 Mobile Edition This section indicates the changes to your IDE that you will see after the integration of the SMTK and how to exploit these features to build and debug your applications.
  • Page 52: Switching Emulators

    10.2.1.1 Switching emulators You can easily switch to the SMTK emulator by opening the Tools menu, selecting Siemens TC45 and choosing Switch Emulator-->Siemens IMP Wireless Toolkit 1.0, see Figure 3. The default emulator can be switched back to by choosing Switch Emulator->J2ME Wireless Toolkit.
  • Page 53: Projects

    After integration, there are two new projects in the Project Manager. The first is a sample HelloWorld project and the second is an empty project that the developer can begin using or use as a model for a new TC45 project. The Project Manager is accessed through the Project menu.
  • Page 54: Templates

    10.2.1.3 Templates Templates for a Siemens MIDlet and Java Class can be found in the file explorer and under File->New. The MIDlet template provides the skeleton of a MIDlet application. The Class template can be used to write a class for a Siemens MIDlet application for the TC45.
  • Page 55: Integration Of Tc45 Smtk

    TC45 TC45 JAVA User's Guide Confidential / Released 10.2.2.1.1 Integration of TC45 SMTK After integration of TC45 SMTK into JBuilder Personal Edition user must configure the JDK being used according to following steps: 1. Start Jbuilder Personal Edition 2. Open dialog box ToolsàConfigure JDKs: (see Figure) 3.
  • Page 56: Figure 21: Dialog Box After Changing The Jdk To Siemens Imp Wireless Toolkit

    TC45 TC45 JAVA User's Guide Confidential / Released Figure 21: Dialog box after changing the JDK to Siemens IMP Wireless Toolkit. After closing dialog box the Siemens IMP Wireless Toolkit will be used by JBuilder Personal Edition as system wide configuration. TC45_JAVA User's Guide_V02 Page 56 of 72 30.06.2003...
  • Page 57: Restoring Original Settings

    TC45 TC45 JAVA User's Guide Confidential / Released 10.2.2.1.2 Restoring original settings For user’s convenience the original settings of JBuilder Personal Edition at initial start up is shown below. Figure 22: Original setting for User Home To switch back to JDK shipped with JBuilder press Change and select location as shown in figure above.
  • Page 58: Tc45 Smtk In Enterprise Edition

    10.2.2.2 TC45 SMTK in Enterprise Edition The Siemens emulator is installed as a second emulator in JBuilder. Similarly to the Sun ONE Studio integration, the default emulator of JBuilder is untouched. The Siemens emulator settings can be examined by opening Tools->Configure JDKs…...
  • Page 59: Examples

    10.2.2.3 Examples There are sample projects provided with the SMTK. These projects can be found in the JBuilderSamples directory of the Siemens-TC45-SMTK installation directory. This directory is accessed by opening a project, File->Open Project. Figure 25: JBuilder - Sample Projects...
  • Page 60: Projects And Templates

    TC45 TC45 JAVA User's Guide Confidential / Released 10.2.2.4 Projects and templates To create a new project select File->New Project… The New Project Wizard will be launched. An existing project can be used as a template for new project. This means that the initial default values for the new project will be the same as the project chosen as the template.
  • Page 61: Compile And Run

    TC45 TC45 JAVA User's Guide Confidential / Released You can examine a project’s properties by choosing Project Properties from the Project menu. Figure 27: JBuilder - Project Properties 10.2.2.5 Compile and run Ensure that the proper emulator will be used and compile the project as normal. Any output will be shown in the output window in the IDE.
  • Page 62: Java Tutorial

    TC45 TC45 JAVA User's Guide Confidential / Released 11 Java Tutorial This small tutorial includes explanations on how to use the AT Command API, suggestions for programming MIDlets and an example of using AJOF. The developer should read about MIDlets, Threads and AT commands as a complement to this tutorial.
  • Page 63: Sending An At Command To The Device, The Send() Method

    TC45 TC45 JAVA User's Guide Confidential / Released 11.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 64: Synchronization

    (rcv >= 0) { System.out.print((char)rcv); /* The example continues after the next block of text */ In …/Siemens/SMTK/TC45/IMPSiemens/src/examples 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 65: Atcommandresponselistener Interface

    TC45 TC45 JAVA User's Guide Confidential / Released 11.1.2 ATCommandResponseListener interface The ATCommandResponseListener interface defines the capabilities for receiving the response to an AT command sent to one of the module's AT parsers. When the user wants to use the non blocking version of the ATCommand.send function an implementation class for the ATCommandResponseListener interface must be created first.
  • Page 66: Atevents

    TC45 TC45 JAVA User's Guide Confidential / Released 11.1.3.1 ATEvents An ATEvent or a URC is a report message sent from the module to the application. An unsolicited result code can either be delivered automatically when an event occurs or as a result of a query the module received before.
  • Page 67: Registering A Listener With An Atcommand Instance

    TC45 TC45 JAVA User's Guide Confidential / Released 11.1.3.3 Registering a listener with an ATCommand instance After creating an instance of the ATCommandListener class, this class instance has to be passed as a parameter to the ATCommand.addListener() method. After that, the callback methods will be called by the runtime system each time the corresponding events (URCs or signal state changes) occur on the corresponding device AT parser.
  • Page 68: Programming The Midlet

    TC45 TC45 JAVA User's Guide Confidential / Released 11.2 Programming the MIDlet The life cycle and structure of MIDlets are described in Chapter 5. 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 69 TC45 TC45 JAVA User's Guide Confidential / Released System.out.println("Thread(" + loops + "): Loop " + i); 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");...
  • Page 70: Ajof

    11.3.1 Example /* WmTutorial.java * Copyright (C) Siemens AG 2003. All Rights reserved. * Transmittal, reproduction and/or dissemination of this document * as well as utilization of its contents and communication thereof * to others without express authorization are prohibited.
  • Page 71: Tc45_Java User's Guide_V02

    TC45 TC45 JAVA User's Guide Confidential / Released * <li>last, but not least send the SMS message. * <li>Please do not forget to cleanup all used resources. Each AJOF class has * a method <code>release()</code>, which performs this task. * <li>Terminate the application by calling <code>notifyDestroyed()</code>.</ol>...
  • Page 72 TC45 TC45 JAVA User's Guide Confidential / Released catch (PhonebookStoreException e) System.out.println(e); finally // release the used resources pbk.release(); pbk = null; catch (WmLockException e) System.out.println(e); finally // release the used resources lockControl.release(); lockControl = null; catch (ATCommandFailedException e) System.out.println(e);...