MP200 - Book 1 - Getting Started - v1.0

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

CASTLES TECHNOLOGY

MP200 Mobile Pinpad

Book 1
Getting Started

Confidential

Version1.0
Feb 2015

Castles Technology Co., Ltd.


2F, No. 205, Sec. 3, Beixin Rd., XindianDistrict,
New Taipei City 23143, Taiwan R.O.C.
http://www.castech.com.tw
WARNING

Information in this document is subject to change without prior notice.

No part of this publication may be reproduced, transmitted, stored in a retrieval


system, nor translated into any human or computer language, in any form or by any
means, electronic, mechanical, magnetic, optical, chemical, manual, or otherwise,
without the prior written permission of Castles Technology Co., Ltd.

All trademarks mentioned are proprietary of their respective owners.

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 2


Revision History
Version Date Descriptions
1.0 Feb. 09, 2015 Initial creation.

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 3


Contents

1. Introduction .................................................................................................................... 5
1.1. Castles DVS SDK ................................................................................................... 5
1.2. What You Need ...................................................................................................... 5
2. Installation...................................................................................................................... 6
3. Building Your First Application ....................................................................................... 9
4. Loading Application To MP200 Mobile Pinpad ............................................................. 15
4.1. Signing Application ............................................................................................... 16
4.2. Download Application To MP200 Mobile Pinpad ................................................... 19
4.3. Execute Application On MP200 Mobile Pinpad ..................................................... 21
5. Console Debug ............................................................................................................ 22

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 4


1. Introduction

This document is target for software engineers, who are new to the Castles development
environment.

In the following chapters, the document will guide you step by steps from setting up the
SDK till running your first application on Castles MP200 mobile pinpad.

1.1. Castles DVS SDK

Castles DVS SDK is an integrated environment for application developers to


develop application on Castles platform. It includes compiler toolchain, source
code editor (Netbeans) and utilities (CAP Generator, Signing Tool and Loader).
Sample codes are provided in SDK.

1.2. What You Need

 Castles MP200 mobile pinpad


 Castles DVS SDK Installation Disc (or file)
 Data cable (USB cable)
 PC/SC Smart Card Reader (optional)
 Castles MP200 Keycard (optional)

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 5


2. Installation

i. Locate and execute installation file


Please locate the installation file from SDK CD or downloaded from FTP and make
sure that “installset.ini” file is in the same folder in which CVSInstaller6.0.0.9.exe
locates.
Double click CVSInstaller6.0.0.9.exe to start installation.

ii. Installation option - Components


Please select “Full installation” if you are not sure.
Press “Next” to continue.

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 6


iii. Installation option – Additional Tasks
Press “Next” to continue.

iv. Ready to install


Press “Install” to start the installation process.

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 7


v. Installation Complete
Press “Finish” to close the installation process.

If “Create a desktop icon” is selected, you will see one icon shown as below in your
desktop.

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 8


3. Building Your First Application

i. Execute Castles CTOS Development Suite


For example, double click icon below.

ii. Create a new project


From “File”, select “New Project…”

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 9


iii. Select project type
For MP200 mobile pinpad, select “MP200 Application Project”.
Click “Next” to continue.

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 10


iv. Enter project details
Enter the project name that you prefer.
Click “Browse..“ button to change the project folder.
Click “Finish” button to complete the project configuration and create the project.

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 11


v. Project created
The newly created project consists of sample code as below.

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 12


vi. Compiling the project
Select “Run” from menu, and then select “Clean and Build Project” to compile the
project.

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 13


vii. Build result
If the project built successfully, in Output window, message “BUILD SUCCESSFUL”
will be shown. If failed, message “BUILD FAILED” will be shown.

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 14


4. Loading Application To MP200 Mobile Pinpad

After successfully compiling your source code, you will find the output binary code file at
[Project folder] -> [dist] -> [MP200] -> [App].

MP200App_HelloWorld
[Project folder]

dist

MP200

App

MP200App_HelloWorld
[Binary code]

Note: The binary code file needs a signing process before being downloaded into MP200.

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 15


4.1. Signing Application

The application binary code file must be signed before being downloaded into
MP200 mobile pinpad. The signing process will convert the binary code file into
CAP file. CAP file format is defined by Castles to ensure the application data and
codes confidentiality and integrity.

Castles provided a Windows program named CAP Generator (CAPG) to perform


this signing process. There are two CAP Generator versions, evaluation version
and keycard version. The evaluation version is for development purpose, it only
works with MP200 mobile pinpad with vendor default key. The keycard version is
used for live deployment. For more details on CAP Generator, please refer to
Book 2 – User Manual.

4.1.1. CAP Generator – Evaluation Version


i. Execute CAP Generator (Evaluation version)), located in
C:\Program Files\Castles\MP200\tools\CAPG (Evaluation Version)
for MP200 mobile pinpad.
ii. Select Type as “10 – Linux AP & Files”
iii. Select file
iv. Enter App Name and App Version
v. Sign file

ii

iii
v iv

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 16


4.1.2. CAP Generator – Keycard Version
i. Execute CAP Generator (Keycard version), located in C:\Program
Files\Castles\MP200\tools\CAPG (Keycard) for MP200 mobile pinpad.
ii. Insert Keycard and select smart card reader.

iii. Enter PIN, default PIN is “1234”.

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 17


iv. Select Type as “10 – Linux AP & Files”.
v. Select file.
vi. Enter App Name and App Version.
vii. Sign file.

iv

vii vi v

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 18


4.2. Download Application To MP200 Mobile Pinpad

After the signing process, the CAP Generator will generate two files for
downloading, mci file and CAP files. The mci file is the list of CAP files.

MP200App_HelloWorld
[Project folder]

dist

MP200

output

App.mci

App.CAP

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 19


Castles provides a Windows program named ULD Download Utility to download
CAP file to terminal / pinpad. For more details on ULD Download Utility, please
refer to Book 2 – User Manual.

Steps:
i. Execute ULD Download Utility, located in C:\Program
Files\Castles\MP200\tools\Loader for MP200 mobile pinpad.
ii. Select Com Port.
iii. Select file (mci).
iv. Terminal enter download mode.
 Press button [0] in Program Manager (PM).
 Press button [1] to select “1. Download AP“.
 Press button [1] again to select download via USB.
v. Start download.

v ii iii

Note: To download using USB cable, terminal must enable CDC mode.
[PM] →0[System Menu] → [4. Sys Settings] → [USB CDC Mode:] → [Y]

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 20


4.3. Execute Application On MP200 Mobile Pinpad

i. Select application in Program Manager


Press [‘↑’up / ’↓’down] button to select. Selected application will be
highlighted.

Program Manager
----------------01/01
1. 1.MP200App_HelloWorld

ENTER:Run

ii. Execute Application


Press Enter to execute application.

Loading AP......
Please wait.....

iii. Application executed


Hello

iv. Exit Application and return to PM


Press any key to return to PM.

Note: To automatically run the application after MP200 mobile pinpad power on,
select AP in Program Manager, press [1] button to enable “Default Select”. To
stop the default application execution, keeping pressed and released [X] button
during “System Initializing” until enter Program Manager.

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 21


5. Console Debug

Console debug is a very useful tool during application development. It’s used to dump
messages out from MP200 mobile pinpad in real time. The messages are dumped
through USB and can be captured by console application like Hyper Terminal, TeraTerm
or Putty.

Terminal / Pinpad setup


In the Program Manager, press [0] button to menu followed by [4] button to
“4.Sys Settings” and press [2] to the page in which Debug Mode item locates.

SYS SETTINGS The Debug Mode is off by default.


Debug Mode :Y
Debug Port :X  Press [OK] button to change debug mode.
Mobile AutoON :Y
Bklit Auto Off :N  Press [←] button to toggle to [Y].
Bklit Off Time :X  The screen will display hint message.
PWR KEY OFF :Y
1: Prev 2: Next

SYS SETTINGS Specify the serial port for output debug message.
Debug Mode :N
Debug Port :U  Press[OK] followed by [3], the Debug Port can be
Mobile AutoON :Y set to be USB port.
Bklit Auto Off :N
Bklit Off Time :X  Press [X] button to return, and can start to debug
PWR KEY OFF :Y while running AP.
1: Prev 2: Next

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 22


PC Setup
 Connect the USB cable to PC and the COM specified in Debug Port on terminal.
 Run console application (such as Hyper Terminal, TeraTerm or Putty)
 Set serial port to baudrate of 115200bps, none parity bit, 8 data bits, 1 stop bit.

MP200 mobile pinpad Application


 Use printf() function to dump your debug messages.
For example:
printf("This is debug message!\n");

Debug Message Output

~ END ~

Castles Technology Co., Ltd. Confidential • All Right Reserved. Pg. 23

You might also like