BlueTools SDK User Guide

Transcription

BlueTools SDK User Guide
BlueTools SDK User Guide
Document Version: 1.3.8
Document Date: 2012-07-13
BlueTools Version: 2.4.2 (or higher)
BlueTools SDK User Guide
Table of Contents
1 Overview ............................................................................................................................................ 5 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 What’s BlueTools SDK ................................................................................. 5 Environment ............................................................................................. 5 Concepts .................................................................................................. 6 STIPlet project .......................................................................................... 6 Profile ...................................................................................................... 6 Product .................................................................................................... 6 Device ..................................................................................................... 6 Device Simulator ....................................................................................... 7 STIP Simulator .......................................................................................... 7 2 Getting Started .................................................................................................................................. 8 2.1 Installation ............................................................................................... 8 2.1.1 Installation from native installation package .................................................. 8 2.1.2 Installation from remote site / archive site .................................................. 10 2.2 Create STIPlet Project .............................................................................. 12 2.2.1 Create STIPlet project from scratch ............................................................ 12 2.2.2 New Sample STIPlet Project ...................................................................... 15 2.3 Deploy STIPlet ........................................................................................ 17 2.3.1 Packaging ............................................................................................... 17 2.3.1.1 Add external binary files ............................................................... 18 2.3.1.2 Option tabs .............................................................................. 18 2.3.2 Packaging (Advanced) .............................................................................. 21 2.3.2.1 Manage Build Profiles .................................................................. 21 2.3.2.2 Configure Build Profile ................................................................. 22 2.3.2.3 General Options ........................................................................ 22 2.3.2.4 Add external binary files ............................................................... 23 2.3.2.5 Obfuscation rules ....................................................................... 24 2.3.2.6 Signature ................................................................................ 24 2.3.2.7 Conditional Compilation ............................................................... 25 2.3.3 Download to terminal ............................................................................... 25 2.4 Run/Debug STIPlet .................................................................................. 26 2.4.1 Quick launch ........................................................................................... 26 2.4.2 Manual Launch ........................................................................................ 27 2.4.3 Launch a Deployed STIPlet JAR .................................................................. 28 3 Features ........................................................................................................................................... 30 3.1 Source Editing ......................................................................................... 30 3.1.1 Description Editor .................................................................................... 30 3.1.1.1 Overview ................................................................................. 30 3.1.1.2 Header Tab .............................................................................. 31 3.1.2 STIPML Editor ......................................................................................... 31 3.1.2.1 Content Assist ........................................................................... 32 2
BlueTools SDK User Guide
3.2 3.2.1 3.2.2 3.2.3 3.2.4 3.3 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.4 3.4.1 3.4.2 3.5 3.5.1 3.5.2 3.5.3 3.5.4 3.6 3.6.1 3.1.2.2 Quick Assist .............................................................................
3.1.2.3 Toggle entity reference mark occurrences ..........................................
3.1.2.4 Code folding .............................................................................
3.1.2.5 Content outline & quick outline .......................................................
3.1.2.6 Text Hover ...............................................................................
3.1.2.7 Rename in file ...........................................................................
3.1.2.8 Go to entity declaration ................................................................
Validation ...............................................................................................
Example Usage........................................................................................
Create stipml mapping .............................................................................
Create java constant class ........................................................................
Refactoring support ..................................................................................
Security .................................................................................................
Terminal Security .....................................................................................
Firmware ................................................................................................
3.3.2.1 How to install Firmware to a Signed/PCI Certified terminal ......................
3.3.2.2 How to switch a Signed terminal to a PCI certified terminal and use it .........
STIPlet ...................................................................................................
3.3.3.1 Developer signed STIPlets ............................................................
3.3.3.2 Certificate Authority signed STIPlets .................................................
How to get a developer certificate ..............................................................
3.3.4.1 Configure the Keystore in SDK .......................................................
3.3.4.2 Generate a Certificate Request.......................................................
3.3.4.3 Install the Certificate to SDK ..........................................................
Use the SDK to sign the STIPlet .................................................................
Load and Install a signed STIPlet ...............................................................
Simulator ...............................................................................................
Configuration ..........................................................................................
3.4.1.1 H50 .......................................................................................
3.4.1.2 H50 Advantage..........................................................................
3.4.1.3 CT100 ....................................................................................
3.4.1.4 CT100 w/o Keypad .....................................................................
3.4.1.5 D100 (China Product Only) ...........................................................
How to Use Simulators .............................................................................
3.4.2.1 Modem Simulator .......................................................................
Preferences.............................................................................................
Overview ................................................................................................
Profile & Product ......................................................................................
3.5.2.1 Device ....................................................................................
3.5.2.2 STIP Logger .............................................................................
Compiler ................................................................................................
Errors/Warnings ......................................................................................
Tools ......................................................................................................
Dump JEFF .............................................................................................
3
35 36 36 37 37 38 38 38 40 41 43 44 45 45 45 45 45 46 46 46 47 47 49 51 52 52 53 53 53 64 73 73 73 82 82 85 85 87 88 88 90 91 92 92 BlueTools SDK User Guide
3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 4 Sign JEFF ...............................................................................................
Verify Signed JEFF ...................................................................................
File System Explorer ................................................................................
Test Assistant ..........................................................................................
Image Editor ...........................................................................................
Convert to STIPlet Suite ...........................................................................
Synchronous programming .......................................................................
93 94 94 94 97 98 98 Revision History............................................................................................................................ 101 4
BlueTools SDK User Guide
1 Overview
1.1 What’s BlueTools SDK
The BlueTools™ SDK provides a set of integrated Java development tools crafted specifically for
products which are compatible for STIP. With the BlueTools™ SDK, developers can minimize their efforts
to produce high-quality GlobalPlatform Device (GPD) / Small Terminal Interoperability Platform (STIP)
applications.
1.2 Environment
OS Platform
Win32 (Windows 2000/XP/WIN7)
Java Platform
Java SE 6 (32 bit) or above
Eclipse Platform
Eclipse Classic 3.5 (32 bit) or above
I/0 Interface
RS232 or USB RS232 adaptor
Note: There is news in eclipse community tells that breakpoints fail to hit under JDK 1.6_14,
the workaround is going back to 1.6_13.
Good news for this issuer, Sun released a special JDK ( 1.6.0_16) version to fix only one single bug.
Eclipse developers know it as a Bug 279137: Breakpoints fail to hit under JDK 1.6.0_14.
Below are the hardware and system environment settings required by some Service Controls.
Note: Each item shown in the table is required only if using the corresponding Service Control.
Socket and Datagram Network is required.
Socket Service
Control
Smart Card Service A generic smart card reader supported by the OpenCard Framework is
Control
required.
A Gemplus USB Smart Card Reader is recommended.
The “Smart Card” service of windows should be started.
For more information, see the “OpenCardconfig.pdf” in “BlueTools\docs”
sub-directory where the SDK is installed.
Modem Service
Control
A generic external modem.
MSR Service Control
A USB MSR Reader.
5
BlueTools SDK User Guide
1.3 Concepts
1.3.1 STIPlet project
A STIPlet project contains source code and related files for building a STIPlet. It has several
associated builders that:
y
y
Incrementally compile Java source files as they are changed.
Convert *.STIPML file to *.STMLBF file.
A common STIPlet project structure:
1.3.2 Profile
The version of the STIP specification being implemented, for example:
Profile 2.1 for EFT-POS implements STIP 2.1 Specifications,
It also defines the APIs that STIPlet can use. General it includes two parts of APIs:
y
STIP Selected Java Core API
y
STIP Core Framework API
1.3.3 Product
The container is composed of several device simulators, e.g. H50 is equipped with Keypad, LCD, and
Printer etc.
1.3.4 Device
External devices are such as Keypad, LCD, Printer, Modem, Serial Port, Smart Card, etc.
6
BlueTools SDK User Guide
1.3.5 Device Simulator
Simulator implementations allow the device to run on PCs, e.g. Keypad simulator, LCD simulator,
Printer simulator etc.
There could be several simulators implementing the same device.
See also: Simulators of H50
1.3.6 STIP Simulator
The STIP Simulator is an application that simulates the terminal on PC for development purpose, e.g. it
can load STIPlet jar files and runs it on the PC.
7
BlueTools SDK User Guide
2 Getting Started
2.1 Installation
2.1.1 Installation from native installation package
1.
Close your eclipse first before installation
2.
Select installation language
8
BlueTools SDK User Guide
3.
Select the location where the eclipse instance will be copied to
4.
Select the location where BlueTools plug-ins will be copied to
9
BlueTools SDK User Guide
5.
Installation process
2.1.2 Installation from remote site / archive site
BlueTools can be simply installed within Eclipse using the update manager. The user simply needs to
direct the update manager to a remote or local update site. To install BlueTools:
1.
2.
3.
4.
Start Eclipse and select Help -> Software Updates -> Find and Install...
In the Install/Update wizard select Search for new features to install option and click on the Next
button.
The 'Install' dialog shows a list of available update sites. BlueTools has its own update site, so you
need to add it to the list. You are provided a possibility to install either from a remote or local
update site. Installation from a remote update site is preferred, because the user just has to refer
the site URL. If the user has downloaded a local update site distribution as a ZIP archive, he or
she should refer to it as the local update site location.
To install from a remote site, Click on the 'New Remote Site...' button to add BlueTools online
update site: ftp://STIP:[email protected]/SDKNEWVERSION/update-site/site.xml
To install from a local site, Click on the 'New Local Site...' button to add BlueTools local site by
browsing your local directory, e.g. c:\BlueTools-2.0.0-I20080121-1607.
To install from an archive site, Click on the 'New Archived Site...' button to add a BlueTools
archived site by browsing your local archive, e.g. c:\BlueTools-2.0.0-I20080121-1607.zip.
On the New Update Site dialog enter the name of the update site and its URL. Use following
values:
— Name: BlueTools
10
BlueTools SDK User Guide
— URL: your_file_url
Click on the OK button to store update site information.
5. To start features search in the list of the update sites the user should select 'BlueTools' and click
on the Finish button.
6. The Update manager checks the update site and shows the list of available features. You can
expand the tree and select features to install.
7. Accept the terms of license agreement and click on the Next button
8. Click on the Finish button in order to start downloading of the selected features
9. Click on the Install All button in order to confirm installation of downloaded features
10. After Eclipse restarts you are able to start using BlueTools. You can find BlueTools preferences by
going to: Window -> Preference... -> BlueTools
NOTE: since eclipse 3.4, eclipse use new update system called P2, which does not support the old zip
archive style, but fortunately, it still includes the “Classic Update”, it just hide the menu. You can turn it on
via “Window -> Preferences -> General -> Capabilities”, check the “Classic Update”.
11
BlueTools SDK User Guide
2.2 Create STIPlet Project
2.2.1 Create STIPlet project from scratch
In order to create a new STIPlet project, you can use the New Project Wizard and select STIPlet
Project from the BlueTools section.
The first wizard pane is the standard for almost all Eclipse projects. Here, you provide
•
•
•
•
•
The name of the project
The location for the project contents (optional)
The active profile (optional)
The active product (optional)
The working set (optional)
12
BlueTools SDK User Guide
The second pane helps the developer configure the header element in description.xml.
The items on this tab are:
Item
Contents
format version 2.1
STIP version
2.1
stiplet name
The executable stiplet name with full path.
stiplet version
description
uiResDirectory the directory contains *.stipml.
localization
This item is not used in the current version. We normally set it as “us-US”
13
BlueTools SDK User Guide
The final pane allows you to adjust source settings, related projects and libraries, etc. These are
standard Eclipse settings. If your project requires an external library, add the JAR file (s) to the list on the
"Libraries" tab. It will automatically manage these JAR files along with your compiled class files. Normally
you don't have to change anything on this page.
Once you have completed the above steps, you will have a project that looks like this in your
workspace:
14
BlueTools SDK User Guide
2.2.2 New Sample STIPlet Project
BlueTools includes several sample projects that provide a way to learn how to make STIPlets from
scratch.
The Sample STIPlet project wizard can be accessed via File -> New -> Project -> BlueTools ->
Sample STIPlet Project from the top level menu.
Select a sample below
Figure 2.2.2 Sample project wizard
15
BlueTools SDK User Guide
Figure 2.2.3 use wild char to filter by demo names
Demo
Description
CardDemo
Demonstrate how to read/write Credit card, Debit card, Gift card
DemoCHVControl
Simulate how to use CHVControl
DemoContactlessControl
Simulate how to use ContactlessControl, the demo only use InitiatorControl
DemoCryptoControl
Simulate how to use CryptoControl, the algorithm include RC4, DES, DESede, AES,
RSA, MD5, SHA1, SHA256, HMACSHA256.
DemoDatagramSocketControl Simulate how to use DatagramSocketControl
DemoFileControl
Simulate how to use FileControl, StorageControl that includes create file, browse
storage, and operate the file
DemoFontImage
Demonstrate how to use <u> in LCD, and <small>, <big> in print.
DemoHardwareControl
Simulate how to use HardwareControl
DemoHTTPControl
Simulate how to use HTTPControl, connect www.google.com
DemoModemControl
A sample to show how to use ModemControl
DemoSCSControl
Simulate how to use SCSControl
DemoSerial
A sample using serial port service. This sample requires RS232 or USB RS232
adaptor
DemoSocketControl
Simulate how to use SocketControl
STIPlibDemo
Demonstrate what a STIPlib project looks like
DemoSMS
Demonstrate sending SMS in STIPlet
STIPMLDemo
Demonstrate STIPML features
Table 1 current available demo
16
BlueTools SDK User Guide
2.3 Deploy STIPlet
2.3.1 Packaging
In order to deploy and run your STIPlet in the terminal, you should package the STIPlet in JEFF format.
Export as JEFF wizard can be accessed via BlueTools -> Export as JEFF by right clicking on the
STIPlet project.
Figure 2.4.1. Export JEFF wizard
17
BlueTools SDK User Guide
2.3.1.1 Add external binary files
The external binary files must be packaged, such as the image files (e.g., *.bbimg) used by the project.
And as default setting, the *.stmlbf files of the current STIPlet project will be added.
Figure 2.4.1.1 Add external binary files
2.3.1.2 Option tabs
1.
Destination
Check the format and set the destination accordingly.
Figure 2..4.1.2.1 set the destinations
Name specification:
y
y
y
y
General JEFF: stiplet + projectName + [_[qualifier]], by default, the qualifier is the STIPlet
version in description.xml
Obfuscated JEFF: general jeff name without extension + _obf.jeff, e.g.
stipletLearnSTIPlet1_1.0_obf.jeff
General Jar: general jeff name without extension + .jar, e.g. stipletLearnSTIPlet1_1.0.jar
Obfuscated Jar: general jeff name without extension + _obf.jar, e.g.
stipletLearnSTIPLet1_1.0_obf.jar
18
BlueTools SDK User Guide
Figure 2.4.1.2.2 the name specification example
2.
Options
Set the package options and the format options you need
Figure 2.4.1.2.3 set the package options and format options
Note: since BlueTools SDK 2.3.0 the “Format Options” will not be saved as operation history, these
default values (Byte Order, Major Version, Minor Version) are according to current active Product (e.g., H50
or H50 Advantage), you can change the default values in “Compiler” property/preference page.
19
BlueTools SDK User Guide
3.
Obfuscation
Set obfuscation options
Figure 2.4.1.2..4 Set obfuscation options
Here, in “PatterSet” you can specify a list of packages which you want the interfaces to be exposed
(not obfuscated), wild char (*) is supported.
4.
Signature
Sign the JEFF if needed, and set signature options here (it can be signed later as well)
Figure 2.4.1.2.5 set the signature options
ƒ
ƒ
ƒ
ƒ
ƒ
Sign the JEFF file: if this button is checked, the generated JEFF file is signed with the key
specified below.
KeyStore: the KeyStore that involves the key used to sign the JEFF file
Password: the password of the KeyStore
Alias: the key alias in the KeyStore
Entry Password: the key entry password
20
BlueTools SDK User Guide
2.3.2 Packaging (Advanced)
Since SDK 2.3.0, new JEFF tool was introduced to allow the batch building JEFF with Apache ANT.
You can define several Build Profiles, and run them all by a single click. The Build Profile defines the
JEFF attributes (e.g. JEFF name, byteOrder, obfuscation rules etc.), even more, you can make use of
Java Conditional Compilation (by declaring public static final variables) by turning on/off the variable in
Build Profile.
New Wizard can be accessed via BlueTools -> Export as JEFF (Advanced) by right clicking on the
STIPlet project.
2.3.2.1
Manage Build Profiles
By default, there’s a “standard” Build Profile, which builds a general JEFF file.
You can edit the Build Profile, or copy from existing one and edit it.
Figure 2.4.2.1.1 Export JEFF - Manage Build Profile
Since Export JEFF (Advanced) use Apache ANT, you can generate the ANT script for selected Build
Profile by clicking “Generate Script” button.
21
BlueTools SDK User Guide
2.3.2.2
Configure Build Profile
Select the Build Profile and click “Edit” button.
2.3.2.3
General Options
y
y
y
y
y
y
Destination: specify the location to store the generated files (JEFF, Obfuscated JEFF, or Jar)
File Name: the file name with no file extension, it can be composed of variables. By clicking
the Content Assist Hot Key (default as Ctrl+Space) in the file name field, you can get a list of
available variables. Note that, you need not add the prefix “stiplet” or “stiplib” since it is
added automatically.
Build JEFF: build general JEFF
Build Obfuscated JEFF: build obfuscated JEFF
Include dependent libraries: build JEFF and include the dependent libraries (typically stiplib)
into the JEFF
JEFF format Options: specify the Byte Order
22
BlueTools SDK User Guide
2.3.2.4
Add external binary files
Note that binaries under “ui” res (e.g. *.stmlbf, *.bbimg) will be added automatically while building, so
you DON’T need to specify them here.
23
BlueTools SDK User Guide
2.3.2.5
Obfuscation rules
2.3.2.6
Signature
24
BlueTools SDK User Guide
2.3.2.7
Conditional Compilation
If you come to Java from a C (or C++) background, you may, at time, miss preprocessors that help you
define compile-time constants (#define), and conditional compilation of code (e.g. #ifdef). Getting compiletime constants in Java is as easy as declaring a variable as public static final, like in:
public static final boolean TRUE_CONDITION = true;
In Build Profile, you can turn the conditional compilation variable flag on or off, for example, commonly,
you’ll turn the log off for a release building, and turn the log on for a debug building:
2.3.3 Download to terminal
Since we have the JEFF file, we can download it to and run it in the terminal.
The wizard is accessible via "BlueTools -> Deploy to Terminal" by right clicking on the JEFF file.
25
BlueTools SDK User Guide
2.4 Run/Debug STIPlet
2.4.1 Quick launch
Quick launch can be accessed via Run As -> STIPlet in Simulator by right clicking on your STIPlet
project or any Java source files.
26
BlueTools SDK User Guide
2.4.2 Manual Launch
You can manually create a Launch Configuration by selecting either the Open Run Dialog or Open
Debug Dialog item, clicking on STIPlet in Simulator in the left column and pressing the New button.
27
BlueTools SDK User Guide
2.4.3 Launch a Deployed STIPlet JAR
You can launch a STIPlet jar directly, rather than create, compile and run a new STIPlet project.
The STIPlet jar is usually located outside the current workspace.
The dummy launch wizard can be accessed via BlueTools -> STIPlet Launcher from to top level
menu.
28
BlueTools SDK User Guide
If current STIPlet locates on other STIPlibs, you can browse it in the “Classpath” tab
Note: This section explains how to run and debug a STIPlet on the simulator. If you want to run
the STIPlet on a H50/H50A or CT100 terminal, you need to load it to the terminal by using the
BB Device Manager first. (The Device Manger application can be loaded from SDK vendor )
29
BlueTools SDK User Guide
3 Features
3.1 Source Editing
3.1.1 Description Editor
3.1.1.1 Overview
BlueTools distributions contain a description.xml file in the path {PROJECT_PATH}/src/META-INF.
BlueTools has a built-in editor that handles the details of formatting the description.xml file for you. To use
the editor, select the description.xml file, right click and choose Open with -> STIPlet Description Editor.
30
BlueTools SDK User Guide
3.1.1.2 Header Tab
The first tab on the editor window is the Header tab.
3.1.2 STIPML Editor
The STIP Markup Language (STIPML) is an XML-based language used to define the user interface (UI)
portions of a STIP application. STIPML was created in order to satisfy the requirements of the STIP API
Specification [R1] in providing a language for the description of application content separate from
application code.
The STIPML Editor is the source editor for STIPML; it provides several features: Syntax Color, Content
Assist, Quick Assist, Code Folding, Text Hover, File renaming, etc.
31
BlueTools SDK User Guide
3.1.2.1 Content Assist
Use content assist to make programming easier by pressing Ctrl+Space (Content assist hot key)
1.
Content assist for referencing entities in attributes
2.
Content assist for Unicode (or symbols) in entity declarations
3.
Content assist for attribute values, e.g. list all values defined in stipml.dtd
32
BlueTools SDK User Guide
4.
Content assist for attributes, e.g. list all attribute for current element defined in stipml.dtd
33
BlueTools SDK User Guide
5.
Content assist for tags, e.g. list all sub element for current element defined in stipml.dtd
34
BlueTools SDK User Guide
6.
Content assist for tag closing
3.1.2.2 Quick Assist
Quick Assist is a feature that provides context-based assistance to the user.
They are invoked on selection of certain parts of the markup language, using the cursor in the Java
editor and use the same shortcut as quick fixes (Ctrl+1), but quick assist are usually hidden when an error
is around. (To show them even with errors, select the target before pressing Ctrl+1).
Figure quick assist demo
35
BlueTools SDK User Guide
3.1.2.3 Toggle entity reference mark occurrences
3.1.2.4 Code folding
36
BlueTools SDK User Guide
3.1.2.5 Content outline & quick outline
3.1.2.6 Text Hover
Hover your mouse on an entity reference, and an info box popup will show the entity value
Or if the entity is uses an inputFormat id or outputFormat id, the format pattern will be shown instead.
37
BlueTools SDK User Guide
3.1.2.7 Rename in file
To rename all entity references and the entity declaration names in the .stipml file, press Alt+Shift+R:
3.1.2.8 Go to entity declaration
Press F3 to go to where the entity was declared.
3.2 Validation
The new validation framework integrates the previous validations, and adds a few new validations. And
the user can now specify their Errors/Warnings level.
Previous validations included:
•
JDK compiler compliance level
•
Profile in .classpath does not match current Active Profile
•
Redundant stipmlbf file in src container
•
Profile does not exist
•
Product does not exist
•
Xml syntax error
•
Unexpected xml error
•
Invalid description field
New validations:
•
Entity declaration is never used in stipml
•
Stipml mapping does not exist
38
BlueTools SDK User Guide
•
Class mapping does not exist
•
Mapping field not found in java
•
Mapping entity not found in stipml
•
The Mapping field value does not match with the entity declaration value
•
STIPlet Java limitation: DO NOT define array object in Interface
•
STIPlet Java limitation: DO NOT add array object in to java.util.Vector, java.util.Stack, java.util.Hashtable
•
STIPlet Java limitation: DO NOT use float/double types in STIPlet
All the validations are organized by categories, see figure below:
39
BlueTools SDK User Guide
Validation results (Error and Warning) act as Eclipse Markers and will be displayed in the Annotation
Bar of editors or Project Navigation Viewer.
Figure error/warning markers on stipml editor left side vertical ruler
You can find all Markers in “Problems” Viewer (Window -> Show View -> Problems), see below:
Figure error/warning markers in Problems viewer
3.2.1 Example Usage
If we want to validate whether the field value defined in a constant java class matches with the entity
declaration value defined in the corresponding stipml file, or if you want to resolve the following problem:
Constant.java
public class Constant {
int pgMain = 1;
}
Main.stipml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE stipml SYSTEM "STIPML.dtd" [
<!ENTITY pgMain
"0">
]>
40
BlueTools SDK User Guide
Obviously, the two value does not match, 0 != 1. And validation framework helps you to check them out,
before you can use stipml validation, you need do some configuration first:
•
Create stipml mapping if the mapping does not exist
•
Create the mapping class if the constant java class does not exist
•
Map the class with stipml if you have one constant java class
3.2.2 Create stipml mapping
Why create a mapping first?
To do this validation, we need to let SDK know where the constant class that defines the fields is, and
where the stipml which defines the entities is. A mapping stores information on the relationship between
these two files, and is used to make sure both files match one another.
Open the Stipml Mapping property page by right clicking on the STIPlet project and going to:
Properties -> BlueTools -> Stipml Mapping
Figure 1.2.1 stipml mapping
41
BlueTools SDK User Guide
Figure 1.2.2 edit ignore list
y
y
Mapping Configuration rules
1) Select the stipml file you want to create a mapping for
2) Select the constant class which maps with the stipml by clicking the Browse… button.
Note: we recommend specifying different constant class for stipml files respectively.
3) Add mapping rules which defines how the stipml entity declaration maps with java field.
The default mapping rule is “Same name mapping rule”, which means, the stipml entity
declaration maps with java constants with the same name.
Note: you must specify at least one rule
(In future, we are considering adding a “Javadoc mapping rule”, which defines the relationship
in a Javadoc.)
4) Add a field mapping if the default “Same Name mapping rule” does not meet your needs, and
you wish to define a mapping manually,
Note: we recommend using the default “Same name mapping rule”.
Configure ignore list
There always are some entities declaration that you do not want checked, these can be placed in the
ignore list.
5) Select which error you want ignored my the mapping class
Currently there are two options you can choose:
a) Entity declaration is never used
For example, you want the SDK to skip checking for symbol entity declaration:
42
BlueTools SDK User Guide
<!ENTITY
euro “€”>
b)
6)
Mapping field not found in java
Generally, we don’t need to check the input/output format ids
Add/remove entity declarations from/to the ignore list.
3.2.3 Create java constant class
You can create a java constant class for a specified stipml if one does not exist.
1. Right click on the project and go to BlueTools ->Auto Generate Resource File…
2. To open the wizard, right click on the stipml file and go to BlueTools -> Create Mapping
Class...
Figure 1.3 create mapping class
If the option “Use static constant style” is checked, the generated java fields are in the form of:
public static final int pgMain = 1;
43
BlueTools SDK User Guide
3.2.4 Refactoring support
After setting up the mapping, you can do a java refactor from the java field to stipml entity and entity
references.
44
BlueTools SDK User Guide
3.3 Security
This section describes the security feature of the firmware and includes the instructions on how to sign the
STIPlet.
3.3.1 Terminal Security
Certificate Authority (SDK vendor) implements the STIPlet signing to verify the security of terminal. This
feature is implemented by two different schemes: signed terminal and PCI certified terminal.
1. Signed Terminal:
-This terminal must install the Signed firmware.
-The LCD will flash “Signed Device” after the terminal powers on.
- Only developer signed STIPlets are allowed to run on this type of terminal
- From the terminal shell admin menu a signed terminal CAN be converted to a PCI certified
terminal.
2. PCI Certified Terminal:
-This terminal must install PCI certified firmware
-The LCD will flash "PCI Certified" after the terminal powers on.
- Only Certificate Authority signed STIPlets are allowed to run on this type of terminal
-This terminal CAN NOT be converted to a Signed Terminal.
Note: The signature of a STIPlet application must match the type of the terminal it has been
installed to. If the terminal is a Signed Terminal, the STIPlet must be a developer signed STIPlet. If
the terminal is a PCI Certified Terminal, the STIPlet must be signed by Certificate Authority. If the
types do not match, the STIPlet will not work.
3.3.2 Firmware
Certificate Authority firmware is divided into two categories: Singed Firmware and PCI Certified firmware.
This coincides with the two categories of terminals Certificate Authority offers which are Signed Terminals
and PCI Certified terminals
3.3.2.1 How to install Firmware to a Signed/PCI Certified terminal
Please refer to the BB Device Manager User Guide for detailed information.
3.3.2.2 How to switch a Signed terminal to a PCI certified terminal and use it
1. Go to the Shell admin menu 1->14 Switch PCI and hit enter. (NOTE: This is irreversible!) The
terminal will be upgraded to a PCI certified terminal from this point on;
45
BlueTools SDK User Guide
2. Go to the firmware loader in the Device Manager and load a PCI firmware that can be found by
contacting SDK vendor at: http://www.bluebamboo.com/downloads/ticket.asp and requesting it. Follow
the steps listed in BB Device Manager User Guide to do so, but instead of using a “signed” firmware,
use “PCI” firmware;
3. Sign the STIPlet to be used on the terminal by following the steps listed in the section Use the SDK to
sign the STIPlet
4. Send the signed STIPlet (it should have “signed” in its name) to [email protected] to get a
Certificate Authority signed version of the STIPlet.
5. Go to the Device Manager and download the Certificate Authority signed version of the STIPlet.
6. Restart the terminal to install the STIPlet.
3.3.3 STIPlet
STIPlet also has two versions: developer signed version or Certificate Authority signed version to coincide
with Signed terminal or PCI certified terminal.
3.3.3.1 Developer signed STIPlets
Starting from firmware version 1.2.0 all STIPlets running on a security terminal will be required to have a
digital signature. In the case of developers signed STIPlet, the developers need to generate the digital
signature after the STIPlet is compiled using the signing tools included in the SDK. This ensures that only
registered developers are deploying STIPlets on security terminals. It also provides the ability to track
STIPlets back to their creators if necessary.
In order to sign a STIPlet, developers will have to request a security certificate from Certificate Authority
(see “How to get a developer certificate”). Requesting a certificate is a one-time process for each running
Blue Tools instance. After that, developers are able to sign their own STIPlet without requiring Certificate
Authority’s involvement.
3.3.3.2 Certificate Authority signed STIPlets
Certificate Authority offers PCI Certified terminal as an additional layer of security. This type of terminal will
only run software bearing Certificate Authority’s digital signature.
In this case the developer needs to submit their STIPlet(s) to Certificate Authority’s security team for check
and signing.
Certificate Authority’s security team reviews the submitted STIPlet looking for patterns which could
potentially compromise the security of the terminal and sensitive data. If the STIPlet is checked by the
security team, it will be signed and sent back to the developer.
46
BlueTools SDK User Guide
3.3.4 How to get a developer certificate
3.3.4.1 Configure the Keystore in SDK
Please make sure you have already installed Blue Tools SDK on your computer. You can download the
Blue Tools SDK from this site: http://www.bluebamboo.com/downloads/index.asp
1. If no keystore has been created before, open the Blue Tools SDK, and go to Window -> Preferences ->
Blue Tools - > Security. Click “Add”
2. Select JKS or USB for the type, then enter a name, and click “Next->” Enter a name for the keystore in
the blank input box that appears (it looks like you need to open a JKS, but by entering a new name one can
be created as well), and hit “open.” Hit “finish.” Note: Typical users will use a JKS keystore, the USB
keystore is, as the name suggests, on a USB token.
47
BlueTools SDK User Guide
48
BlueTools SDK User Guide
3.3.4.2 Generate a Certificate Request
1. Select the JKS/USB you just created in the list on the Security page, and click “Open” or double click
JKS/USB name.
2. Click “Generate Key” and then “OK.” Fill in the “Generate Certificate” page with your company’s
information and hit ok. Enter an alias for the keystore, as well as a password for it.
49
BlueTools SDK User Guide
Note: Do not enter special characters such as ‘-‘ in the fields, otherwise the certificate will be invalid.
(This issue has been solved since version 2.2.1, please go to SDK vendor support site to get the
latest version of SDK)
3. Select the key from the list on the KeyStore page, and click “Generate CSR” from the right. Enter your
password, and the CSR will be generated.
4. Send an e-mail to [email protected] with a copy of this CSR to get it approved. This may
take 1 working day.
50
BlueTools SDK User Guide
3.3.4.3 Install the Certificate to SDK
1. After receiving the CSR Reply, go to the KeyStore page, select your key, and click “Import CSR Reply.”
Click “Add” and then click on the certificate sent to you by Certificate Authority to import it.
51
BlueTools SDK User Guide
3.3.5 Use the SDK to sign the STIPlet
Go to BlueTools->Sign JEFF (The .jeff file is the STIPlet being signed)
3.3.6 Load and Install a signed STIPlet
Note: Loading and installing are separate processes, a STIPlet must first be loaded to the terminal
using the Device manager, and then installed using the Shell Menu of the terminal after being
loaded.
1. If there are any unsigned STIPlets on the terminal, open the Application loader of the Device Manager, ,
click the check box next to the loaded, unsigned STIPlets, and click UnLoad. Note: Verifying the STIPlet
will fail if this has not been done.
2. Go to the application loader page and click Add to browse your computer for the signed STIPlet you wish
to put on the terminal. Then click load to load this application.
3. Go to the shell admin menu of the terminal (default password 1234) and go to the STIPlets screen (#2).
From this screen, select Install STIPlets (#2) and hit enter to install the STIPlets you loaded to the terminal
in the previous section, “Use the SDK to sign the STIPlet”.
52
BlueTools SDK User Guide
3.4 Simulator
3.4.1 Configuration
The simulator settings can be modified by right clicking on the STIPlet project name and going to
“BlueTools -> Profile & Product” and clicking on “Enable Project Specific Settings”, otherwise you use
the default global settings.
Since SDK 2.3.0, three new Products were introduced, “H50 Advantage”, “CT100”, “CT100 w/o Keypad”,
and their associated simulator as well. The following chapters will introduce these Products and their
associated simulators respectively. As some simulators are same for these Products, duplicate descriptions
are bypassed.
3.4.1.1 H50
3.4.1.1.1 Overview
Device
Simulator
Browser
CHV
Browser Simulator
CHV Simulator
Contactless Scripter
Simulator
Transparent
Contactless Agent
PN512 Agent
Beijing
Transport
Card Agent
Modem Simulator
Modem Agent
MSR Simulator
Power Simulator
Printer Simulator
Serial Simulator
Serial Agent
Serial
Socket
Simulator
SmartCard Agent
SmartCard Scripter
Simulator
Socket Agent
Contactless
Modem
MSR
Power
Printer
Serial
SmartCard
Socket
Descriptions
Simulate LCD and Keypad and implemented with pure Java
Simulate CHV implemented with pure Java by Bouncy Castle
(Recommended)
Transfers data on the serial port without packing data into protocols
53
BlueTools SDK User Guide
3.4.1.1.2
y
Browser
Browser Simulator
Configure the STIP Simulator UI presentation
3.4.1.1.3 CHV
y
CHV simulator
Fixed Key Settings
54
BlueTools SDK User Guide
Master and Session Key settings
DUKPT Key settings
55
BlueTools SDK User Guide
Option
Description
Arithmetic
Available encryption methods are “DES” and “DES3’ for fixed key and master &
session key, or X9.24(Triple DES DUKPT) X9.8 (DES DUKPT) for DUKPT key
PIN Count
The number of encryptions that have occurred since the PIN pad was first initialized.
Init KSN
Initialization KSN for DUKPT encryption.
Init Key
Initialization key for DUKPT encryption.
Current count Number of times the PIN Pad has been used.
Import/Export Keys
56
BlueTools SDK User Guide
Export CHV Key Wizard
The exported binary key files can be used in “Key Loader” of H50 Device Manager.
Note that there’s no encryption for the exported binary key files.
Import CHV Key Wizard
57
BlueTools SDK User Guide
3.4.1.1.4 Contactless
SDK involves several Contactless simulators as below:
y
Contactless PN512 Agent (PN512 is one type of contactless module which SDK vendor
provides )
This simulator transfers data on the serial port, and the data is packed as PN512 protocol
y
Transparent Contactless Agent
This simulator transfers data on the serial port without packing data as any protocols
y
Contactless Scripter Simulator
User can define the data process scripter which follows the syntax of Apache Jelly.
58
BlueTools SDK User Guide
y
Beijing Transport Card Agent
This simulator transfers data via the serial port, and the data is encoded as Beijing Transport Card
protocols
3.4.1.1.5 Modem
There are two Modem Simulators as below:
y
Modem Simulator
This simulator acts like an echo server that receives the client request and sends back the
responding data automatically which has been pre-configured.
Figure below shows that the plain data “31 32 33 34 35 36 37 38 39” will be returned in 1000ms
after the simulator receives the request.
59
BlueTools SDK User Guide
y
Modem Device Agent
This simulator needs to connect with the physical device, and send commands via the connection.
60
BlueTools SDK User Guide
3.4.1.1.6 MSR
y
MSR simulator
y
y
y
MSR Cards: MSR cards that are in the configuration file are listed here.
Track: Track information for the selected MSR
To add a new MSR, input the MSR name in the text field next to “MSR Cards” and input the
tracking information to the Track panel.
3.4.1.1.7 Power
y
Power Simulator
61
BlueTools SDK User Guide
3.4.1.1.8 Printer
y
Printer Simulator
Columns: The maximum number of characters for one line to print
3.4.1.1.9 Serial
There are three Serial Simulators as below:
y
Serial Simulator
This simulator will send back pre-configured responding data within delay time specified by user.
y
Serial Agent
This simulator needs to connect the actual serial port on your PC, and transfers data via this
connection.
62
BlueTools SDK User Guide
y
Serial Socket Simulator
If you don not have serial devices or cables, and you have a socket server for test (e.g., Socket
Test on SourceForge), this simulator is right for you. It simulates the serial control API by transferring data
via socket.
3.4.1.1.10 SmartCard
y
SmartCard Simulator
y
SmartCard Scripter Simulator
63
BlueTools SDK User Guide
3.4.1.1.11 Socket
y
Socket Simulator
Figure below shows the SSL setting for socket connection.
3.4.1.2 H50 Advantage
3.4.1.2.1 Overview
Device
Simulator
Browser
CHV
Browser Simulator
CHV Simulator
Contactless Scripter
Simulator
Contactless
Native
Simulator
Modem Simulator
Modem
Native
Simulator
MSR Simulator
Power Simulator
Printer Simulator
Serial
Native
Simulator
Serial Agent
SmartCard Scripter
Simulator
Socket Agent
Socket
Native
Simulator
Contactless
Modem
MSR
Power
Printer
Serial
Socket
Descriptions
Simulate LCD and Keypad and implemented with pure Java
Simulate CHV implemented with pure Java by Bouncy Castle
(port switch)
(port switch)
3.4.1.2.2 Browser
y
Browser Simulator
Configure the STIP Simulator UI presentation
64
BlueTools SDK User Guide
65
BlueTools SDK User Guide
3.4.1.2.3 CHV
y
CHV simulator
Fixed Key Settings
Master and Session Key Settings
66
BlueTools SDK User Guide
DUKPT Key Settings
Option
Description
Arithmetic
Available encryption methods are “DES” and “DES3’ for fixed key and master &
session key, or X9.24(Triple DES DUKPT) X9.8 (DES DUKPT) for DUKPT key
Init KSN
Initialization KSN for DUKPT encryption.
Init Key
Initialization key for DUKPT encryption.
Current count Number of times the PIN Pad has been used.
67
BlueTools SDK User Guide
Import/Export Keys
3.4.1.2.4 Contactless
SDK involves several Contactless simulators as below:
y
Contactless Scripter Simulator
User can define the data process scripter which follows the syntax of Apache Jelly.
y
Contactless Native Simulator
This simulator needs an H50 Advantage Terminal to be connected via serial port, and the
Terminal’s port switch mode is turned on. As the H50 Advantage Terminal acts like a Contactless Card
Reader here., user only needs to configure the serial port setting on PC which connects the H50 Advantage
Terminal. Please refer to Section 3.4.1.2.9 Serial Native Simulator Configuration for more information.
68
BlueTools SDK User Guide
3.4.1.2.5 Modem
There are two Modem Simulators as below:
y
Modem Simulator
This simulator acts like an echo server that receives the client request and sends back the
responding data automatically which has been pre-configured.
Figure below shows that the plain data “31 32 33 34 35 36 37 38 39” will be returned in 1000ms
after the simulator receives the request.
y
Modem Native Simulator
This simulator needs an H50 Advantage Terminal to be connected via serial port, and the
Terminal’s port switch mode is turned on. As the H50 Advantage Terminal acts like a Modem here, user
only needs to configure the serial port setting on PC which connects the H50 Advantage Terminal, Please
refer to Section 3.4.1.2.9 Serial Native Simulator Configuration for more information.
69
BlueTools SDK User Guide
3.4.1.2.6 MSR
y
MSR simulator
y
MSR Cards: MSR cards that are in the configuration file are listed here.
y
Track: Track information for the selected MSR
y
To add a new MSR, input the MSR name in the text field next to “MSR Cards” and input the tracking
information to the Track panel.
3.4.1.2.7 Power
y
Power Simulator
70
BlueTools SDK User Guide
3.4.1.2.8 Printer
y
Printer Simulator
Columns: The maximum number of characters for one line to print
3.4.1.2.9 Serial
There are two Serial Simulators as below:
y
Serial Native Simulator
y
Serial Agent
This simulator needs to connect the actual serial port on your PC, and transfers data via this port.
71
BlueTools SDK User Guide
3.4.1.2.10 SmartCard
y
SmartCard Scripter Simulator
3.4.1.2.11 Socket
y
Socket Agent
Figure below shows the SSL setting for socket connection.
y
Socket Native Simulator
This Simulator has no settings.
72
BlueTools SDK User Guide
3.4.1.3 CT100
3.4.1.3.1 Overview
CT100 shares most of the H50 Advantage simulators except printer simulator and LED
Simulator as it has no printer but LED.
Device
Simulator
Browser
CHV
Browser Simulator
CHV Simulator
Contactless Scripter
Simulator
Contactless
Native
Simulator
LED Simulator
Power Simulator
Serial
Native
Simulator
Serial Agent
SmartCard Scripter
Simulator
Socket Agent
Socket
Native
Simulator
Contactless
LED
Power
Serial
Socket
Descriptions
Simulate LCD and Keypad and implemented with pure Java
Simulate CHV implemented with pure Java by Bouncy Castle
(port switch)
(NOT YET IMPLEMENTED)
3.4.1.4 CT100 w/o Keypad
3.4.1.4.1 Overview
CT100 w/o Keypad is the derivative of CT100 but no Keypad, so it share the CT100’s simulators
3.4.1.5 D100 (China Product Only)
3.4.1.5.1 Overview
Device
Simulator
Browser
CHV
Browser Simulator
CHV Simulator
Contactless Scripter
Simulator
Contactless
Native
Simulator
Modem Simulator
Modem
Native
Simulator
MSR Simulator
Power Simulator
Printer Simulator
Serial
Native
Simulator
Serial Agent
SmartCard Scripter
Simulator
Socket Agent
Socket
Native
Simulator
Contactless
Modem
MSR
Power
Printer
Serial
Socket
Descriptions
Simulate LCD and Keypad and implemented with pure Java
Simulate CHV implemented with pure Java by Bouncy Castle
(port switch)
(port switch)
73
BlueTools SDK User Guide
3.4.1.5.2 Browser
y
Browser Simulator
Configure the STIP Simulator UI presentation
74
BlueTools SDK User Guide
3.4.1.5.3 CHV
y
CHV simulator
Fixed Key Settings
75
BlueTools SDK User Guide
Master and Session Key Settings
DUKPT Key Settings
Option
Description
Arithmetic
Available encryption methods are “DES” and “DES3’ for fixed key and master &
session key, or X9.24(Triple DES DUKPT) X9.8 (DES DUKPT) for DUKPT key
Init KSN
Initialization KSN for DUKPT encryption.
Init Key
Initialization key for DUKPT encryption.
Current count Number of times the PIN Pad has been used.
76
BlueTools SDK User Guide
Import/Export Keys
3.4.1.5.4 Contactless
SDK involves several Contactless simulators as below:
y
Contactless Scripter Simulator
User can define the data process scripter which follows the syntax of Apache Jelly.
y
Contactless Native Simulator
This simulator needs an H50 Advantage Terminal to be connected via serial port, and the
Terminal’s port switch mode is turned on. As the H50 Advantage Terminal acts like a Contactless Card
Reader here., user only needs to configure the serial port setting on PC which connects the H50 Advantage
Terminal. Please refer to Section 3.4.1.2.9 Serial Native Simulator Configuration for more information.
77
BlueTools SDK User Guide
3.4.1.5.5 Modem
There are two Modem Simulators as below:
y
Modem Simulator
This simulator acts like an echo server that receives the client request and sends back the
responding data automatically which has been pre-configured.
Figure below shows that the plain data “31 32 33 34 35 36 37 38 39” will be returned in 1000ms
after the simulator receives the request.
y
Modem Native Simulator
This simulator needs an H50 Advantage Terminal to be connected via serial port, and the
Terminal’s port switch mode is turned on. As the H50 Advantage Terminal acts like a Modem here, user
only needs to configure the serial port setting on PC which connects the H50 Advantage Terminal, Please
refer to Section 3.4.1.2.9 Serial Native Simulator Configuration for more information.
3.4.1.5.6 MSR
y
MSR simulator
78
BlueTools SDK User Guide
y
MSR Cards: MSR cards that are in the configuration file are listed here.
y
Track: Track information for the selected MSR
y
To add a new MSR, input the MSR name in the text field next to “MSR Cards” and input the tracking
information to the Track panel.
3.4.1.5.7 Power
y
Power Simulator
3.4.1.5.8 Printer
y
Printer Simulator
Columns: The maximum number of characters for one line to print
79
BlueTools SDK User Guide
3.4.1.5.9 Serial
There are two Serial Simulators as below:
y
Serial Native Simulator
80
BlueTools SDK User Guide
y
Serial Agent
This simulator needs to connect the actual serial port on your PC, and transfers data via this port.
3.4.1.5.10 SmartCard
y
SmartCard Scripter Simulator
81
BlueTools SDK User Guide
3.4.1.5.11 Socket
y
Socket Agent
Figure below shows the SSL setting for socket connection.
y
Socket Native Simulator
This Simulator has no settings.
3.4.2 How to Use Simulators
3.4.2.1 Modem Simulator
1.
GUI of Modem Simulator
The modem simulator GUI will appear when the modem control is in use by the STIPlet.
Figure 1
82
BlueTools SDK User Guide
Parameters
Result
Description
Displays the modem parameters.
Displays results for steps in modem communication.
If the “Dial Result” is CONNECT, then the server connection has been established,
otherwise it shows ERROR.
- If the “Answer Result” is OK, then the modem server will be answered.
- If the “Disconnect Result” is OK, then its modem server connection has been actively
terminated.
- If “Write Result” is OK and the server connection is active, then the modem server data
will be written.
Figure 2
Dial
Answer
Disconnect
Send
Dial to modem. The modem device will create an incoming call event for the STIP platform.
Answer the modem device. The combo box above the button is the answer result list, the
default is OK.
Disconnects the connection with the modem device creating a “connection lost” event for
the STIP platform.
Sends data to the modem device.
Auto response If checked, the modem server will answer dial-up automatically and send the data in the
text area when receiving any data from the modem device. Delays are hidden unless
checked.
Delay
The delay time of the auto response.
An option to display or send data in hex strings.
Hex
A pre-defined command file can be loaded, and the server will run according to this file.
Load
Default
If “Default” is checked, then the settings of the chosen .xml file will be used for all future
STIPlets until a new .xml file is loaded.
Run
Begins the simulation according to the file that was loaded.
2.
Write Configuration Files
Write the configuration files in the modem server.
When the Modem server loads a configuration file, the server will automatically run that sequence. A
configuration file sample and description of commands are shown below. The developer could refer this
example to create a .xml file for the simulation.
83
BlueTools SDK User Guide
<modem>
<command=”WAIT” value=”dial” timeout=”-1”/>
<command=”ANSWER”/>
<command=”DELAY” value=”1000”>
<command=”DIAL”/>
<command=”WAIT” value=”30 31” timeout=”-1”/>
<command=”SEND” value=”33 34”/>
<command=”WAIT” value=”**” timeout=”-1”/>
<command=”SEND” value=”33 34”/>
<command=”DISCONNECT” />
……
</modem>
y
y
DELAY --- Delays some number of milliseconds.
WAIT --- Systems waits until timeout for the data value specified. If the wait value is **, any
received data will be accepted to move on to the next command.
y
y
y
y
ANSWER --- Answer the dial-up
DIAL --- Dials to client
SEND --- Sends data of the values provided to client
DISCONNECT --- Disconnect from client.
Example:
<?xml version="1.0" encoding="UTF-8"?>
<modem>
<action cmd = "WAIT" value="DIAL" timeout="-1"/>
<action cmd = "ANSWER"/>
<action cmd = "WAIT" value="31 32 33 34 35 36 37 38 39" timeout="-1"/>
<action cmd = "DELAY" timeout="3000"/>
<action cmd = "SEND" value="31 32 33 34 35 36 37 38 39"/>
<action cmd = "DELAY" timeout="3000"/>
<action cmd = "SEND" value="31 32 33 34 35 36 37 38 39"/>
<action cmd = "WAIT" value="DIAL" timeout="-1"/>
<action cmd = "ANSWER"/>
</modem>
The STIPlet run sequence is “dial---write---read---read---answer”
3.
Add Configuration to Deviceconfig.xml
<server isautoresponse="true" delay="1000" writedata="31 32 33 34 35 36 37 38 39">
<loadfile name=" c:\command_1.xml " isdefault="false" isinit="false" />
<loadfile name=" c:\command_2.xml " isdefault="true" isinit="false" />
</server>
y
isautoresponse --- The modem server simulator automatically responds to requests when set “true”. If
“false”, the user must operate the server simulation window.
84
BlueTools SDK User Guide
y
Delay --- Auto response delay time measured in milliseconds.
y
Writedata --- When the server receives a read request while autorespond is set, but no .xml file is loaded,
then this bytestream will be used.
y
Loadfile name – Loads the specified .xml file into the simulation
y
isDefault --- The .xml file that will be used as the default for all STIPlets if defined as “true”.
y
Isinit --- When the modem server starts, the loaded .xml file will begin running if set “true”. If “false”, the
window will display a dialog box prompting the user to initialize the program.
3.5 Preferences
3.5.1 Overview
BlueTools provides preference pages to allow the user to control many aspects of STIPlet
development including the simulator, logger settings.
The global level preferences can be accessed via Window -> Preferences... -> BlueTools from the
top level menu.
Note that, all global level preferences are stored under your Eclipse workspace, they won’t go with you when
change to new workspace. New function will be provided in SDK 2.3.1 that you can Import/Export preferences in
workspaces.
85
BlueTools SDK User Guide
The project level preference can be accessed via Properties -> BlueTools by right clicking on the
STIPlet project
86
BlueTools SDK User Guide
3.5.2 Profile & Product
Since SDK 2.3.0, Product related configurations are re-arranged, and organized as a “one-stop” style,
see figure below:
87
BlueTools SDK User Guide
3.5.2.1
Device
Product is composed of several device simulators, and the simulator can have different
implementations. Every simulator implementation has its own settings; they are all located in the “Device”
tab of the attached Product
The device preferences section contains three sections:
•
Device: the available devices list of current selected product
• Simulator:
a) Active Simulator: set the active simulator for current selected device from the device
simulator combo box.
b) Simulator setting block: the setting block of current selected simulator (active simulator)
3.5.2.2 STIP Logger
y
Logger for H50 Advantage/CT100
There're three loggers at work when the STIPlet is running, and the logger file is stored
in %Your_Eclipse_Home%/logs/
1.
STIPlet logger, also known as "stip.debug.Debug", which is the STIPlet Debug API used in STIPlet
applications.
88
BlueTools SDK User Guide
2.
STIP Logger (com.bb.common.log.Sdklogger) for debugging the runtime Java Simulators
3.
Shell Logger (shell.logger) for H50 Advantage / CT100 for debugging the runtime native
simulators
89
BlueTools SDK User Guide
3.5.3 Compiler
Since SDK 2.3.0, user can set the default JEFF format options for Products respectively.
90
BlueTools SDK User Guide
3.5.4 Errors/Warnings
91
BlueTools SDK User Guide
3.6 Tools
3.6.1 Dump JEFF
Dump JEFF wizard can be accessed via:
1. BlueTools -> Dump JEFF from the top level menu.
2. BlueTools -> Dump JEFF by right click on .jeff file in navigator view.
92
BlueTools SDK User Guide
3.6.2 Sign JEFF
You can sign the JEFF file via "BlueTools -> Sign JEFF" from top level menu
Figure 13 sign JEFF wizard
ƒ
JEFF: Select the JEFF file to be signed
ƒ
Signed JEFF: select the location to store the signed JEFF file
ƒ
KeyStore: Select the KeyStore involves the key used to sign the JEFF file
ƒ
Password: Input the KeyStore password
ƒ
Alias: Input the key alias in the KeyStore
ƒ
Entry Password: Input the key entry password
93
BlueTools SDK User Guide
3.6.3 Verify Signed JEFF
Developer can verify the signed JEFF file while downloading STIPlet in POS terminal or via
"BlueTools -> Verify" from top level menu on PC.
Figure 14 Verify signed JEFF wizard
3.6.4 File System Explorer
The File system explorer can be accessed via BlueTools -> File System Explorer from the top level
menu or BlueTools -> Explore FileSystem… by right clicking on the “FFS.bin” (which stands for H50
simulator flash file) or “h50_flash8M.bin” (which stands for H50 Advantage/CT100 simulator flash file) file.
It is used to view the file system of the terminal simulator.
NOTE: since SDK 2.3.1, a fresh new File SystemExplorer (FSE) is available and the old one is
removed. The new FSE both support H50 flash file (FFS.bin) and H50 Advantage/CT100 flash file
(h50_flash8M.bin).
3.6.5 Test Assistant
The test assistant (Unit test robot) can be accessed via BlueTools -> H50 test assistant from top
level menu.
Test Assistant is a simple record/replay tool for running STIPlet.
94
BlueTools SDK User Guide
In record mode, the Test Assistant records the STIPlet actions of the simulator when the STIPlet is
running. Every action of each device simulator (LCD, Keypad, MSR …) will be recorded to a script file in
xml format. In replay mode, these recorded actions will re-act in the STIPlet. It can help the programmer
repeat testing of the STIPlet.
Test Assistant also supports adding check points during the process of recording. The check point is
the point where you need to check some content. Currently, the check point only supports text checking for
LCD display content and printer content.
STIPlet path: the location that involves META-INF/description.xml and *.class files
The STIPlet will run under the control of the Assistant. You can select the location to save the STIPlet,
and also can change the STIPlet by clicking Browse:
Run Mode:
•
Record: record the operations of a script file;
•
Replay: replay it according to the selected script file
•
Manual: just start the simulator
Script File:
The script file is used to save the user’s operations in “Record” mode. The default name is the current
STIPlet name. You can also change the script file name.
In Replay mode: The script file is read by Test Assistant to replay the STIPlet actions. User can choose
the script file to replay the actions if there are several script files under the STIPlet. All available script files
will be listed in the drop down list.
Stop on fail:
This function is reserved for future.
How to define the check point
95
BlueTools SDK User Guide
When you run the selected STIPlet if clicking the LCD area (The LCD screen in terminal), the text
displayed by the LCD simulator and Printer, simulator will be recorded as the check point automatically.
The Script File Format
<case name="">
<wait seconds="*" />
<checkscreen type="0">
<screen isregex=”true” lineno="*" value=" * " />
……
</checkscreen>
<input keys="123" />
<wait seconds="*" />
<input keys="2" />
<operatemsr no="1">
<track1 error="1" value=""/>
<track2 error="1" value=""/>
<track3 error="1" value=""/>
</operatemsr>
……
……
</case>
•
Name: STIPlet name
•
Wait: wait some seconds for the next action.
•
checkscreen: if type =0, will check the LCD screen with the defined value. If type=1, will check the print
screen with the defined value.
•
Lineno: The index of the line needs to be checked. This attribute must be written before the value attribute.
•
Value: The text data needs to be confirmed.
•
Isregex: true or false. Indicate if the value attribute is regex expression or a plain text. The rule of the regex
expression is same as Java. This is useful for some variable text, such as date time…
•
Input keys: the user input in UI operation. “123” means user input key 1, key 2 and key 3 one by one.
•
Operatemsr: the MSR operation information.
96
BlueTools SDK User Guide
3.6.6 Image Editor
1.
Open *.bbimg file with Image Editor
2.
Edit the image
97
BlueTools SDK User Guide
3.6.7 Convert to STIPlet Suite
Currently BlueTools does not support the project created by BlueTools SDK (the BlueTools precursor),
here's a way to convert the project and then you can run it on BlueTools.
Following the steps below:
•
Import old projects into current workspace via File -> Import -> General -> Existing Projects into
Workspace from the top level menu.
•
Convert via BlueTools -> Convert to STIPlet Suite by right click on the project
3.6.8 Synchronous programming
Starting with V2.4.2 of the BlueTools SDK, developers may now program STIPlets using
synchronous programming mode. Different with the asynchronous programming, synchronous mechanism
is more like sequential programming. User can use the sequential mechanism to program instead of using
the callback method.
Following is the code snippets, which describes the difference between asynchronous and
synchronous programming for STIPlet. Users can easily find the difference between these two kinds of
programming methods from the code snippets.
98
BlueTools SDK User Guide
Asynchronous code snippets:
99
BlueTools SDK User Guide
Synchronous code snippets:
100
BlueTools SDK User Guide
4 Revision History
Revision 1.0 (Dec 07, 2007)
Initial Release.
Revision 1.1 (June 23, 2009)
Add Security section.
Revision 1.2 (July 31, 2009)
Update Simulator section.
Revision 1.3 (August 4, 2009 )
Add section 3.4.1.2 H50 Advantage, 3.4.1.3 CT100, and
3.14.1.4 CT100 w/o Keypad. Update the figure in 2.4.1
Packaging and 3.5 Preference.
Revision 1.3.1 (Mar 31, 2010)
Add the note on where to load the BB Device Manager
application.
Revision 1.3.2 (June 21, 2010)
Change the format of the document.
Revision 1.3.3 (April 1, 2011)
Add description of D100 (China Product Only) in Item
3.4.1.5.
Revision 1.3.4 ( May 27,2011)
Revision 1.3.6 (Sep. 09,2011)
Update pictures in the document.
1.Update the part contents in document which are not keep
synchronization with new
2. All the images are updated to new images.
Update contents in Section 1.2 Environment.
Revision 1.3.7 (June 06, 2011)
Add synchronous programming feature in section 3.6.8.
Revision 1.3.8 (July 13, 2012)
Add BlueTools version.
Revision 1.3.5 (July,13, 2011)
101