DOC00501 Operating System Programmers Manual Redacted Compressed PDF
DOC00501 Operating System Programmers Manual Redacted Compressed PDF
Programmers Manual
P R E F A C E . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Audience. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Assumptions About the Reader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Conventions and Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Major Hardware Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Recommended Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Wireless Interface Applications - Required Actions and Best Practices. . . . . . . 24
Guidelines in Using Wireless Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
WiFi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Bluetooth. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Guidance on Digital Certificates with 1024-bit Keys (Including SSL Certificates)
25
CHAPTER 1
Quick Reference Function Calls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Function Call Error Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
CHAPTER 2
Overview Terminal Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
C/C++ Compiler and Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Symbolic Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
System Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Boot-up Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Environment and Configuration Variables . . . . . . . . . . . . . . . . . . . . . . . . . . 49
File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Environment Variable Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
getEnvFile() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
putEnvFile() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
System Configuration Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
CHAPTER 3
Secure Installer Software Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Install Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Flash Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Users and Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Assign Users. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Assign Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Shared Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Install Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Package Control File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Package Start File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Package env File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Package grsec File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
grsecurity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
grsecurity Policy File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
File Capabilities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
File System Content Packages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
OS Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
osflash Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
lowlayers Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
user Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
userflash Packages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
service Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
config Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
flashconfig Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
vss Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
unsigned Packages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
userfont Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
patch Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Install Bundles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Bundle Control File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
patch Bundles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Remove File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Download Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Installed Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Create Install Packages and Bundles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Sysmode Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Secure Installer Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Secins_install_pkgs(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Secins_reboot() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Secins_start_user_apps() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Secins_start_app(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Secins_read_pkglist_entry() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Secins_close_pkglist() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Secins_strerror() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Secins_share_gid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Secins_system_gid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Secins_users_gid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Secins_user_app(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Secins_sys_app() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Secins_sysmode_share_gid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Secins_config_file_share_gid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Users/Groups Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Secins_get_uid_gid_range() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Secins_add_group() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Secins_add_user(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Secins_add_group_member() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Secins_remove_user(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Secins_remove_group() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Secins_start_app_uid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
CHAPTER 4
System Mode for V/ Entering System Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
OS Terminal Exiting System Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
CHAPTER 5
Multi-Application User Accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Environment File Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Launching Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
GUI Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
CHAPTER 6
Power Management Standby Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Sleep Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Wakeup Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Power Management System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Application Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Power Management Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Power Management Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
powermngt_getVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
powermngt_get_config() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
powermngt_set_config() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
powermngt_Shutdown(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
powermngt_SetWakeupTime() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
powermngt_CritcalSectionEnter() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
powermngt_CritcalSectionExit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
powermngt_declare_state() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
powermngt_GetInfo(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
powermngt_GetEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
powermngt_Susspend(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
powermngt_Standby() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
powermngt_get_wakeupdevices() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
powermngt_set_wakeupdevices() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
powermngt_get_sufficient_battery() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
#defines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Typedefs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
CHAPTER 7
Services V/OS Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Flow for Service Server Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
XML Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
XML Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
XML Command and Return Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Call Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
XML Command and Return Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Service Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
C Content Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Comment Tag Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Service Interface and the C Preprocessor . . . . . . . . . . . . . . . . . . . . . . . . . 157
Array Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Binary Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Pairlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
CHAPTER 8
Input Events Input Event Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
inputOpen() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
inputRead() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
inputClose() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
CHAPTER 9
Device Drivers
C H A P T E R 10
Display Display Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
dspSetBrightness() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
C H A P T E R 11
LEDs LED Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Led_ledOn(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
led_ledOff() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
led_init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
led_release() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
led_start_blinking() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
led_stop_blinking2(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
led_read_led() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
led_read_led_ctls() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
led_switch_color() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
C H A P T E R 12
CardSlot Library
C H A P T E R 13
Touch Panel, Touch Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Signature Capture, TIFF Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
and TIFF SigCap2Tiff() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
C H A P T E R 14
Audio and Beeper Audio Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
soundCtrl() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
C H A P T E R 15
Serial Ports and COM1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Protocols COM2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
C H A P T E R 16
IPP Module IPP Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
ippOpen(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
ippClose() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
ippRead() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
ippWrite() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
SetSecurePINDisplayParameters() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
ippPinEntryStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
ippTerminatePinEntry() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
IPP MS and DUKPT Communications Packets . . . . . . . . . . . . . . . . . . . . . . . . 250
Advanced Programming in IPP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Minor Differences by Packet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Packets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
IPP7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Using a Session Key. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Common Packets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
MS-Specific Packets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
C H A P T E R 17
Account Data ADE State Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Encryption Module Turning ADE On . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
ADE Key Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Unique Key Enforcement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Cleartext Key Loading using Virtual Terminal Management . . . . . . . . . . . . . . 321
ADE Packets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Packet A90 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Encrypted Key Loading using VRK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
ADE System Mode Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
ADE Status Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
ADE Key Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
ADE Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
#define Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
ade_encrypt(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
ade_status(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
ade_active() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
C H A P T E R 18
Magnetic Stripe Magnetic Stripe Reader Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Reader msrOpen() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
msrRead() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
msrWrite() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
msrMagneticCardPresent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
msrRaw() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
msrStructured() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
msrEnableLicenseDecode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
msrDisableLicenseDecode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
msrSetMinBytes() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
msrSetMaxNoDataCount() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
msrReportExtendedErrors(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
msrVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Example Card Reader Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
C H A P T E R 19
Contactless RF Contactless RFCR Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Card Reader CTLSClientGetVersion () . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
CTLSInitInterface() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
CTLSOpen() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
CTLSGetUI() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
CTLSSetUI() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
CTLSSend(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
CTLSReceive() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
CTLSClose() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Optional
UI Framework Helper Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
C H A P T E R 20
USB Device/Host USB Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
USB Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
USB Mass Storage and Memory Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
USB Human Interface Device (HID) Support . . . . . . . . . . . . . . . . . . . . . . . . . . 364
C H A P T E R 21
NET Service Management Communication Sessions for Applications . . . . . . . . . . . . . . . . . 366
Ethernet and Wi-Fi XML Communication Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Configuration NET Service Communication File Examples . . . . . . . . . . . . . . . . . . . . . . . 375
Creating a Communication File Dynamically . . . . . . . . . . . . . . . . . . . . . . . 379
Ethernet and Wi-Fi Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Create and Modify the Default XML Configuration File. . . . . . . . . . . . . . . . 382
Bring Up a Specific Network Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Configure the Ethernet Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Configure the Wi-Fi Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
NET Service API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
NET Service Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
NET Service Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
NET Service Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
net_getVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
net_interfaceSet() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
net_interfaceGet() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
net_interfaceModemSet() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
net_interfaceModemGet (). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
net_interfaceModemExtSet() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
net_interfaceModemExtGet(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
net_interfaceModemIsdnSet() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
net_interfaceModemIsdnGet() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
net_interfaceGprsSet() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
net_interfaceGprsGet() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
net_optionSet() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
net_optionGet() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
net_interfaceUp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
net_interfaceDown() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
net_interfaceStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
net_networkUp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
net_networkDown() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
net_interfaceStatusList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
net_getTable() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
net_getRoutes() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
net_addHostRoute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
net_delHostRoute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
net_addNetRoute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
net_delNetRoute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
net_autoSetDefaultRoute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
net_setDefaultRoute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
net_getDefaultRouteInfo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
net_startDHCP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
net_renewDHCP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
net_releaseDHCP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
net_stopDHCP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
net_setDNS() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
net_addRouteFromXML() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
net_nsLookup() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
net_ping(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
net_wifiStart(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
net_wifiStop(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
net_wifiSiteSurvey(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
net_wifiInfo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
net_setNTP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
net_sessionOpen() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
net_sessionConnect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
net_sessionConnectExt(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
net_sessionRead(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
net_sessionWrite(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
net_sessionSetTag() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
net_sessionGetTag() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
net_sessionDisconnect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
net_sessionClose() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
net_gprsVerifyPin() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
net_gprsGetStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
net_gprsGetStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
net_gprsGetRssi() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
net_gprsRssi() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
WPA Supplicant for Wi-Fi Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
C H A P T E R 22
TCP/IP Networking Network Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
Network Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
net_interfaceUp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
net_interfaceDown() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
net_interfaceStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
net_networkUp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
net_networkDown() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
net_interfaceStatusList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
net_getTable() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
net_getRoutes() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
net_addHostRoute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
net_delHostRoute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
net_addNetRoute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
net_delNetRoute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
net_autoSetDefaultRoute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
net_setDefaultRoute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
net_getDefaultRouteInfo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
net_startDHCP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
net_renewDHCP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
net_releaseDHCP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
net_stopDHCP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
net_setDNS() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
net_addRouteFromXML() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
net_nsLookup() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
net_setNTP () . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
Wireless Network Interface Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
net_wifiStart(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
net_wifiStop(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
net_wifiSiteSurvey(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
net_wifiInfo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
Supported Network Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
net_ping(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
ftpGet(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
ftpPut() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
C H A P T E R 23
Bluetooth Service Bluetooth Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
bluetooth_getVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
bluetooth_scan() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
bluetooth_scanResults() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
bluetooth_hidConnect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
bluetooth_hidDisconnect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
bluetooth_getConnectedHids() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
Data Structure Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
Data Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
btConfig::address[]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
btConf::discoverable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
btConf::name[] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
btDevice Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
btDevice::address[] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
btDevice::class[]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
btDevice::name[] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
Data Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
btDevice* btDeviceList::device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
btDeviceList::deviceCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
bluetooth_getVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
version bluetooth getVersion(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
bluetooth hidConnect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
bluetooth hidDisconnect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
btDeviceList bluetooth getConnectedHids() . . . . . . . . . . . . . . . . . . . . . . . . . 528
btConf bluetooth getConfig() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
bluetooth isUp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
bluetooth power(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
bluetooth scan() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
btDeviceList bluetooth scanResults() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
C H A P T E R 24
Security Module VeriShield Security Scripts Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
iPS_DeleteKeys() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
iPS_LoadSysClearKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
iPS_LoadSysEncKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
iPS_LoadMasterClearKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
iPS_LoadMasterEncKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
iPS_CheckMasterKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
SetSecurePINDisplayParameters() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
iPS_SetPINParameter(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
iPS_SelectPINAlgo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
iPS_RequestPINEntry() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
iPS_GetPINResponse(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
iPS_CancelPIN() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
iPS_InstallScript() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
iPS_GetScriptStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
iPS_UninstallScript() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
iPS_ExecuteScript(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
pcPS_GetVSSVersion(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
Security Services Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
cryptoWrite() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
cryptoRead() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
rsa_calc() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
vfi_SHA1() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
DES() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
AES() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
generateRandom(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
isAttacked() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
secVersion(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566
authFile() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
loadOSFiles(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
osHash() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
C H A P T E R 25
Real-Time Clock setRTC() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
(RTC) setDateTime() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
C H A P T E R 26
System Mode Pre-expired Passwords. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
Security System Mode Logins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
Login / Password Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
System Mode Access Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
Secure Remote Password Download . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
Password States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
Use Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
Security Policy File Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
VeriShield Remote Key (VRK) Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
copyPublickey_RKL() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
getKeyStatus_RKL() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
C H A P T E R 27
Diagnostic Diagnostic Counters Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
Counters Counter Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
Setting Counter Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
Formatting Counter Displays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
Accessing Group Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
APPENDIX A
VeriShield Crypto
Library (VCL)
APPENDIX B
V/OS on the MX LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Terminal ledRunway(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
Serial Ports and Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
Serial Communication Control Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
Packet Mode Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
startPktMode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
endPktMode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
packetRX(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
COM Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
COM1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
COM2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
COM Port Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
comMonitorHandshake() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
COM3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
COM5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
Service Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
Touch Panel Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
Touch Panel Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
touchCmd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
Signature Capture Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
SigCapCount() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
SigCapGet(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
SigCapBoxApply() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
vf_sig_cature_options() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
RFCR Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
RFCRlibVersion(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
RFCRInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
RFCRClose() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
RFCRGetVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
RFCRPing() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
RFCRReset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
RFCRSetAntenna() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
RFCRSetIndicator() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
RFCRGetCardPayload() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
RFCRParseCardPayload() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
RFCRPurge(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
RFCRInputPending() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
RFCRRawWrite(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
RFCRRawRead(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
RFCRAddCRC() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
RFCRCheckCRC() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
RFCRReceiveACKFrame() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
RFCRReceiveDataFrame() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
RFCRSetPollMode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
RFCRGetTransactionResult() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
RFCRActivateTransaction(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
RFCRActivateMxItransaction() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
RFCRDebitWrite() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
RFCRCancelTransaction() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
RFCRGetFullTrackData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
RFCRUpdateBalance() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
RFCRSetEMVParameters(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
RFCRGetEMVParameters() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
RFCRSetBurstMode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
RFCRSetPassThroughMode(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
RFCRPollForToken() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
RFCRIsoApduExchange() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
RFCRPcdSingleExchange() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
RFCRGetPcdPiccParam() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
RFCRMifareAuthenticateBlock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
RFCRMifareReadBlocks() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
RFCRMifareWriteBlocks() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
RFCRMifarePurseCommand() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
RFCRHighLevelHaltCommand() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
RFCRSetCAPublicKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
RFCRDeleteCAPublicKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
RFCRDeleteAllCAPublicKeys() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
RFCRSetRTCTime() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
RFCRGetRTCTime() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
RFCRSetRTCDate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
RFCRGetRTCDate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
RFCRSetBaudRate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
RFCRSetRTCSource() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
RFCRGetRTCSource() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
RFCRGetType(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
RFCRLedControl(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
RFCRBuzzerControl() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
RFCRGetConfigurableAID() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
RFCRGetAllAIDs(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
RFCRGetConfigurableGroup() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
RFCRGetAllGroups(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
RFCRWriteDataCommand() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673
RFCRSetConfigurableAID(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
RFCRSetConfigurableGroup(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
RFCRSDeleteConfigurableAID() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
RFCRDeleteConfigurableGroup() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
RFCRGetBuild(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
RFCRGetAllVariables() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
RFCRGetProductType() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
RFCRGetProcessorType() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
RFCRGetMainFwVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
RFCRGetFwSubsystemSuite() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
RFCRGetSerialProtocolSuite() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684
RFCRGetPayPassVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
RFCRGetAntiCollisionResolution() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
RFCRGetCardApplicationSuite() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
RFCRGetUserExperienceSuite(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
RFCRGetSystemInformationSuite() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
RFCRGetCAPublicKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
RFCRGetSerialNumber(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
RFCRSetSerialNumber() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
RFCRFlushTrackData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
RFCRSetRfErrorReporting() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
RFCRGetUSBBootLoaderVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
RFCRStoreLCDMessage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
RFCRGetLCDMessage(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
RFCRGetAdditionalAIDParams() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
RFCRGetRevocationParam() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
RFCRGetAllAdditionalAIDParams() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
RFCRGetAllRevocationParams() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
RFCRGetAllExceptionParams() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702
RFCRGetAdditionalReaderParams(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
RFCRGetVFIVersion(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
RFCRGetTypeApprovalVersions() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
RFCRSetExistAdditionalAIDParams() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
RFCRSetNewAdditionalAIDParams() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
RFCRDeleteAdditionalAIDParams() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
RFCRSetExistRevocationParam(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
RFCRSetNewRevocationParam() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
RFCRDeleteRevocationParam() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
RFCRSetNewExceptionParam() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712
RFCRDeleteExceptionParam() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
RFCRSetAdditionalReaderParam(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
RFCRRestoreDefaultConfig() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
RFCRGetFwFullVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
RFCRGetBaudRate(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
RFCRChangeBaudRate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
RFCR Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
RFCR Protocol Compatibility Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
PCI 4 Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
APPENDIX C
V/OS on the UX Device Configuration for Development. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
Terminals Anti-Removal Switches (ASRs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
Application Development Package (ADK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
Error Codes and errno Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
Power Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
APPENDIX D
UX100 and UX110 Firmware Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
Terminals Sysmode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
UX 100 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
UX 110 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
Password Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
Security Policy File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
Reset Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
Terminal Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
Display Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
errno Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
ux100_dispGetInfo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
ux100_dispSetContrast() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735
ux100_dispSetBacklightMode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
Buzzer Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
ux100_buzzerSetBeep() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
ux100_buzzerGetInfo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
ux100_buzzerSetKeyboardBeep(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
ux100_buzzerGetKeyboardBeepInfo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
PIN Entry Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
ux100_pinStartPinEntry(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743
ux100_pinGetNbCurrDigitEntered(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744
ux100_pinDelete() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745
ux100_pinAbort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
ux100_pinSendEncPinBlockToVault(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 747
ux100_pinEntrymode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
Info Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
ux100_getVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750
ux100_infoGetDeviceList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
ux100_infoGetSecureVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
ux100_infoGetPartNumber() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
ux100_infoGetSerialNumber() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754
ux100_infoGetHardwareVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755
ux100_infoGetPCIHardwareVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756
ux100_infoGetModelNumber() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
ux100_infoGetCountryName(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758
ux100_infoGetPairingStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759
ux100_infoGetRemSwStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
ux100_infoGetTamperStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
ux100_infoGetCoinChargingStatus(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762
ux100_infoGetSensorTemperature() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
ux100_infoGetLogEvents() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764
ux100_infoSetIdCard(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
ux100_infoGetConnectionStatus(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
ux100_infoGetDeviceMode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
ux100_infoGetOperationalMode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768
ux100_infoGetPermanentTerminalID() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 769
ux100_infoGetUnitType(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770
ux100_infoResetLogHeader() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771
ux100_infoSetLogEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
ux100_infoGetAtmelSerialNumber() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
ux100_infoSetRTC() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
ux100_infoGetRTC() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
ux100_infoGetHeaterMode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776
ux100_infoGetHeaterStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
ux100_infoGetBootVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
ux100_infoGetDiagCounter(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
ux100_infoSetDiagCounter() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
Security Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
ux100_secGenerateRandom() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
ux100_secSetSecureDate(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783
ux100_secLoadCertificate(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784
ux100_secLoadPublicKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
ux100_secReadPublicKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
ux100_secReadCertificate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
ux100_secGetKeyList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 788
ux100_secGetCurrSECIRQ() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789
ux100_secGetSavedSECIRQ() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
ux100_secGetCurrentUKSR() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
ux100_secGetSavedUKSR() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
ux100_secTamperNumEntHandl() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
Manufacturer Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
ux100_mfgRemovalSwitchReset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795
ux100_mfgClearTamper() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
Performing a Card Reader Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
Multi Drop Bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
MDB Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
mdb_setupDevices() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
mdb_closeDevices() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799
mdb_receive() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
mdb_peek() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
mdb_advance_buffer_tail() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
mdb_getVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
mdb_getConfig() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
mdb_setConfig() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
mdb_setBusTimings() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806
mdb_setMdbLinkState(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
mdb_getTimeSinceLastPoll(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808
mdb_checkPolling() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
mdb_setCardReaderAddress() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810
mdb_getCardReaderAddress() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
mdb_sendJustReset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
mdb_send() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813
mdb_flush() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814
mdb_cmdType(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
mdb_displayText() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
mdb_clearDisplay() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817
mdb_sendReaderConfigData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818
mdb_sendPeripheralId() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 820
mdb_setOptionalFeatures() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 822
mdb_sendDateTime() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
mdb_sendDateTimeRequest(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824
mdb_sendDravs() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825
mdb_sendMalfunctionError() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826
mdb_sendDiagnosticResponse(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827
mdb_sendSendDataEntryRequestResp() . . . . . . . . . . . . . . . . . . . . . . . . . . . 828
mdb_sendDataEntryCancel() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829
mdb_sendFTLRetryDeny() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830
mdb_sendFTLSendBlock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831
mdb_sendFTLOkToSend() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833
mdb_sendFTLRequestToSend() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834
mdb_FTLReceiveFile() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
mdb_FTLReceiveFileExt() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837
mdb_FTLRespondToReceiveRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
mdb_FTLSendFile(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
mdb_sendBeginSession() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
mdb_sendSessionCancelRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
mdb_sendVendApproved() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846
mdb_sendVendDenied() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
mdb_sendEndSession() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848
mdb_sendOutOfSequence() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
mdb_sendCancelled() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
mdb_sendRevalueApproved() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
mdb_sendRevalueDenied() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 852
mdb_sendRevalueLimitAmount() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853
mdb_setDisplayData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
MDB Data Structure Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855
MdbCommand Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855
MdbConfig Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855
#defines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856
Configuring PPP Over UX PSTN Modems . . . . . . . . . . . . . . . . . . . . . . . . . 858
Configuring PPP Over UX ISDN Modems . . . . . . . . . . . . . . . . . . . . . . . . . 858
Configuring PPP Over the Serial Port. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859
Remote Printer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 860
Supported Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 860
Remote Printer Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 860
remoteprinter_getVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861
remoteprinter_Open() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862
remoteprinter_TurnOn(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863
remoteprinter_TurnOff(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 864
remoteprinter_Flush() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865
remoteprinter_GetStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 866
remoteprinter_PrintBarCode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867
remoteprinter_UpdateFirmware() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868
remoteprinter_DownloadLogo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 869
remoteprinter_DownloadFont() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 870
remoteprinter_PrintLogo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871
remoteprinter_PrintBitImage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 872
remoteprinter_Command() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 873
remoteprinter_Detect(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 875
remoteprinter_GetLibVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876
remoteprinter_SetDensity() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877
remoteprinter_SetCharacterSize(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878
remoteprinter_Cut() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
remoteprinter_Close() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
#defines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
rmpBinData Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886
rmpCmdParams Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886
rmpDataReturn Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 887
APPENDIX E
V/OS on the UX300 Graphical User Interface (GUI). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
Terminal Updating the Terminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
I/O Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 890
Performing a Card Reader Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 890
Sysmode Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 890
APPENDIX F
VX 520 and UX300 Enter Sysmode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
Sysmode Password Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
Application Security Policy File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
Change Passwords. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
Sysmode Menus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
Special Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 897
APPENDIX G
V/OS on the VX NET Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 899
Terminal Modem and GPRS Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
Management Communication Sessions for Applications . . . . . . . . . . . . . . 905
NET Service Communication File Examples . . . . . . . . . . . . . . . . . . . . . . . 914
Creating a Communication File Dynamically . . . . . . . . . . . . . . . . . . . . . . . 919
NET Service API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 921
Sysmode Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 922
VX 520 Special Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 924
Color LCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925
Keypad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925
GPRS Radio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925
VX 675 Special Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925
Comm Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 926
Network Control Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 926
SVC_INFO_DEV_TYPE(INFO_PRES_TOUCH) . . . . . . . . . . . . . . . . . . . . . 927
SVC_INFO_PRNTR() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 927
Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 927
Battery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 928
SVC_INFO_BAT_REQ() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 928
PMIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 928
Keypad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 929
Color LCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 929
Terminal Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 929
VX 820 Touch Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 930
Touch Panel Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 930
Touch Panel Calibration and Compensation . . . . . . . . . . . . . . . . . . . . . . . 930
VX Terminal Signature Capture Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 931
SigCapCount() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 932
SigCapGet(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 933
SigCapBoxApply() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 934
vf_sig_cature_options() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 935
VX Terminal Thermal Printer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 937
Thermal Printer APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 937
Printer_PrintText() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 938
Printer_PrintLine() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 939
Printer_PrintBitMap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 940
Printer_SetFont() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 941
Printer_SetFontSize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 942
Printer_GetStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 943
Printer_WaitReady() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 944
Printer_WaitPaper() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 945
Printer_CancelPrint() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946
Printer_OutOfPaperEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 947
APPENDIX H
PAYware Vision PAYware Vision Library Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 949
vpInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 950
vpParseFields() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 952
vpSendPacket() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953
vpCreateXTRMCFGString(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 954
vpExit(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 955
vpCloseUp(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 956
vpVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 957
vpCloseDown() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 958
Callback Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959
fnDownReq() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 960
fnDownFileStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 961
fnUpData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 962
fnUpDisconnect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963
fnTimedOut() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 964
APPENDIX I
IPP Legacy Library ipp_getpin() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 967
ipp_read() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 969
ipp_mac(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 972
ipp_abort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 974
ipp_diag(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 975
select_key_mgmnt() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 977
get_key_mgmnt(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 979
getKeyStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 981
APPENDIX J
PCI 4 Compliance Identifying PCI 4 Compliance Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 985
Sensitive Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 985
Operating System Downgrades . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 986
Application Level Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 986
24-Hour Reboot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 986
Unsigned Packages’ New Destination . . . . . . . . . . . . . . . . . . . . . . . . . . . . 987
Multi-Application Access to Magnetic Stripe Reader (MSR) Disabled . . . . 987
Application Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 988
I N D E X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 991
Chapter 1 Provides a quick reference to function calls and error codes for V/OS.
Chapter 8 Presents information on how the Input Event module manages touch
panel and USB HID events.
Chapter 10 Presents the function calls used to manage the V/OS terminal display.
Chapter 11 Presents the function calls used to manage the V/OS terminal LEDs.
Chapter 13 Presents the function calls used to manage the V/OS terminal touch
panel.
Chapter 15 Discusses the serial port protocols used to manage ports on V/OS
terminals.
Chapter 16 Presents the function calls used to manage the V/OS terminal internal
PINpad.
Chapter 17 Discusses the V/OS Account Data Encryption (ADE) module and
presents ADE function calls.
Chapter 18 Presents the function calls used to manage the V/OS terminal magnetic
stripe reader.
Chapter 19 Presents the function calls used to manage the V/OS terminal
contactless card reader.
Chapter 20 Presents the function calls used to manage the V/OS terminal USB
device.
Chapter 21 Discusses using NET service calls to manage Ethernet and Wi-Fi
devices.
Chapter 23 Presents the function calls used to manage the V/OS terminal Bluetooth
interface.
Audience This document is of interest to application developers creating applications for use
on V/OS-based terminals.
Conventions and
Acronyms Abbreviation Definition
BFI Buffer Flush Interval
bps bits per second
CRC Cyclic Redundancy Check
DHCP Dynamic Host Configuration Protocol
FA File Authentication
Firmware Software in FLASH/ROM
FTP File Transfer Protocol
GISKE Global Interoperable Secure Key Exchange
GPRS General Packet Radio Service
HID Human Interface Device
IPP Internal PIN Pad
IPv4 Internet Protocol version 4
IPv6 Internet Protocol version 6
ISDN Integrated Services Digital Network
ISR Interrupt Service Routine
KLK VSS Key Loading Key
KSN Key Serial Number
KVC Key Verification Code
LED Light Emitting Diode
MS Master Session
MSR Magnetic Stripe Reader
NFS Network File System
OSS Open Sound System
PED PIN Entry Device
PEK PIN Encryption Key
PPP Point-to-Point Protocol
PSTN Public Switched Telephone Network
RFCR RF Card Reader
RRT Receive Record Threshold
RTC Real-time Clock
Abbreviation Definition
SAM Security Access Module
SSL Secure Sockets Layer
TCP/IP Transmission Control Protocol (TCP) and Internet
Protocol (IP)
V/OS Verifone Operating System
VRK VeriShield Remote Key
VSS VeriShield Security Scripts
Wi-Fi Wireless Fidelity
XML Extensible Markup Language
Wireless When writing applications for wireless interfaces, beware the risk of attack. Use
Interface MasterCard Worldwide specifications to ensure secure connections. Review this
Applications - document at
Required http://www.mastercard.com/ us/sdp/assets/pdf/wl_entire_manual.pdf
Actions and The following table lists applicable wireless interfaces with pages referenced in
Best Practices the MasterCard Worldwide manual that details security concerns and accepted
operational modes necessary to mitigate them.
Basic Security
Wireless Interface Security Risks
Information Guidelines
Wi-Fi 2-2 2-2 through 2-3 2-4 through 2-7
GPRS and GSM 2-12 2-12 2-13
Bluetooth 2-14 2-14 through 2-15 2-16
NOTE Visa, Payment Card Industry (PCI), and/or other important entities may offer
documents detailing requirements as well. Application writers should inquire with
any such pertinent entities for documentation before beginning application
development.
Guidelines in The following are guidelines for application developers in using wireless
Using Wireless interfaces:
Interfaces
Bluetooth Use S3 and SSP if payment application uses Bluetooth. Payment applications
must never use “Just Works” mode under any circumstance. Similarly, devices
must never use “Just Works” association model, and therefore, must immediately
discard all unauthenticated Just Works link keys after pairing to terminate such
connections.
Guidance on Digital In accordance with guidance from the National Institute of Standards and
Certificates with Technology (NIST), Certificate Authorities (CAs) are advised to follow the
1024-bit Keys recommendations published initially in advisory 800-57 and later 800-131A. CA's
(Including SSL are advised to deprecate signing Digital Certificates that contained RSA Public
Certificates) Keys of 1024 bits after 31st December 2010 and cease signing completely by 31st
December 2013 (Table 2, Section 3 of 800-131A). At the time, the general
consensus was all previously issued, long-lived certificates expiring after the 31st
December 2013 should be dealt with nearer to the deadline.
As a forward thinking Certificate Authority with an SSL mission to improve how
CAs deploy SSL and end users rely on SSL, GlobalSign helped its customers stay
protected and benefit from the highest levels of security available, by mandating a
stronger security level than the NIST guidance and therefore ahead of the industry
norm. From 1st January 2011, GlobalSign introduced RSA key size requirements
to no longer accept 1024 bit Certificate Signing Requests (CSRs). This thinking
was aligned with the decision, back in 1998, to create a 2048 bit Root Certificate
and therefore a full 2048 bit hierarchy of services including issuing CAs, CRLs and
OCSP responders.
NOTE
Refer to Security Architect Document Annex Communication Guide for more
information.
Quick Reference
Function Calls The functions listed in Table 1 are arranged by device or purpose. Refer to the
function description for associated parameters, valid error conditions, and details
on how and when to use the function. In the online version of this manual, click the
page number to jump to the function description.
Table 1 Function Calls
Function Call Description Page
Secure Installer
Secins_install_pkgs() Installs packages from the download file. 87
Secins_reboot() Reboot the device. 88
Secins_start_user_apps() Used by sysmode to start user applications. 89
Secins_start_app() Used by user applications to start other user 90
applications.
Secins_read_pkglist_entry() Retrieves a list of installed packages. 91
Secins_close_pkglist() Closes the list of installed packages. 93
Secins_strerror() Returns a pointer to the error message associated 94
with the err non-zero error code.
Secins_share_gid() Returns the group ID (GID) for the share group. 95
Secins_system_gid() Returns the GID for the system group. 96
Secins_users_gid() Returns the GID for the users group. 97
Secins_user_app() Returns the application user usr1–16. 98
Secins_sys_app() Returns the system user sys1–sys16. 99
Secins_sysmode_share_gid() Returns the sysmode share GID for the calling user. 100
Secins_config_file_share_gid() Returns the sysmode share GID for the specified 101
config file.
User/Groups
Secins_get_uid_gid_range() Retrieves the range of users and groups assigned 103
to the calling primary user.
Secins_add_group() Adds a group. 104
Secins_add_user() Adds a user. 105
Function Call Error Error codes for V/OS are listed in Table 2.
Codes
Overview
V/OS is the next-generation Linux OS. Initial V/OS platforms are based on the
Linux kernel 2.6.31.
LED
Display
Bluetooth
Printer
CTLS
USB
COM Ports 1–4 VX 675 COM ports are via
dongle or when docked in
the docking station.
COM Port 6
RT Clock
Mag Stripe
Audio
Touch
Tailgate
IPP
ISDN
Modem
GPRS
WDE
Multi-App
Function Calls
Input Events
Crypto Lib
IPP Legacy
Wi-Fi
C/C++ Compiler The C/C++ compiler and development tools can be purchased through Verifone
and Tools and comprise a customized version of the Mentor Sourcery CodeBench DTK. The
CodeBench DTK is a Windows-based IDE with an integrated debugger. Verifone
distributes a separate SDK that includes the libraries, headers, and tools specific
for developing V/OS-based devices.
Symbolic A source code symbolic debugger for debugging application programs will be
Debugger included in the Eclipse Integrated Development Environment. The debugger
utilized is the open source GNU Debugger (GDB).
Boot-up Sequence When the V/OS terminals boot up and the Linux U-Boot loader completes loading,
the following occurs:
1 The kernel initially boots using initramrfs.
2 The symlink /init in initramrfs is loaded. This is the symlink to the first-
stage Secure Installer (SI), which authenticates and builds the final root file
system (RFS).
3 A switch root operation occurs that makes the mounted tmpfs the root file
system (RFS).
4 The second-stage Secure Installer starts in this new RFS.
Environment and Linux has long had the concept of environment variables (also called
Configuration configuration variables). Unfortunately, environment variables are not permanent
Variables and Linux normally requires a shell script that sets the environment variables prior
to their use.
getenv() and putenv() are native functions to Linux. Use putenv() to set/change/
delete an environment variable. These values do not persist after a power failure.
V/OS terminals support the enhanced APIs getEnvFile() and putEnvFile() to get or
set environment variables in the flash file system.
File Format V/OS terminals use a standard file format to store configuration variables. The file
stores ASCII information in .ini format For example:
[perm]
i4683=R232
o4683=01234567
[reg]
store=sportworld
appid=1234
ini files consist of section headers (defined within []) followed by keys (or labels)
and their associated values. For example, appid is a key with value 1234 and it
resides in the reg section. By default, all configuration files have two sections,
perm and reg.
To aid compatibility with previous terminals, all keys that begin with ‘ * ’ a
automatically placed in the perm section, provided the section parameter is a
pointer to an empty, null-terminated string (that is, empty quotes " ") The leading
‘ * ’ character is not actually stored in this case. It is only there to indicate to store
or retrieve the label field from the perm section.
If a section is specified, then the value field is stored as it is given to the function,
including any ‘ * ’ character. This also applies even if the section is specified as
perm. It is only if an empty, null-terminated string is specified for the section that
leading ‘ * ’ characters are ignored.
All created sections and label entries are converted to lowercase before being
stored to eliminate case sensitivity. The getEnvFile() and putEnvFile() functions
always convert to lowercase before searching or storing.
The value field is case-sensitive and is always stored as passed to the functions.
There are certain reserved characters with the INI parser library that cannot be
used in section, label, or value fields, and certain characters are not
accepted. All other characters can be used, including non-printable ASCII
characters. Refer to the INI parser HTML document included in the SDK for how
the INI parser works and what is supported. In addition to that documentation, the
following characters are reserved and cannot be used within one or more of the
fields of the environment variable or have special rules concerning them:
NOTE
No configuration file environment variables actually reside in the current shell
environment.
getEnvFile()
Prototype
int result = getEnvFile(char *section, char *label, char *value,
int vlen);
Parameters
section Points to a null-terminated string containing the .ini file section
name. Maximum length of the section name is 32 bytes.
Note: If section is a pointer to null, the system automatically
reads from with perm or reg sections. perm is selected
if the first character of label is an “ * ”, otherwise the reg
section is used.
Return Values
>0 Length of value
putEnvFile()
Prototype
int result = putEnvFile(char *section, char *label, char *value, unsigned
short vlen, unsigned short options);
Parameters
section Points to a null-terminated string containing the .ini file section
name. Maximum length of the section name is 31 bytes.
Note: If section is a pointer to null, the system automatically
reads from the perm or reg section. perm is selected if
the first character of label is an “ * ”, otherwise the reg
section is used.
Return Values
=0 No error
System The following table of configuration variables are read by the system on power up
Configuration and reboot. These configuration variables must be set in the usr1 account.
Variables Variable Name Values Definition
*GO Executable name The path /home/usrx
(where x is the user that the
package was signed and
installed as) is pre-pended
to the value set in *GO.
Example:
*GO=myapp
The system will attempt to
execute the file:
/home/usrx/myapp
Note that Linux is case-
sensitive.
*DHCP Non-zero If *DHCP is present and the
system supports Ethernet,
then it attempts to initialize
its connection using DHCP.
*DHCPID Unique ASCII string Use the Client ID as the
identifier in DHCP. By
default, the MAC address is
used as the identifier by the
protocol.
*DNCPHOST Variable ASCII string Use this Hostname option to
name of the DHCP client.
*ETHERSPEED “100F”, “100H”, “10F”, or Use to override full auto
“10H” negotiation of Ethernet
device eth0 by advertising
the value as the maximum.
10 or 100 Mbps are the
speed and F or H are full or
half duplex mode,
respectively.
The default is to auto-
negotiate with all capabilities
up to 100H.
*IFCONFIG Per Linux – No need to Use either *DHCP or
set MAC address as the *IFCONFIG.
system will do this for
you. See the TCP/IP
Ethernet chapter.
*GATEWAY IP Address in the form Use to define the address of
xxx.xxx.xxx.xxx the gateway (router).
*TELNET 1 If *TELNET is present and
the system supports
Ethernet, then it starts the
Telnet server daemon.
Max = 128
*SYSLOG_MARK Default = 30 Specifies when a “MARK”
Min = 10 timestamp marker is placed
in the syslog messages file.
Max = 1440
Off = 0
*SYSLOG_RHOST Default = null Specify a remote IP address
to send syslog messages
using a UDP network
connection.
*SYSLOG_ROTATE Default = 2 Number of rotating log files.
Min = 0
Max = 3
Secure Installer
The Secure Installer is a root process responsible for installing all files on the
system, starting user applications, and providing a basic message interface for
running applications to access some root services for example, reboot.
All files to install on the system must be contained in signed packages within
signed bundles. The root file system (RFS) is in DRAM and all signed software
packages are stored in flash. Software packages are authenticated and extracted
to the RFS at every boot up.
Software An important distinction is made between the install packages that reside in the
Installation system itself, and the files used to download those packages to the terminal:
• A signed package (that is, the package file and its p7s signature file) can only
be downloaded in a signed bundle.
Install Packages Install packages are designated OS, System, or User, as identified in the control
file. Each install package type is authenticated using a filetype value, and only
authorized signers can install a package.
For example, OS packages are authenticated using file type '0'. If the signer
certificate does not contain filetype '0', authentication fails and the package is
rejected.
OS Packages
OS packages are signed by the OS signer and authenticated using the filetype
'0' in the control file. Standard OS package types create the RFS in DRAM. OS
package types extract to the RFS directory (/). All files and directories in the
package must be relative to this directory (/). File ownership on all files in the
package after extraction to the RFS is root:root (the owner is root and Group:
root). Use rc scripts to start system processes, as usual.
Signed osflash package types are extracted to flash at /mnt/flash. Use this
package type for large media files, fonts, and so on. These file types can be
authenticated and extracted to flash one time only. Executable files and libraries
cannot be loaded in this way.
The lowlayers package type upgrades the low layers such as sbi, uboot, vault,
kernel, and initramfs.
app Packages
app packages are signed by an App signer and authenticated using the filetype
corresponding to the user indicated in the package control file. For example, use
filetype '1' for user usr1, filetype '2' for user usr2, and so on through filetype
'16' for user usr16. This implies that user information is contained within the
package.
The user app package type is extracted to the relevant user home account
created in DRAM at boot up. The files extracted to the home account are owned
by the relevant user. User packages contain a start file that indicates which
applications to automatically start. Once all app packages extract to the RFS,
Secure Installer starts the user applications.
The package types user, userflash, config, flashconfig, and service,
are supported. The flash directory for system applications is:
/mnt/flash/userdata/<username>
where, <username> is the user usrx value. For example, for usr1, the flash
directory is: /mnt/flash/userdata/usr1
Downloads Secure Installer does not download packages to the unit; it installs download files
downloaded by the sysmode application or other user applications. Signed
packages must download in a download file. Secure Installer processes download
files placed in the /mnt/flash/install/dl directory, which has open write
permissions.
Secure Installer processes a download file and installs all included packages in
flash. If the system is running during this process (for example, if an application
downloads a file and calls the Secins_install_pkgs()), running applications are not
affected. Newly installed packages are not extracted to DRAM or flash (for
'userflash' package types) until a reboot or the application calls
Secins_start_user_apps().
Since the DRAM tmpfs executes in place, extracting newly installed DRAM
packages while applications are running could cause serious problems.
'unsigned' package types are the only exception, as they only extract in the User
flash directory designated in the control file.
Flash Directories Directories in flash include the user flash directories previously described, plus the
log and share directories.
The log directory contains directories for each user on the system to store log
files. Secure Installer creates a 'logs' symlink in the User home account, pointing
to the User log directory. Ensure that log file symlink references are relative to the
home account. There is also the common /mnt/flash/logs/share directory
that all users can access.
The share directory /mnt/flash/userdata/share is accessible by all app
users (usr1–usr16).
Users and Applications can run as different users so that the files belonging to different
Groups applications can remain private. Several applications can also run as the same
user.
To be able to easily move your application to a different user, do not make
assumptions about its user name and home account. Follow these guidelines:
• Only use relative pathnames when referencing files in the home account. Do
not use absolute pathnames.
Assign Users All install packages must be signed. With Pedguard there can be only one
application sponsor, but there can be multiple application signers in a terminal. A
single application signer can have multiple signer cards.
The install package indicates the user that the package is installed as (for
example, usr1, usr2, and so on). usr1 is assumed if no user is specified. The
filetype directly relates to the user the package is installed to. Filetype '1' is usr1,
filetype '2' is usr2, and so on.
The system determines the User account using the App signer certificate and the
application install package. The User account can only be reassigned by changing
the specified User value in the control file and downloading a new signed install
package. The package filetype is passed to authenticate() during authentication,
so the signer certificate must allow the filetype specified in the install package.
Authentication fails otherwise.
Ensure that app signers, in particular those whose applications may run
side-by-side on the same terminal, have a different range of filetypes specified in
their certificates. This makes it impossible applications to run as the same user. If
every app signer uses filetype '1' and two are required to run on the same
terminal, the install package must be changed to indicate a different user and re-
signed.
This scheme guarantees that applications signed by different app signers will run
as different users, as long as the app signer certificates have a completely
different range of filetypes specified. For example, if two application developers
have applications that are required to run side-by-side on the same terminal, one
should have the signer assigned filetypes '1' … '4', and the other use filetypes
'5' … '8', to ensure that their applications can never run as the same user.
NOTE
Both signers must share a common app sponsor, so that the sponsor can control
the filetypes assigned to each signer.
Assign Groups Secure Installer uses a user-private-group scheme when assigning users to
groups. When a new user is added to the system, a user private group is created.
This group has the same name as the user and that user is the only member of
that private group.
There is also an App signer group created for each App signer. The system
contains two application signer groups: users for customer/user applications,
and system for system applications. All users belonging to a particular App signer
are automatically a member of that App signer group. For example, users usr1,
usr2, …, usr16 are members of the users group, and users sys1, sys2, …sys8,
are members of the system group.
There is also the common group, share. All users, usr1–usr16 and sys1–sys16,
are members.
Install packages indicate whether to install its contents using the user private
group (default), the App signer group (system or users), or the share group. To
allow a file be readable by other applications in your App signer group (but not
readable by all), requires that the file is installed using that App signer group. So,
from the install package point of view the possibilities are:
• Package group not specified: use the user private group.
• Package group specified can only be one of the following:
• Matches the user pseudonym specified in the package, which uses the
user private group.
• Specify the users group for customer applications or the system group for
system applications using the App signer group.
• Specify the share group to share files with all installed applications.
For example, if the install package control file specifies user user1 and no
group is specified, then User is usr1, /home/usr1 is the home directory, and the
group defaults to usr1. If the App signer group is specified and install package
control file specifies user usr1, then /home/usr1 is the home directory and the
group is users.
Shared Libraries A normal application install package can include shared libraries, which are
extracted to the user home directory (or a sub-directory, depending on package
layout). To enable these libraries to be automatically picked up by the loader,
secure installer uses ldconfig to ensure that the lib directory in the user home
directory is automatically searched for shared libraries.
If the home directory is /home/usr2, /home/usr2/lib is searched, and the
libraries in there are automatically picked up by the loader.
Note that while the lib directory in the home accounts of all users on the system
are searched for shared libraries. Normally, a user does not have permissions to
read libraries in other users’ home accounts. If a particular app signer wants to
allow different users access to shared libraries, they must be installed as the
group “users.”
LD_LIBRARY_PATH cannot be reliably used on V/OS (see File Capabilities,
page 69). To ensure that the lib directory in the user home directory will be
searched before any system directory or any other user home directory, use the ld
linker option rpath, to specify the runtime library search path of the particular
program being compiled. To invoke the rpath option, from gcc:
-Wl,-rpath,lib
Packages Install packages contain the file system content as defined for that package type.
Install packages must be signed. Install bundles contain install packages and their
associated p7s file (they may also contain a remove file). Install bundles must also
be signed. Install bundles and their associated p7s files are combined into a single
download file.
Install Packages The install package is a tar ball and must not be compressed. This allows
packages to extract to DRAM quickly, and also means that you can use bsdiff for
efficient patching. All packages must be signed, and must be accompanied by a
p7s signature file. The package filename is not important but the signature must
have the same filename as the package file with the .P7S or .p7s extension.
The directory structure and files in the tar-ball are as they will appear in RFS after
installation; relative to / for OS-signed packages, and relative to the user home
account for App- or System-signed packages.
The CONTROL directory must exist at the top-level of the tar-ball directory
structure. It must contain the control file. Other files that can be in the CONTROL
directory are the start, grsec, and env files.
Package Control The package control file is a text file that contains information relating to the
File package. The format is individual lines in the form Field:value. Place the package
control file in the package CONTROL directory. The fields listed in Table 4 are
supported.
NOTE
The field and value strings are not case sensitive.
Category defaults to fs, Type defaults to os, and user defaults to root.
• user packages: For normal user package downloads, either User or Type
must be specified.
Package: testapp
Version: 1.00
User: usr1
Type: user
Package Start File The start file in the CONTROL directory lists applications to automatically start for
that package. Each line is a command line used to start an application. Note that
command lines are parsed by Secure Installer and not in a bash shell. Special
characters normally handled by the bash shell (such as, &, |, ;, and so on) have no
significance. Command lines can include environment definitions and arguments,
as well as the executable name.
Example
myapp -port /dev/ttyS0
testapp
Package env File Use the env file in the CONTROL directory to set up the user application
environment. This file is in ini file format. Environment definitions in the global
section are passed to every app started for the package. Environment definitions
in sections that match the executable name are passed to the relevant
application. For example:
[global]
DEBUG=off
PLATFORM=Fusion
[myapp]
DEBUG_LEVEL=1
Package grsec File The grsec file in the CONTROL directory sets up the grsecurity policy for an
application. This file is in ini file format. This file should contain a section for each
executable that requires access to system resources other than those contained
by default in the User account.
An application will, by default, have full grsecurity access to its home account and
flash directory.
Applications can access system libraries, some standard devices (such as,
/dev/null, /dev/urandom, and so on). The grsec file must request access to
resources not allowed by default. These are checked against the user policy.
Capabilities can also be requested in the grsec file. No capabilities are allowed by
default. For example:
[myapp]
/dev/ttyS0 rw
+CAP_SYS_TIME
[testapp]
/dev/mag r
grsecurity grsecurity is a set of patches for the Linux kernel with an emphasis on enhanced
security. One component of grsecurity is the full role-based access control
(RBAC) system. RBAC is an approach to restricting system access to authorized
users. To restrict access to files, capabilities, resources, or sockets to all users,
including root, you must have an RBAC system. grsecurity creates a “least-
privileged” system, where users and processes have the absolute minimum
privileges to work and nothing more. This way, if the system is compromised, the
ability by an attacker to damage or gain sensitive information on the system is
reduced. See http://grsecurity.net/ for information.
grsecurity Policy In grsecurity, the RBAC system is managed through a policy file (/etc/grsec/
File policy), which contains a system-wide set of rules. Secure Installer is
responsible for enabling grsecurity on the system, and since it is Secure Installer
that adds all users to the system (based on the information in the install
packages), it must also set up the grsecurity policy file based on the information in
the packages.
For each user added to the system, Secure Installer adds a user role to the
system policy file. This user role consists of:
• The default subject (subject /) that lists the objects and object modes
available to the user by default.
• Other subjects can be added by the user through the install package grsec file.
For example, if the user application “myapp” required a capability such as
CAP_NET_RAW, which is not included in the default subject, it can include the
following in the package grsec file:
[myapp]
+CAP_NET_RAW
Secure Installer adds a subject to the user role for myapp. For example, for
usr1 it would be in /etc/grsec/policy as:
subject /home/usr1/myapp
+CAP_NET_RAW
The install package grsec files are subject to strict checking. User subjects are
only granted access to objects already deemed appropriate for users. For
example, if a user has +CAP_SYS_ADMIN or / rw' in its package grsec file, it will
not be allowed.
NOTE The default role should cover the vast majority of what a standard user requires
access to on the system. So, in most cases a grsec file is not required in an
install package.
File Capabilities Capabilities allow applications to define user processes in lieu of using root
processes. For example, to set the system time, the application can pass the
capability CAP_SYS_TIME. File capabilities are implemented using the file
system extended attributes, and are assigned based values in the grsec file.
If the grsec file requests a capability that is allowed by the user policy file, then
that capability is added to the system grsecurity policy file and Secure Installer
adds the corresponding file capability to the executable (in the dramfs) before it is
started. Only applications that Secure Install starts directly can ever be assigned a
capability. That is, if a user process starts another process using system() or
fork/exec, then it can never be assigned a capability.
LD_LIBRARY_PATH is bypassed for processes that run with escalated privileges,
whether setuid or capabilities, because someone could overlay some of the
functions which the executable calls with malicious code. Because of this
LD_LIBRARY_PATH is not supported, and Secure Installer does not set this
variable in the environment for any user process. See Shared Libraries.
File System Content The following describes package types in the fs category, which is the default
Packages category. If specified, the Category field is set to fs for these package types.
NOTE
The Package and Version fields must be present in the control file for all fs type
packages.
OS Packages OS packages extract relative to root (/) and form the DRAM file system.
OS packages must be signed by the OS signer, and have the Type field set to os
in the control file. The system considers this is the default package type when
User is not specified. If User is root ,Type defaults to os.
Secure Installer does not start processes automatically for OS packages as it
does for user packages. You must start processes using Linux start-up scripts (for
example, rc.d).
In the following example OS package, the tar-ball installs files to
/usr/local/lib and /usr/local/sbin. Type defaults to os, therefore User
defaults to root.
Example OS package
|-- CONTROL
| `-- control (see below)
`-- usr
`-- local
|-- lib
| |-- libvfirkl.so -> libvfirkl.so.1
| |-- libvfirkl.so.1 -> libvfirkl.so.1.1.3
| `-- libvfirkl.so.1.1.3
`-- sbin
`-- rklload
osflash Packages osflash packages extract relative to /mnt/flash. osflash packages be signed by
the OS signer, and have the Type field in the package control file set to osflash.
Once extracted, the package tarball is removed from the system (since flash
package types are only required to be extracted once). However, the package
control information remains, so flash packages can be updated and/or removed
like other packages.
In the following example, the package tar-ball installs files to
/mnt/flash/system/images/ctlsl2.
Type must be osflash, and User defaults to root.
| `-- yellowled.png
`-- Decker.ttf
lowlayers Packages lowlayers packages extract to a temporary location for processing. lowlayers
packages must be signed by the OS signer, have the Type field in the control file
set to lowlayers. Once processing completes, the package is removed. Table 5
lists allowable contents for lowlayers packages.
Table 5 Acceptable lowlayers Package Files
File name Description
uuImage Used to update the Linux kernel and signature.
uuImage.p7s
uuImage.patch uuImage.patch runs first to patch the existing uuImage file,
uuImage.p7s creating a new uuImage file. uuImage.p7s is the signature file
for this new uuImage file. The signature is verified and
uuImage installs to verify that the patch applied successfully.
Full uuImage updates or patches can be contained in
lowlayers packages; not both.
ext-initramfs.img Used to update the initramfs and signature.
ext-initramfs.img.p7s
ext-initramfs.img.patch ext-initramfs.img.patch is run to patch the existing ext-
ext-initramfs.img.p7s initramfs.img file, creating a new ext-initramfs.img file. ext-
initramfs.img.p7s is the signature file for the new ext-
initramfs.img file. The signature is verified and ext-
initramfs.img installs to verify that the patch applied
successfully.
Full ext-initramfs.img updates or a patches can be contained
in lowlayers packages; not both.
*.cib Used to update the CIB file.
cib.* Used to update the alias CIB file.
sbi.* Used to update the SBI file.
ssbi.* Used to update SSBI file.
vault.* Used to update the Vault file.
u-boot.* Used to update u-boot file.
user Packages user is the default package type when the User field is specified and is not root. If
present, the Type field in the package control file is set to user. user packages
extract to the User home account in the DRAM file system. These packages
contain the executable and data files required to run user programs. Directory
structure is not important, as all paths are relative to the User home account.
Set the User field in the control file to determine the user for the installation. This
also determines the location and ownership of the files when extracted to DRAM;
App signed files use usr1 through usr16. System signed files use sys1 through
sys16. usr1 is the default user.
The Group field determines the group ownership. This defaults to the user private
group associated with the package (for example, Group: usr1 for User usr1).
Use Group: users or Group: system to share files with other users of the
same application group (that is, application users or system application users,
respectively). Use Group: share to share the files in the package with all users.
Multiple packages are required to install files requiring different group ownership.
User library files can also be in User packages, but to be picked up automatically
must be placed in a lib directory in the user home account (that is, a lib directory in
the install package).
Secure Installer automatically starts any processes listed in the start file in the
CONTROL directory.
In the following example user package, the package tar-ball installs the testapp
file in the user home account /home/usr1, and creates the directory lib that
contains a library and symlinks.
userflash Packages userflash packages are App signer packages to download large data files to flash.
userflash packages cannot contain executable files. This package is only
extracted to flash once, and then it is deleted.
Set the Type field in the package control file to userflash. Set the User and
Group fields the same as user packages. File ownership and location are
determined on extraction by using a symlink reference to the user home account
in flash.
In the following userflash package example, the package tar-ball installs a theme
in the flash directory for the user home account, which is the symlink
/home/usr1/flash (a pointer to /home/usr1/userdata/usr1). User
defaults to usr1. Group defaults to the user private group, also usr1.
`-- themes
`-- themes
|-- Contemporary
| |-- background.png
| |-- banner_bg.png
| |-- button_100d_normal.png
| |-- button_100d_pressed.png
| |-- button1.png
| |-- button1_pressed.png
| |-- button_ok_normal.png
| |-- button_ok_pressed.png
| |-- customer_logo.png
| |-- fonts
| | |-- Vera_Bold.ttf
| | |-- Vera_Italic.ttf
| | `-- Vera.ttf
| |-- keypad_numeric_normal.png
| |-- keypad_numeric_pressed.png
| |-- keypad_textbox_bg.png
| |-- metrics.fpt
| |-- Pen.png
| |-- preview.png
| |-- Thumbs.db
| |-- verifone_logo.png
| `-- wip04-131633cd-2.wav
`-- theme.txt
service Packages Service libraries must be accessible by both user and svcmgr processes, which
typically run as a system user. svcmgr looks in a single location for all services:
/usr/local/lib/svcmgr. The service package installs to this directory.
Set the Type field in the package control file to service. The User and Group
fields are the same as the user packages, and determine file ownership once
extracted. Note however that the default Group value for service packages is
share. service packages are authenticated and extracted to DRAM on every
boot-up.
In the following service package example, the tar-ball installs libraries in
/usr/local/lib/svcmgr. User is set to sys2. Group defaults to share.
config Packages This App signer package downloads global configuration files (that, is config files
that must be accessible to many users). config packages extract to the directory
/etc/config, and are authenticated and extracted to DRAM on every boot up.
Set the Type field in the control file to config. The User and Group fields are
the same as the user packages, and determine file ownership once extracted.
In the following config package example, the tar-ball installs config files in
/etc/config. User is set to sys2. Group is set to share.
flashconfig flashconfig packages are similar to config package types, but because it is a flash
Packages package, it is authenticated and the contents extract to flash only once. The
contents extract to /mnt/flash/etc/config, and the package is removed.
Use flashconfig packages for config files that you want to download and change
afterwards (for example, write to).
Set the Type field in the package control file to flashconfig. The User and
Group fields are the same as the user packages, and determine file ownership
once extracted.
vss Packages Use vss packages to download and install VSS scripts.
NOTE VSS scripts are authenticated using filetypes A, B, C, through P for users
usr1–usr16, respectively. The signer certificate must have the same filetype
enabled.
Because VSS scripts cannot be modified by the User but must be readable by that
User, they are owned by root with the group ownership set to the User private
group of that User. vss packages extract to /etc/vss/<username> (where,
<username> is determined by the package user: usr1, usr2, and so on), and are
authenticated and extracted to DRAM on every boot-up.
Set the Type field in the control file to vss.
In the following example vss package, the tar-ball installs vss script files in
/etc/vss/usr1. User defaults to usr1.
| `-- control
`-- ldckkeys.vso
unsigned Packages unsigned packages always extract to the User’s flash directory. They are not
signed or authenticated. They contain user data extracted by Secure Installer to
allow these packages to download in the download file with signed installer
packages.
NOTE unsigned packages are not signed and cannot be inside a bundle, which is
always signed. They must be at the top level of the download file, which can also
contain signed bundles.
The compressed tar-ball must contain a CONTROL directory and control file. The
Name, Version, and Type fields are required. Set the Type field to unsigned.
The User and Group fields are the same as the user packages, and determine
file ownership once extracted.
NOTE
unsigned packages can only be installed by the User they are targeted for. They
must be downloaded by the user application. Do not use sysmode.
Secure Installer does not keep a log of unsigned packages in the installed
package list.
In the following example unsigned package, the files install in/usr1.
userfont Packages This app signer package installs a system-wide font to flash. The Type field in the
package control file must be set to userfont. The User and Group fields are the
same as the user packages in that they determine ownership of the files on
extraction. The default Group for the userfont packages is the share group.
userfont packages extract to /mnt/flash/system/fonts only once, and then
it is deleted.
patch Packages Use patch packages to patch or update installed packages. The result is a new
version of an existing package.
Set the Category field in the control file to patch. The Type, Name, and
Version fields of the patch package must match those fields for the target
installed package. The Name and Version of the updated package are available
to Secure Installer after the patch is applied.
Along with the control file in the CONTROL directory, patch packages must
contain the following two files at the top level:
• A patch file generated using bsdiff
• A signature file update for the new package
In the following example patch package, the myapp-1.0.0.tar and signature file
myapp-1.0.0.tar.p7s. files update with myapp-1.0.1.tar and signature
myapp-1.0.1.tar.p7s. User is set to user.
When generating a patch file with bsdiff, use the exact package file as installed on
the target rather than new one, as it may not be exactly what was previously
released (for example, if the UID/GID information is different).
Install Bundles All install packages (and their associated p7s signature files) must be contained in
a signed bundle. A bundle can contain multiple packages. Bundles allow sets of
packages to download at the same time, and ties these packages to the optional
remove file.
The install bundle is a compressed tar-ball. Use gzip or bzip2 compression.
Bundles must be signed and be accompanied by a p7s signature file. The
signature file must have the same file name as the bundle file with a .P7S or .p7s
extension.
To authenticate bundles, the filetype and user must be specified. The bundle
must contain the control file in CONTROL/control, which must specify the Name,
Version, and User.
Since a bundle is authenticated with a specified filetype, a bundle can only
contain install packages for a single user. Other user packages are not allowed
within that bundle. Download files can contain multiple bundles for different users.
An install bundle can contain one or more of the following.
• Install packages and associated signature files
• Signer certificates contained in the crt (or CRT) sub-directory.
Since install packages are signed and require a certificate for authentication,
signer certificates cannot be contained within a signed package. Certificates
found in the install bundle are processed before the install packages.
• The package remove file
NOTE Remove files are only required in special circumstances, such as when
completely changing the installed application set. If the download is simply
updating existing packages or adding packages, the remove file is not required.
The package remove file removes packages and is processed before any
install packages. Once the install bundle file is in flash (assuming it is signed
properly), it installs (immediately or on the next boot up). It is safe to process
the remove file before the packages are processed.
The remove file is tied to a particular set of install packages by being in the
same signed bundle. For example, if a remove file contains a command to
remove the entire OS, then the bundle must also contain a new set of OS type
packages to install. The user and system signers cannot remove packages
installed by other signers. The OS signer can remove all installed packages.
Bundle Control File The bundle control file is a text file that contains information relating to the bundle.
The format is individual lines in the form Field:value. Place the bundle control file
in the bundle CONTROL directory. The fields listed in Table 6 are supported.
Table 6 Bundle Control File Fields
Max
Field Description
Length
Name 24 Name of the bundle (required). The Package field can
alternatively be used. The Name and Package labels are
inter-changeable.
Version 16 Bundle version (required).
User 8 Bundle user. This field is required for all bundle types, except
OS bundles. Defaults to OS if not specified.
Category 16 Bundle category (optional).
• fs – file system content, including the standard OS,
system, and user packages. (default). Defaults to fs if not
specified.
• patch – update to installed bundle
By definition the fs bundle is complete. patch bundles are an
update to an existing bundle but do not contain the complete
content for that bundle, and therefore require that a previous
version of the bundle is already installed on the system.
SrcVersion 16 Contains the version of the bundle being patched. This field is
required in patch bundles.
Date 10 Bundle creation date in the format: YYYY-MM-DD (optional).
Option 64 Additional information (optional).
Type 16 Set this type field value to signed if used (optional). Defaults to
signed if not specified.
patch Bundles While fs (file system) bundles are considered complete and entirely replace
previously installed versions, patch bundles are considered an update to existing
bundles, and must only contain the differences between the new bundle and
bundle being updated. patch bundles always require that a previous version of the
bundle is already installed on the system.
There are two options for updating existing installed bundles:
• Download the entire fs bundle.
• Download only changed packages in the bundle.
If one of the testapp packages is updated, the three options for version 1.0.1 of
this bundle are as follows.
Example fs option
control file contents: Package: testbundle
Version: 1.0.1
User: usr1
|-- CONTROL
| `-- control
|-- crt
| `-- appsigner.crt
|-- testapp1-1.1.0.tar
|-- testapp1-1.1.0.tar.p7s
|-- testapp2-1.0.3.tar
|-- testapp2-1.0.3.tar.p7s
|-- testconfig-1.0.0.tar
`-- testconfig-1.0.0.tar.p7s
|-- CONTROL
| `-- control
|-- crt
| `-- appsigner.crt
|-- testapp2-1.0.3.tar
`-- testapp2-1.0.3.tar.p7s
|-- CONTROL
| `-- control
|-- crt
| `-- appsigner.crt
|-- testapp2-1.0.3-patch.tar
`-- testapp2-1.0.3-patch.tar.p7s
Remove File The optional package remove file in an install bundle is a simple text file that
contains commands, one per line, interpreted by Secure Installer. If using the
remove file, place it at the top-level of the compressed bundle file–not in a sub-
directory and not in the package tar-ball.
If a remove file is required it is part of the bundle along with the signed packages.
Because the bundle is signed, the remove file and set of packages with it cannot
be separated.
Only the following commands are supported. Certain commands are only
available to the OS signer.
• removeall
removeall [os | sys | user ] [<user>]
• If the value for the first argument is sys or user and the second argument
is omitted (for example, removeall sys or removeall user), all
system or user signed installed packages, respectively are removed.
• If the value of the first argument is sys or user and the second argument
is specified (for example, removeall sys sys1 or removeall user
usr1), all packages for the specified user are removed.
Other users can only remove packages they own. The removeall arguments
are ignored.
• removepkg
removepkg <Package> [<Version>]
Only removes the specified package from a bundle containing a remove file.
Only use removepkg to remove packages between different versions of the
same bundle. If Version is specified, only that version of the specified
package is removed (if found). Any signer (OS, system, or user) can only
remove packages installed by that signer.
• removeconfig
removeconfig <user>
Removes legacy config files (for example, config.usr1) for the specified user.
• removelogs
removelog <user>
Deletes the contents of the log directory for the specified user.
• removeshare
removeshare
Deletes the specified bundle. All packages in that bundle are removed. If
Version is specified, then only that version of the specified bundle is
removed (if installed). Any signer (OS, system, or user) can only remove a
bundle installed by that signer.
• removepkg
removeshare
Download Files Install bundles and their associated signatures must be presented to Secure
Installer (that is, they must download to the user directory) in a single compressed
tar-ball. The download file can be a plain tar archive or a compressed tar-ball.
Either gzip or bzip2 compression can be used. Download files only contain
compressed install bundles and their associated signature files. Do not place
single App package or install package files at the top level of the download file.
82 V/OS PROGRAMMERS MANUAL
S ECURE I NSTALLER
Create Install Packages and Bundles
Installed Packages Users must use the libsecins call Secins_read_pkglist_entry() to get the installed
package list info.
Create Install The process to create and install packages and bundles is:
Packages and 1 Generate the install package.
Bundles
2 Generate the install bundle.
Note that the remove file is always part of the bundle, and not part of the package.
The CONTROL directory or control file are not necessary if the User name is
included in the bundle filename. Since the package user is not specified in the
control file, the default User is usr1. In this example, the bundle contains a single
package. In the bundle directory, use the following command to create the bundle:
$ cd bundle
$ tar czf ../USR1.testapp-1.02.tgz *
$ cd ..
Sysmode Secure Installer deals with install packages, but does not make any distinction
Application between different packages within a particular signer group, for example, all OS
packages are treated alike, as are all sys and user packages. Secure Installer
does not differentiate between different user or system processes. It starts
applications as directed in the control files.
Secure Installer must first start the sysmode application, if there are no user
applications to start. Similarly, if sysmode is manually started when user
applications are running (on VX 520 terminals: press the 1, 5, and 9 keys; on
Ux300 terminals: press the recessed sysmode button on the back of the device),
those applications must be stopped and sysmode started. To facilitate this, the
sys4 system user is reserved for sysmode. Secure Installer treats this user
differently. On start up when starting installed system applications, sys4
applications are not started automatically. If there are no user applications to start,
Secure Installer starts all sys4 applications (if present).
When the sysmode is manually started, Secure Installer stops all running user
applications from users usr1–usr16, and then starts the sys4 applications.
V/OS PROGRAMMERS MANUAL 85
S ECURE I NSTALLER
Secure Installer Functions
Main sysmode menu access is restricted. There are four user accounts defined:
• Supervisor
• Level 1
• Level 2
• Maintenance
On productions units the first time an operator logs in, they are prompted to enter
the default password and then enter a new password. Passwords must be a
minimum of five digits, and a maximum of 8 digits. During development, each user
account can be accessed using the default password 166831. If the user cannot
log in, cancel is the only available option.
See
Secure Installer Once the system is up, Secure Installer remains running and provides a message
Functions interface to allow user applications to access certain root services (for example,
reboot). The libsecins.so shared library allows access to the functionality
provided. Function prototypes, error codes, and so on are in libsecins.h.
This section describes the current function calls. Unless otherwise noted, return
values are 0 on success or an appropriate error code (see Error Codes).
Secins_install_pkgs()
Prototype
int Secins_install_pkgs(int *reboot_reqd);
Parameters
reboot_reqd If reboot_reqd is not null, Secure Installer sets it to 1 if a reboot is
required after installation completes (for example, if an OS package
was installed); otherwise it is set to 0.
Secins_reboot()
Reboot the device. This call first send SIGTERM to all user processes, followed by
SIGKILL.
Prototype
int Secins_reboot(void);
Secins_start_user_apps()
Used by sysmode to start user applications. This call stops sysmode sys4
processes before starting user processes.
Prototype
int Secins_start_user_apps(void);
Secins_start_app()
Prototype
int Secins_start_app(const char *file);
Parameters
file Executable to start.
Secins_read_pkglist_entry()
Prototype
SecinsPkgInfo *Secins_read_pkglist_entry(SecinsPkgInfo *pkginfo,
int pkginfosize);
Parameters
pkginfosize Set to the size of the pkginfo buffer.
Return Values
On success, pgkinfo returns. NULL returns when no more entries are available.
Example
This example prints the installed package versions.
static void print_pkg_versions(void)
{
SecinsPkgInfo pkginfo;
fprintf(stderr, "Package Versions\n");
while (Secins_read_pkglist_entry(&pkginfo, sizeof pkginfo) != NULL)
{
fprintf(stderr,
"%s %s %s %s %s\n", pkginfo.name, pkginfo.version, pkginfo.user,
pkginfo.signer, pkginfo.type);
}
fprintf(stderr, "\n");
}
Secins_close_pkglist()
Prototype
void Secins_close_pkglist(void);
Secins_strerror()
Returns a pointer to the error message associated with the err non-zero error
code, which must have returned from a Secure Installer call. Use Secins_strerror()
when a libsecins call returns non-zero for a verbose message associated with the
failure.
Prototype
const char *Secins_strerror(int err);
Secins_share_gid()
Returns the group ID (GID) for the share group. All users on the system are a
member of this share group.
Prototype
gid_t Secins_share_gid(void);
Secins_system_gid()
Returns the GID for the system group. All system application users are a member
of this system group.
Prototype
gid_t Secins_system_gid(void);
Secins_users_gid()
Returns the GID for the users group. All application users usr1–usr16 are a
member of this users group.
Prototype
gid_t Secins_users_gid(void);
Secins_user_app()
Prototype
unsigned int Secins_user_app(void);
Return Values
Returns 1 if the caller is an application user usr1–usr16; otherwise returns 0.
Secins_sys_app()
Prototype
unsigned int Secins_sys_app(void);
Return Values
Returns 1 if the caller is a system application user; otherwise returns 0.
Secins_sysmode_share_gid()
Returns the sysmode share GID for the calling user. For each application user
usr1–usr16 a special group is created that contains the user and the sysmode
sys4 user as members. For other users, the current GID returns.
Prototype
gid_t Secins_sysmode_share_gid(void);
Secins_config_file_share_gid()
Returns the sysmode share GID for the specified config file.
Prototype
gid_t Secins_config_file_share_gid(const char *configfile);
Parameters
configfile Specified config file: config.usr1, config.usr2, config.sys1,
config.network, and so on.
Return Values
For config.usr1–config.usr16, the sysmode share GUD returns. For other config
files, the current GID returns.
Users/Groups The application manager must be able to dynamically add users and groups to the
Functions system. Secure Installer assigns a range of UIDs and GIDs to each user, allowing
them to control users and groups. Any user can only use the UIDs and GIDs
assigned to it. Use Secins_get_uid_gid_range() to obtain the range to assign.
In the following, users usr1–usr16 are referred to as the primary user. The users
and groups assigned to each primary user are referred to as secondary users.
Secins_get_uid_gid_range()
Retrieves the range of users and groups assigned to the calling primary user.
NOTE
All specified UIDs and GIDs for the calls in this section must be in this range.
Prototype
int Secins_get_uid_gid_range(UID_GID_RANGE *range, int rangesize);
Parameters
rangesize The size of the assigned range returned in the range struct.
Example
The UID_GID_RANGE struct is defined in libsecins.h:
typedef struct
{
int start_uid;
int num_uids;
int start_gid;
int num_gids;
} UID_GID_RANGE;
where,
• start_uid is the start UID in the assigned range.
• num_uids is the number of UIDs assigned. So the allowed UID is
start_uid, start_uid + 1, start_uid + 2, …,
start_uid + num_uids - 1.
• start_gid is the start GID in the assigned range.
• num_gids is the number of GIDs assigned. So the allowed GIDs is
start_gid, start_gid + 1, start_gid + 2, …,
start_gid + num_gids - 1.
Return Values
Returns 0 on success; otherwise an error code returns.
Secins_add_group()
Adds a group with the specified gid and groupname. Only the primary user can
use this call.
Prototype
int Secins_add_group(int gid, const char *groupname);
Parameters
gid Must be in range assigned to the primary user returned by
Secins_get_uid_gid_range().
Return Values
Returns 0 on success; otherwise an error code returns.
Secins_add_user()
Adds a user with the specified uid, username, and gid. The specified UID and
GID must be in range assigned to the primary user with
Secins_get_uid_gid_range(). The GID must already exist (that is, must have been
added using Secins_add_group()). Only the primary user can use this call.
Prototype
int Secins_add_user(int uid, const char *username, int gid);
Parameters
username Primary user name; 16 chars maximum.
Return Values
Returns 0 on success; otherwise an error code returns.
Secins_add_group_member()
Adds the specified UID to the specified GID. The specified UID and GID must be
in range assigned to the primary user using Secins_get_uid_gid_range(). The
referenced user and group must already exist. Only the primary user can use this
call.
Prototype
int Secins_add_group_member(int gid, int uid);
Return Values
Returns 0 on success; otherwise an error code returns.
Secins_remove_user()
Removes the specified UID. The specified UID must exist and be in range
assigned to the primary user using Secins_get_uid_gid_range(). Only the primary
user can use this call.
Prototype
int Secins_remove_user(int uid);
Return Values
Returns 0 on success; otherwise an error code returns.
Secins_remove_group()
Removes the specified GID. The specified GID must exist and be in range
assigned to the primary user using Secins_get_uid_gid_range(). Only the primary
user can use this call.
Prototype
int Secins_remove_group(int gid);
Return Values
Returns 0 on success; otherwise an error code returns.
Secins_start_app_uid()
Starts an application (cmdline) with specified UID and GID. The specified UID and
GID must exist and be in range assigned to the primary user using
Secins_get_uid_gid_range(). Only the primary user can use this call. The
executable file specified in cmdline must be owned by the primary user.
Prototype
int Secins_start_app_uid(pid_t *app_pid, const char *cmdline, int uid,
int gid);
Parameters
app_pid The process ID of the application.
Return Values
Returns 0 on success; otherwise one of the ERROR_SECINS error codes.
Error Codes
Error Code Value Description
ERROR_SECINS_NO_MEMORY 100 Out of memory.
ERROR_SECINS_MKDIR 101 Failed to make directory.
ERROR_SECINS_FILE_AUTH 102 Failed to authenticate package.
ERROR_SECINS_MOUNT_RFS 103 Failed to mount file system.
ERROR_SECINS_INVALID_INIT_FILE 104 System init file not found.
ERROR_SECINS_PATHNAME_TOO_LONG 105 Pathname too long
ERROR_SECINS_CHROOT 106 Switch root operation failed
ERROR_SECINS_EXEC_INIT 107 Failed to run the system init file.
ERROR_SECINS_OPENDIR 108 Failed to open directory.
ERROR_SECINS_RENAME_DIR 109 Failed to rename directory.
ERROR_SECINS_CHMOD 110 Failed to set file permissions.
ERROR_SECINS_CHOWN 111 Failed to set file ownership.
ERROR_SECINS_FILE_CREATE 112 Failed to create file.
ERROR_SECINS_FILE_OPEN 113 Failed to open file.
ERROR_SECINS_FILE_WRITE 114 Failed to write file.
ERROR_SECINS_NO_SIG 115 No package signature file.
ERROR_SECINS_NO_PKG 116 No matching package file with signature.
ERROR_SECINS_INVALID_FILENAME 117 Invalid p7s signature filename.
ERROR_SECINS_INVALID_INSTALL 118 Installed package is invalid.
ERROR_SECINS_INVALID_INI_SECTION 119 Invalid ini file section.
ERROR_SECINS_MKNOD 120 Failed to create device node.
ERROR_SECINS_INVALID_INI_PROPERTY 121 Invalid ini file property.
ERROR_SECINS_NO_CONTROL_FILE 122 No control file in package.
ERROR_SECINS_INVALID_CONTROL_FILE 123 Invalid control file in package.
ERROR_SECINS_CREATE_CONTROL_FILE 124 Failed to install control file.
ERROR_SECINS_OLD_PKG_VERSION 125 Newer package already installed.
ERROR_SECINS_INVALID_PKG_TYPE 126 Invalid package type.
ERROR_SECINS_EXTRACT_PKG_CONTROL 127 Failed to extract package CONTROL directory.
ERROR_SECINS_EXTRACT_PKG 128 Failed to extract package archive.
ERROR_SECINS_INVALID_PKG 129 Invalid package.
ERROR_SECINS_PKG_LIST 130 Failed to read package contents.
ERROR_SECINS_PKG_FILENAME_TOO_LONG 131 Package filename too long.
ERROR_SECINS_INSTALL_CONTROL_FILE 132 Failed to install package control file.
ERROR_SECINS_INSTALL_PKG 133 Failed to install package.
ERROR_SECINS_INSTALL_SIG 134 Failed to install package signature.
ERROR_SECINS_PKG_NOT_FOUND 135 Incomplete package install.
ERROR_SECINS_ADD_GROUP 136 Failed to add group.
ERROR_SECINS_ADD_USER 137 Failed to add user.
ERROR_SECINS_ADD_SHADOW 138 Failed to add shadow password entry.
ERROR_SECINS_GET_USER 139 User not found.
Use the built-in GUI on V/OS terminals to perform maintenance tasks. Refer to the
reference manual for your terminal for complete menu descriptions.
Entering System With an application loaded, use the procedure in the hardware guide for your
Mode terminal to enter System Mode.
NOTE Before entering System Mode and selecting the function(s) to perform, verify that
the V/OS terminal is installed as described in the installation guide for your
terminal. Ensure that the terminal is connected to a power source, connected to
the network, and is turned on.
Exiting System After successful completion, some operations automatically exist System Mode
Mode and reboot the terminal. To manually exit System Mode and restart the terminal,
press the Reboot button on the System Mode idle screen.
Multi-Application Environment
User Accounts Linux supports a multi-user environment. V/OS has 16 user accounts,
usr1…usr16. These accounts each have a base directory in /home.
All user accounts allow both reads and executes by the other accounts. usr1–
usr16 are set so that only the account owner can perform write operations to their
home directory.
V/OS PROGRAMMERS MANUAL 115
M ULTI -A PPLICATION E NVIRONMENT
File Permissions
File Permissions Linux naturally supports a comprehensive file permission mechanism that is very
helpful with regard to multi-application support. File access may be controlled via
read, write and execute permissions. Each user account can control the
permission settings of its files. All user accounts are members of the same group
called “users”. If a file allows group permissions, then all user accounts can
access that file. Properly using Linux file permissions makes it very easy to share
some files while hiding others. It is recommended that before creating an
application download .tar file, that file permissions be checked and adjusted as
desired.
Launching On power-up and restarts, the system looks at the *GO parameter in the usr1
Applications configuration file (/mnt/sram/config.usr1) to determine which application to
start. This application must start all other application(s). Use svcRunUsr() to
execute a different user account’s application. For example,
svcRunUsr("usr2","app.exe");
GUI Applications Two (or more) GUI applications can run simultaneously as long as only one
application controls the display, keypad, and touch panel. This cooperative
implementation. Other applications cannot force a display refresh (such as playing
a video). The Linux Virtual Terminal mechanism controls which application owns
the display, keypad, and touch panel.
When an application starts, it is assigned a virtual terminal descriptor. This
descriptor enables the virtual terminal of the application. An application can
determine its virtual terminal descriptor in several ways. One way is using the
following code snippet:
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/vt.h>
Applications must share their virtual terminal descriptor to control the active
application.
To switch control of the display, keypad, and touch panel, either perform a system
call using the chvt x command (where, x is the virtual terminal to switch to) or
use the following code snippet:
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/vt.h>
Power Management
Power Management is the effort to minimize power usage in portable and non-
portable systems.The primary benefit is increased battery life, but there are other
benefits such as reduced heat dissipation. The V/OS reduces power consumption
two ways:
• During sustained periods of system/application inactivity.
Inactivity is when all active tasks are placed in a wait state for a specified
period of time, during which there are no activities, such as a keypad or touch
screen press, card swipe, send/receive of data, and so on.
• A predefined period sleep time.
You can define when the system enters sleep mode, and when is wakes up in
normal mode.
The actions taken by the V/OS to reduce power consumption include:
• Peripherals are powered off, including the magnetic card reader, LCDs, and
so on.
• Putting the microprocessor in sleep mode
• Putting memory in self-refresh mode
• Disabling of the phased-locked loop (PLL) circuitry for clock generation
• Shutting down the core processor
• Reducing power to approximately 30 mA
Standby Mode In Standby mode, the LCD and LEDs are dimmed, and the processor state is
maintained. The DRAM remains awake. Send a wake-up devices event to power
on the unit.
Sleep Mode Once in Sleep mode, the unit only wakes on service events. All devices are
powered down. The DRAM is placed in self-refresh mode, periodically waking up.
Send an RTC alarm signal to wake the unit.
Wakeup Events The V/OS polls for various wake-up events, including expired timers in the
application area, screen touch, keypad press, RTC alarm time expiration, data
received over the serial port, or USB device detection.
Use the Power Management service to control which devices wake the system.
Power The V/OS has a configurable script-based Power Management policy. On the
Management terminal, use the Power Setting screen to configure Power Management options.
System Key Power Management points are:
• The terminal always powers up to a running state.
• The unit enters Standby and Sleep modes when all applications are idle for a
specified period.
• When the unit enters Standby mode, the backlight and LEDs are turned off.
• When the unit enters Sleep mode, all devices are shut down except those
used to wake the system, and only the RTC clock continues to run. The DRAM
is placed in Self-refresh mode to preserve the machine state (system and
application text/data loaded in memory).
• The unit wakes from Standby or Sleep mode on a wake-up event such as a
key press, or based on the expiration of an application timer.
• An attack on the security system (such as opening the case) causes the unit to
perform an orderly power-off sequence.
Power Applications must use the following system calls and XML methods for
Management V/OS-based terminals.
Functions
powermngt_getVersion()
Prototype
struct version powermngt_getVersion(void);
Return Values
The version structure defined in svcmgrSvcDef.h.
XML Command
<svc_cmd>
<powermngt>
<getVersion/>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<getVersion>
<return type="container">
<major>int</major>
<minor>int</minor>
<maint>int</maint>
<build type="string">string [max len 16]</build>
</return>
</getVersion>
</powermngt>
</svc_rtn>
powermngt_get_config()
Returns the Power Management configuration. View the struct apm_config for
details.
Prototype
int powermngt_get_config(struct apm_config *apm);
Parameters
apm_config
apm
Return Values
=0 Success
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<get_config>
<apm type="list">
<item type="container">
<Signature>unsigned int [default:0]</Signature>
<Size>unsigned int [default:0]</Size>
<apm_on>unsigned int [default:0]</apm_on>
<InactivityTimeToSusspend>
unsigned int [default:0]
</InactivityTimeToSusspend>
<auto_mode>unsigned int [default:0]</auto_mode>
<AutoTimeToShutDown>
unsigned int [default:0]
</AutoTimeToShutDown>
<AutoTimeToWakeUp>
unsigned int [default:0]
</AutoTimeToWakeUp>
<Standby_timeout>
unsigned int [default:0]
</Standby_timeout>
<communication_on>
unsigned int [default:0]
</communication_on>
<Shutdown_timeout>
unsigned int [default:0]
</Shutdown_timeout>
<permit_state>unsigned int [default:0]</permit_state>
</item>
</apm>
</get_config>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<get_config>
<return>int</return>
</get_config>
</powermngt>
</svc_rtn>
powermngt_set_config()
Sets the Power Management configuration. View the struct apm_config for details.
Prototype
int powermngt_set_config(struct apm_config *apm);
Parameters
apm_config
apm
Return Values
=0 Success
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<set_config>
<apm type="list">
<item type="container">
<Signature>unsigned int [default:0]</Signature>
<Size>unsigned int [default:0]</Size>
<apm_on>unsigned int [default:0]</apm_on>
<InactivityTimeToSusspend>
unsigned int [default:0]
</InactivityTimeToSusspend>
<auto_mode>unsigned int [default:0]</auto_mode>
<AutoTimeToShutDown>
unsigned int [default:0]
</AutoTimeToShutDown>
<AutoTimeToWakeUp>
unsigned int [default:0]
</AutoTimeToWakeUp>
<Standby_timeout>
unsigned int [default:0]
</Standby_timeout>
<communication_on>
unsigned int [default:0]
</communication_on>
<Shutdown_timeout>
unsigned int [default:0]
</Shutdown_timeout>
<permit_state>unsigned int [default:0]</permit_state>
</item>
</apm>
</set_config>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<set_config>
<return>int</return>
</set_config>
</powermngt>
</svc_rtn>
powermngt_Shutdown()
Immediately forces shut down. The unit wakes up on an RTC alarm (if previously
set using powermngt_SetWakeupTime()).
Prototype
int powermngt_Shutdown(void);
Return Values
On success, the function does not return.
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<Shutdown/>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<Shutdown>
<return>int</return>
</Shutdown>
</powermngt>
</svc_rtn>
powermngt_SetWakeupTime()
Sets RTC alarm to wake up the unit as set in the utildt parameter.
Prototype
int powermngt_SetWakeupTime(struct svc_power_DateTime *utildt);
Parameters
svc_power_DateTime
utildt
Return Values
=0 Success
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<SetWakeupTime>
<utildt type="list">
<item type="container">
<tm_sec>int [default:0]</tm_sec>
<tm_min>int [default:0]</tm_min>
<tm_hour>int [default:0]</tm_hour>
<tm_mday>int [default:0]</tm_mday>
<tm_mon>int [default:0]</tm_mon>
<tm_year>int [default:0]</tm_year>
<tm_wday>int [default:0]</tm_wday>
<tm_yday>int [default:0]</tm_yday>
<tm_isdst>int [default:0]</tm_isdst>
</item>
</utildt>
</SetWakeupTime>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<SetWakeupTime>
<return>int</return>
</SetWakeupTime>
</powermngt>
</svc_rtn>
powermngt_CritcalSectionEnter()
Prototype
int powermngt_CritcalSectionEnter(void);
Return Values
=0 Success
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<CritcalSectionEnter/>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<CritcalSectionEnter>
<return>int</return>
</CritcalSectionEnter>
</powermngt>
</svc_rtn>
powermngt_CritcalSectionExit()
Exits the Power Management critical section. Power Management events resume
at their last state. The system is allowed by the application to enter Standby or
Suspend mode.
Prototype
int powermngt_CritcalSectionExit(void);
Return Values
=0 Success
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<CritcalSectionExit/>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<CritcalSectionExit>
<return>int</return>
</CritcalSectionExit>
</powermngt>
</svc_rtn>
powermngt_declare_state()
Prototype
int powermngt_declare_state(int proc_id, int state);
Parameters
Return Values
Return Values
=0 Success
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<DeclareState/>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
powermngt_GetInfo()
Prototype
int powermngt_GetInfo(struct svc_apm_info *svc_apm_info_ptr);
Parameters
svc_apm_info
Return Values
=0 Success
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<GetInfo>
<svc_apm_info_ptr type="list">
<item type="container">
<driver_version type="string">
string [max len 10] [default:NULL]
</driver_version>
<apm_version_major>int [default:0]</apm_version_major>
<apm_version_minor>int [default:0]</apm_version_minor>
<apm_flags>int [default:0]</apm_flags>
<ac_line_status>int [default:0]</ac_line_status>
<battery_status>int [default:0]</battery_status>
<battery_flags>int [default:0]</battery_flags>
<battery_percentage>int [default:0]</battery_percentage>
<battery_time>int [default:0]</battery_time>
<using_minutes>int [default:0]</using_minutes>
</item>
</svc_apm_info_ptr>
</GetInfo>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<GetInfo>
<return>int</return>
</GetInfo>
</powermngt>
</svc_rtn>
powermngt_GetEvent()
Prototype
int powermngt_GetEvent(unsigned int callback_event);
Return Values
=0 Success
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<GetEvent>
<callback_event>unsigned int [default:0]</callback_event>
</GetEvent>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<GetEvent>
<return>int</return>
</GetEvent>
</powermngt>
</svc_rtn>
powermngt_Susspend()
Prototype
int powermngt_Susspend(void);
Return Values
=0 Success
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<Susspend/>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<Susspend>
<return>int</return>
</Susspend>
</powermngt>
</svc_rtn>
powermngt_Standby()
Prototype
int powermngt_Standby(void);
Return Values
=0 Success
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<Standby/>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<Standby>
<return>int</return>
</Standby>
</powermngt>
</svc_rtn>
powermngt_get_wakeupdevices()
Prototype
int powermngt_get_wakeupdevices(unsigned int * WakeUpDevices);
Parameters
WakeUpDevices The device wake-up bitmap is:
• PM_WAKE_DEVICE_KEYPAD
• PM_WAKE_DEVICE_RTC_ALARM
• PM_WAKE_DEVICE_TOUCH_SCREEN
• PM_WAKE_DEVICE_UART0
• PM_WAKE_DEVICE_UART1
• PM_WAKE_DEVICE_UART2
• PM_WAKE_DEVICE_UART3
• PM_WAKE_DEVICE_USB_OTG
• PM_WAKE_DEVICE_USB_HOST
Return Values
=0 Success
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<get_wakeupdevices>
<WakeUpDevices type="list">
<item>unsigned int</item>
</WakeUpDevices>
</get_wakeupdevices>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<get_wakeupdevices>
<return>int</return>
</get_wakeupdevices>
</powermngt>
</svc_rtn>
powermngt_set_wakeupdevices()
Prototype
int powermngt_set_wakeupdevices(unsigned int WakeUpDevices);
Parameters
WakeUpDevices Handle of the activated device that wakes the unit out of PM
mode. The device wake-up bitmap is:
• PM_WAKE_DEVICE_KEYPAD
• PM_WAKE_DEVICE_RTC_ALARM
• PM_WAKE_DEVICE_TOUCH_SCREEN
• PM_WAKE_DEVICE_UART0
• PM_WAKE_DEVICE_UART1
• PM_WAKE_DEVICE_UART2
• PM_WAKE_DEVICE_UART3
• PM_WAKE_DEVICE_USB_OTG
• PM_WAKE_DEVICE_USB_HOST
Return Values
=0 Success
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<set_wakeupdevices>
<WakeUpDevices>unsigned int [default:0]</WakeUpDevices>
</set_wakeupdevices>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<set_wakeupdevices>
<return>int</return>
</set_wakeupdevices>
</powermngt>
</svc_rtn>
powermngt_get_sufficient_battery()
Checks that the battery has sufficient power to perform at least one transaction.
Prototype
int powermngt_get_sufficient_battery(unsigned int *sufficient);
Parameters
sufficient Outputs true/false according to results of the check.
Return Values
=0 Success
-1 Fail
XML Command
<svc_cmd>
<powermngt>
<get_sufficient_battery>
<sufficient type="list">
<item>unsigned int</item>
</sufficient>
</get_sufficient_battery>
</powermngt>
</svc_cmd>
XML Return
<svc_rtn>
<powermngt>
<get_sufficient_battery>
<return>int</return>
</get_sufficient_battery>
</powermngt>
</svc_rtn>
Services
Services allow the traditional C application world and the WDE (Web
Development Environment) world share access to specific device resources and
functionality. Service calls expose core V/OS functionality, or add value to the OS,
for application use. A Service must have at minimum a service interface
comprised of a C header file that defines the Service API and a shared library that
implements it.
A service can provide service server-side functionality. This implementation is
divided between the functions directly called using the shared service library and
the server-side functions (also in the shared library) called by the service server
executable (provided by the service manager stack).
Service developers must decide if the shared library is adequate or if a service
server is also required and if so, how to determine work division using the
following factors:
• how state data is maintained and the scope (visibility) of this data
• whether system resources are acquired
• how competing resource requests are handled
A shared library loads into application data space. Each application must have its
own copy of Service data. This may be fine for services providing status or local
functionality, but if the service manages a resource (for example, a COM port),
then a central entity (that is, server-side service executables) must manage
requests from multiple sources (applications).
The service interface and shared library is required even if all implementation is
performed by a service server. The shared library always implements the API
functions called even if they are nothing more than proxies passing the call on to
the executable.
Applications cannot call executable functions directly; only the interface APIs can
through the shared library. This means that the executable does not implement
the APIs as defined in the interface. The shared library is the only caller in to the
executable so it can preprocess or transform the data, handle anything that can
be kept in the application scope, and streamline data transfer to/from the
executable. The shared library/executable interface must minimal and lightweight.
The shared library and executable communicate using a Service Manager
message infrastructure. Both must link with the message library to access this
message infrastructure.
The XML parsing code is auto-generated using a Java utility that uses the service
header file as input. There are limitations on the service interface (header file).
These limitations and correct service interface header file construction are
presented in this chapter.
Flow for Service As illustrated in Figure 4, when a client makes a server-side call:
Server 1 The Service Manager listens for connections.
Functions
2 The client creates a socket and connects to the Service Manager.
4 The Client requests a socket pair for client/server communication with the
named service.
5 The Service Manager checks if access is allowed, then starts a server-side
child process, smi_svcserver_main(), if not already running.
At start up (that is, on the first request to service server-side), the Service
Manager looks for and executes the service server initialization method,
{service}_serverInit(), where, {service} is the service name.
8 The server-side opens the shared service library, and requests socket
descriptor for communication.
9 The server-side process receives the descriptor and looks to receive a
command on the socket.
10 The client-side sends the request.
11 The server-side processes the request and calls the shared service library.
12 The server-side sends a response to the client.
13 The server-side child process remains active waiting for next request to this
service server-side process.
14 The socket descriptor pair is closed.
XML Service This section presents service XML elements, commands, and error codes.
XML Elements The XML that issues WDE commands or return data is directly based on the C
prototype of the command function. Each supported C data type construct can be
matched directly to one of the root elements shown in the following code.
// Simple (native C type)
{Element<tagname>} := <tagname>value</tagname>
// String (char*)
{Element<tagname>} := <tagname type = "string">value</tagname>
// Binary (void*)
{Element<tagname>} := <tagname type = "binary">base64binary value</
tagname>
// Container (struct)
{Element<tagname>} := <tagname type = "container">
{Element1}
{Element2}
...
{ElementN}
</tagname>
// List (array)
{Element<tagname>} := <tagname type = "list">
// Note: All "list" {Element}'s are same type.
{Element<item>}
{Element<item>}
...
{Element<item>}
</tagname>
Notice that the list and container elements contain other elements, so it is possible
to create XML of any depth. Multi-element assemblies are defined as composite
elements. All elements (root or composite) have a single root tag. This is important
as elements are associated one-for-one with C function parameters and return
data.
Although the XML can be used without any thought as to the prototypes of service
functions, it is easier to understand how the XML is constructed and used when
associated with C. This also shows how it is possible to auto-generate XML format
documentation from Service header files.
Each element is associated with a C data type and its data, either native or
complex. In the following descriptions and examples of the root elements note that
the examples depict the element data as function parameters for simplicity; any
root or composite element can also be used as a function return type.
• Simple (native):
{Element<tagname>} := <tagname>value</tagname>
Example:
void fn(int age, float height, char initial);
<age>30</age>
<height>30</height>
<initial>X</initial>
• String (char*):
{Element<tagname>} := <tagname type = "string">value</tagname>
Example:
void fn(char* title, int page_cnt);
<page_cnt>432</page_cnt>
• Binary (void*):
{Element<tagname>} := <tagname type = "binary">base64binary
value</tagname>
Represents a binary data ‘blob.’ This converts to a variable of type void* and
an associated count. See Array Handling, specifically array handling
construct #3, for information on runtime array management.
Example:
void fn(struct bindata my_bdata);
struct bindata {
void* data;
int data_count;
}
...
<my_bdata type = "container">
<data type="binary">QQ==</data>
</my_rect>
• Container (structure):
{Element<tagname>} := <tagname type = "container">
{Element1}
{Element2}
...
{ElementN}
</tagname>
Example:
void fn(struct rectangle my_rect);
struct rectangle {
int left;
int top;
int right;
int bottom;
}
<bottom>200</bottom>
</my_rect>
• List (array):
{Element<tagname>} := <tagname type = "list">
// Note: All "list" {Element}'s are same type.
{Element<item>}
{Element<item>}
...
{Element<item>}
</tagname>
List Elements can represent pointers, and both variable length and constant
(compile time defined) arrays. It is important to understand these subtleties
when using arrays. Refer to Array Handling.
Example:
void fn(struct data_array myData);
struct data_array {
int* data;
int data_count;
}
This is a special type for passing any number of name/value pairs as a single
element. You can create this type from the other root elements (it is a list of
containers of two simple elements), but because this is likely to be a common
Example:
void fn(struct pairlist receipt);
Again, both the command XML and return XML is handled by the auto-
generated code. Service developers only write C functions and do not interact
with XML.
• a call code.
Error Codes • Always set errno to 0 on the line above a return() statement when the
return value is known to be valid.
An error code returns when a function returns with errno 0. The errcode
value (IntErrcodeVal in XML) is the value of errno. It is important to set
errno = 0 when a function return value is valid as errno is always checked and
an <errcode> returned instead of the function return value when errno 0.
• Always free any malloc’d return data before exiting a client Service function
with errno 0.
It is important that any malloc on behalf of return variables are free’d before
returning when errno 0. Normally, auto-generated code frees all return data
pointer variables. This is not the case when errno 0; <errcode> returns and
no operations are performed on return data. Memory leaks can occur if the
heap is not clean when errno 0.
Call Codes A call code returns on internal error and when successful command completion
cannot not be accomplished. The call code values (IntCallcodeVal in XML)
are:
NOTE Call code 2 typically occurs because the service was built without specifying all
dependent libraries. A simple test is to create a small executable that includes
the service header (the main() can actually be empty), and links only against the
service in question ( -lsvc_myservice ). This reveals missing dependencies.
XML Command and The following command and return examples are fictitious. There is no attempt to
Return Examples make them cohesive nor are they designed to demonstrate best practices, only to
illustrate XML. The examples are followed by minimal contents of a valid Service
Interface header file that encompasses all XML command and return examples.
• Command XML
<svc_cmd>
<myService>
<set_image_rect>
<imgName type="string">mona_lisa.png</imgName>
<loc_x>10</loc_x>
<loc_y>20</loc_y>
<size_x>200</size_x>
<size_y>300</size_y>
</set_image_rect>
</myService>
</svc_cmd>
<svc_cmd>
<myService>
<print>
<title type = "string">things to do<title>
<lines type = "container">
<list_count>4<list_count>
<list type="pairlist">
<pline>first line</pline>
<plinen>another line</plinen>
<pcmd>set bold</pcmd>
<plinen>last line</plinen>
</list>
</lines>
</print>
</myService>
</svc_cmd>
• Return XML:
<svc_rtn>
<myService>
<packages>
<return type="container">
<packages_count>2</packages_count>
<packages type="list">
<package type="container">
<user type="string">usr1</user>
<pkg_name type="string">curl</pkg_name>
<version>1.6</version>
<date type="string">24Aug2010</date>
</package>
<package type="container">
<user type="string">usr1</user>
<pkg_name type="string">openssl</pkg_name>
<version>2.3</version>
<date type="string">12Oct2010</date>
</package>
</packages>
</return>
</packages>
</myService>
</svc_rtn>
<svc_rtn>
<myService>
<cables>
<return type="container">
<type type="string">mx_series</type>
<usb type="string">host</usb>
<Ethernet type="string">yes</ethernet>
<comports_count>3</comports_count>
<comports type="list">
<comport type="container">
<port type="string">com1</port>
<type>232</type>
<connected type="string">no</connected>
<firmware type="string">N/A</firmware>
</comport>
<comport type="container">
<port type="string">com2</port>
<type>232</type>
<connected type="string">no</connected>
<firmware type="string">N/A</firmware>
</comport>
<comport type="container">
<port type="string">com3</port>
<type>232</type>
<connected type="string">yes</connected>
152 V/OS PROGRAMMERS MANUAL
S ERVICES
XML Service
<firmware type="string">1.1</firmware>
</comport>
</comports>
</return>
</cables>
</myService>
</svc_rtn>
• Service Interface header file for these XML examples:
#ifndef __MY_SERVICE_H__
#define __MY_SERVICE_H__
/*SVC_SERVICE:myService*/
/*SVC_STRUCT*/
struct package {
char * user;
char * pkg_name;
float version;
char * date;
}
/*SVC_STRUCT*/
struct package_array {
struct package* packages;
int packages_count;
}
/*SVC_STRUCT*/
struct comport {
char * port;
int type;
char * connected;
char * firmware;
}
/*SVC_STRUCT*/
struct cabledata {
char * type;
char * usb;
char * ehternet;
struct comport* comports;
int comports_count;
/*SVC_PROTOTYPE*/
int myService_set_image_rect(char* imgName,
int loc_x, int loc_y, int size_x, int size_y);
/*SVC_PROTOTYPE*/
void myService_print(char* title, struct pairlist lines);
/*SVC_PROTOTYPE*/
struct package_array myService_packages(void);
/*SVC_PROTOTYPE*/
struct cabledata myService_cables(void);
#endif //__MY_SERVICE_H__
Service A Service must, at minimum, provide a C interface API defined by a header file
Development supported by a shared library, .so. All references to Service developer source
files must the syntax {service} where, {service} is the Service name.
The Service Interface header file must be named svc_{service}.h. For
example, a printer Service may contain the files svc_printer.h and
printer.c.
C applications that link to a Service or are invoked through WDE can call the
Service interface API directly. Except client-side service methods, which are
called directly by a linked application or through the WDE stack, a service can
contain server-side services. Server-side services are methods (contained in the
.so library) managed by a separate single-threading process. Any interface to
server-side methods are contained and managed by the client-side methods. No
application or WDE directly calls or invokes server-side methods.
WDE uses XML calls and return results. The code that transforms command XML
to/from native C is auto-generated using the Service Interface header file. Both
allowing Service calls through WDE and utilizing auto-generated code places
restrictions on the format and content of the C interface.
C Content Restrictions discusses C code limitations. Comment Tag Directives
discusses special C comments used to tag interface content. XML Command and
Return Format defines the command and return XML. The XML format definition
guarantees that all XML can be represented in C. Each XML element conforms to
one of the following:
• a native C type (such as, int, float, char, and so on)
• a string (char*)
• a binary base64 formatted string (void*)
• a user-defined C structure that contains any or all native types, strings, arrays,
pairlists, or user-defined structs
• an array of a C type (except char) or user-defined structure
• a pairlist–a special designation for an array of structures of type pair
(struct pair*)
C Content Because the Service Interface API (that is, C prototypes) can be called by WDE
Restrictions (XML files), it is not possible, for instance, to return data using parameter pointers.
Similarly, since the XML parsing code is auto-generated, the length of an array
must be well defined. Due to these and other limitations, the C prototypes that
define the Service interface must conform to the following restrictions:
• Prototype parameters cannot return data; only [IN] params.
• The prototype return value is for all return data.
• errno returns error conditions. errno must return 0 on success.
• structs cannot contain structs with the same name or pointers to structs of the
same name. No recursive structures. No linked lists.
• structs can define only one variable for each type definition.
For example, two integer variables 'i' and 'j' must be defined as
int i; int j; (on separate lines)
not
int i, j;
• No multi-dimensional variables. Only linear arrays (single pointers) allowed.
Comment Tag The preprocessor requires knowledge of the Service name ({service}), which
Directives declarations are part of the exposed API, the required parameters, default values,
and so on. To provide this information and maintain proper C syntax, in the
Service Interface header file define set of preprocessor directives in C style
comments (/**/).
Each Service must specify its service name in the header file. This is only done
once, preferably at or near the top of the file. This single C style comment contains
the keyword SVC_SERVICE (all uppercase) followed by a colon and the name of
the service. No spaces allowed.
Example:
/*SVC_SERVICE:led*/
The header file contains the interface for the LED Service.
Each exported Service function must have a preceding comment that tags it as an
API function (for example, /*SVC_PROTOTYPE*/). Locate this comment
anywhere before the function prototype, but only white space or comments can be
between this comment and the function prototype.
Prototype function names are prefixed with the service name and underscore.
methodName is the function name without the service name prefix. The Service
Manager Stack prefixes the service name when making the call. C applications
are required to call serviceName_methodName since functions are called
directly.
The prototype is defined normally, except that each variable can include a default
value. The default value is used when a Service call is made with the value
variable absent. This is only possible when calling from XML (WDE), as C calls
are compiled and based on the header file. The default value must be in
comments (/**/) with no spaces between the asterisks and the value. If a default
value comment is absent, value= 0. Use /*REQ*/ tag comments to indicate that
the variable is required. This means that if the value is missing in XML, an error
(call code) returns. type and return_type can be a standard C type, a string
(char*), or a defined /*SVC_STRUCT*/ structure.
Example:
/*SVC_PROTOTYPE*/
int myservice_fn(int i, double d /*3.14*/, char c /*REQ*/);
• The default value for i is 0 because it is undefined.
• The d parameter has a default value of 3.14.
Structure Definition
/*SVC_STRUCT*/
struct struct_name {
type member_name [/*default_val*/];
...
};
NOTE
Only one member per defined type is allowed. Multiple members of the same
type must be listed separately.
Example:
/*SVC_STRUCT*/
struct person {
char* name;
int age;
char* parent[2];
char** children;
int children_count;
};
None of the members have default values, and default to zero (NULL for pointers).
Note that the variable length string array children must be accompanied by an
array count member of the same name, suffixed with _count. See Array Handling
for more detail on passing/returning arrays.
Service Interface The Service Precompiler utility does not run the standard C preprocessor
and the therefore, standard preprocessor directives such as #define and #include are
C Preprocessor not expanded.
V/OS PROGRAMMERS MANUAL 157
S ERVICES
Service Development
where,
• E specifies run the preprocessor only
• C specifies keep C comments
• The outfile_name is used as input to the Service Precompiler.
Use pipes to avoid intermediate outfile_name:
arm-none-linux-gnueabi-cpp -E -C infile_name | java -jar
ServicePreprocessor.jar
Note that the C++ compiler must be provided directory paths to header files not in
the infile_name directory; use the -Ifull_pathname command line
parameter as usual.
Array Handling Service Interface functions cannot pass or return data by reference because
function calls can be made using WDE (XML) or C. All pointers are considered
arrays, and the number of array elements must be known either implicitly or
explicitly. Three array constructs are possible in Service definitions:
• A pointer variable (either function parameter or structure member) with no
associated _count variable. This is treated as an array with an element count
of one (1).
• The array count defined at compile time using standard bracket [] format.
• A pointer variable contained within a structure with an associated _count
variable.
Construct (1)
Use construct (1) pointers to data to pass a function parameter, function return
value, or structure member. Remember that pointers passed as function
parameters can only be used as [IN] parameters. The pointer cannot be “filled”
within the function with the expectation that the caller accesses it after the call
completes. All data to return by a function must be in the return value.
Examples:
int* fn(void);
char* fn(int* pi, float f);
void fn(int i, int* pi);
Construct (2)
Specify arrays using compile-time syntax. Note that arrays can only be one
dimensional, and therefore, except for the string type (char*), the pointer asterisk
cannot be used when the length is compile-time defined.
Example:
char* fn(int i[10], float f);
void fn(int i, char* sz[5]);
struct my_struct{
char c;
int i[100];
char* name;
}
Construct (3)
A standard idiom in C functions is to pass an array as one parameter and the
count as another, for example:
int fn(float* my_array, int array_count);
float* x;
float* y;
float* z;
int x_count;
int y_count;
int z_count;
};
In the above structure; title is not an array, it is a string, and therefore requires
no _count member. The three arrays (and their counts) are on separate lines, as
defined in Comment Tag Directives.
An array of strings can be passed typed as char**, and requires the associated
_count member. Note that “arrays of arrays” is not allowed; char** is the only
valid “pointer of pointer” construct since this is interpreted as an array of strings.
Binary Data Pass binary data using XML variables of type void*. Auto-generation converts
void* variables to base64binary (ASCII), and visa-versa.
C programs never see this conversion since it does not call through the auto-
generator code, it therefore continues to pass and retrieve binary data as normal.
The binary void* variable follows Service Manager pointers of data types
(arrays) rules: The variable must be contained within a structure with an
accompanying integer member that defines the data length (see Construct (3)).
The following is a simple binary data construct:
struct myStruct {
void* data;
int data_count;
}
/*SVC_STRUCT*/
struct mysvcBinData{
void* b;
int b_count;
}
/*SVC_PROTOTYPE*/
void mysvc_fn(struct mysvcBinData bdata);
<mysvc>
<fn>
<bdata type="container">
<b type="binary">a base64binary string</b>
</bdata>
</fn>
</mysvc>
</svc_cmd>
The binary element is the only element that removes a C variable in its XML
format, in this case, the _count member associated with the void*. The
base64binary data is a transformation of binary to ASCII, and is not the same
length as the original binary data. The auto-generation tool performs this
transformation and populates the count along with the binary (void*) data.
Pairlist The element type pairlist allows name and value pairs pass in a compact XML
format through WDE. The following two structures are Verifone-defined and are in
the svcmgrSvcDef.h, as follows:
/*SVC_STRUCT*/
struct pair {
char* name;
char* value;
};
/*SVC_STRUCT*/
struct pairlist {
struct pair * list;
int list_count;
};
<svc_cmd>
<myService>
<myFn>
<myList type = "container">
<list_count>3</list_count>
<list type = "pairlist">
<style>craftsman</style>
<sqft>1100</sqft>
<heating>baseboard electric</heating>
</list>
</myList>
</myFn>
</myService>
</svc_cmd>
Memory The auto-generated code that interfaces between WDE XML commands and
Management Service functions must perform the following:
1 Parse an incoming XML command string, building up variables as needed to
pass as Service function arguments.
2 Call the Service function.
3 Convert the Service function return value into an XML response string.
To do this in a systematic way without preference as to the complexity of the
Service function prototype requires a well-defined protocol for managing
ownership of allocated memory. For Service Interface functions the rules are:
Input All input parameter data is owned by the caller and treated as if it were
dynamically allocated, and be free'd immediately on function return.
This means a Service function should never hold parameter data beyond the
scope of the function. The Service should instead copy any parameter data it
needs to retain.
Also, a Service function should never free parameter data. This is the
responsibly of the caller.
Output For function return data, all pointers including strings must be malloc’d, and
all non-pointers must not. It is the responsibly of the caller to free all pointer
data returned from a Service function. Note that this prohibits the return of
string constants or pointers returned from most functions. This is important.
The auto-generated code always (tries to) free’s pointer data after converting
the return value into an XML response string. When a function returns with
errno 0, the return data is assumed invalid and the caller must not try to free
it.
In this (contrived) example, a function that returns the last name of a person given
the full first and last name as a string separated by a space (for example, “john
doe” returns “doe”). Error checking is excluded for clarity.
// *WRONG*
// This disobeys both the Input and Output rules!
char* myService_getLastName(char* full_name)
{
errno = 0;
return strchr(full_name, ' ') + 1;
}
// *CORRECT*
char* myService_getLastName(char* full_name)
{
char *c = strchr(full_name, ' ') + 1;
errno = 0;
return strdup(c);
}
See the test service code file (test.c) for examples on working with various data
types including structs, arrays, and pairlists.
Events Many services require the ability to send asynchronous events, status messages,
or input needed requests. In the WDE, the concept of server-side events is not yet
well supported. With this in mind, the Event Service was created.
The Event Service is no different than any other Service, but allows asynchronous
communication between a client and server (in particular, from server to client).
The Event Service is a utility for other Services and not direct application-level
invocation. Applications do not call Event Service methods directly, but instead
call appropriate wrapper methods provided by the Services using events.
The Event Service operates using Linux FIFOs. The FIFO provides a simple
mechanism for the server to queue events and the client to read events without
the need for sending constant messages from service client to server.
The Event Service provides the following interface:
struct event {
int event;
unsigned int size;
void* data;
};
An event in the above structure is defined as an event number, and may optionally
include event data. For events without data, set size to zero and data to null.
Mechanics
An Event channel is identified by a key. All event methods require this key. The
key is a standard C string (char*) of a maximum of 99 characters. Keys must be
unique to all Services using events across the system. It is recommended that the
Service name be part of the key. Since the client and server code are in one
source file, the key is commonly #define'd at the top of the Service source file.
For example:
A Service can use multiple event channels, each requires a unique key. There is a
system-wide limit of 256 event channels. An error (errno=EFAULT) returns from
event_open() if this limit is reached.
An event channel is opened when event_open() is called and remains open
and active until closed. When closed, the Event channel is cleaned from the
system and any unread events in the queue are lost. A channel can be closed and
reopened using the same key to flush the FIFO.
Any process with a valid key can make event method calls. The main intent is for
one process to setEvent() calls, and another to getEvent() calls, but various
protocols of event life cycle management are also possible.
The typical use scenario is the server-side is to open an event channel on
initialization, and keeps the event open for the life of the server. The server sets
events as they occur. Clients then receive events.
As seen by struct event an event is comprised of an event number (int) and
optional event data. Set event.size to zero and event.data to null when no
data is attached to the event. Otherwise, set the event.data pointer and
event.size. size is the number of data bytes to extract on getEvent().
Ensure that size includes null-termination bytes of strings, and so on. Event data
can be a maximum of 4000 bytes. All Service rules apply. Pointer data in both
input and output parameters are owned by, and must be free'd by, the caller.
The flags parameter of method event_getEvent(), is a bit mask of any, all,
or none of:
GETEVENT_NONBLOCK (0x01)
GETEVENT_LAST (0x02)
GETEVENT_CANCEL (0x04)
Set flags to zero to perform a blocking getEvent(). Then waits for an event
until either:
• an event is available in the queue.
If there are events in the queue getEvent() immediately returns with the
next event.
• the getEvent() is canceled, and getEvent() returns with errno=EINTR.
An active getEvent() can be canceled two ways:
• calling event_cancel()
• calling getEvent() with the GETEVENT_CANCEL flag bit set.
Only one getEvent() per key can be active at any time so a second call to
getEvent() either:
• Returns errno=EBUSY and the GETEVENT_CANCEL flag bit is not set.
svcmgrSvcDef.h This header file is defined and maintained by Verifone to provide necessary
infrastructure components. The file must be #include’d in the Service Interface
header file as it contains the definition for struct version, which is returned by
the {service}_getVersion() function required by every Service.
svcmgrSvcDef.h also contains structures to support Pairlists.
V/OS PROGRAMMERS MANUAL 165
S ERVICES
Service Development
Properties An application that uses a Service (including WDE) can supply properties to the
Service. Properties are name/value pairs read only by the Service, and designed
to allow a caller to provide context. Properties are defined by the application, not
the Service.
When writing a Service only the following properties are valid.
Example code using the property calls can be found in test.c, the C file in the
test Service.
Required Interface Every Service is required to support a set of core interface functions to provide
Functions uniformity across Services. The Service precompiler checks for these functions
and outputs a compliance error when a function is missing. Required functions
are:
• struct version {service}_getVersion(void);
where, {service} is the Service name.
NOTE
Currently, {service}_getVersion() is the only required function.
This function allows applications to query a Service for its version number. The
returned structure is:
struct version {
int major;
int minor;
int maint;
char build[16];
}
This structure describes a three dot version number (x.y.z) and optional build
string.
NOTE
When returning an empty build string, set build to a null-terminated empty
string (that is, build[0] = 0;).
Service Server To address requirements such as controlling and accessing hardware through a
Methods single process or single-thread processing, the Service Manager stack allows a
single-server process to be associated with each Service that needs this type of
control. As noted, use of a Server component is not restricted to hardware
interfaces, and the developer can use this Server service for other purposes (for
example, when single-thread and/or single processing is desired). To simplify
Service development, a Server daemon is supplied and managed by the Service
Manager.
All server-side Service methods are just methods within the Service (.so) itself
that have a specified prototype. Service methods are invoked using other non
server-side methods (considered client-side):
int svcclient_call_server_function(const char * service_name,
const char *fn_name, const char *commandArgs, const int argsSize,
char **rtnData, int *rtnSize);
where:
service_name Name of the service this function belongs to.
fn_name Name of server-side method to call or invoke.
commandArgs Pointer to any data to be passed to this server-side method (string,
int, array, struct, and so on).
argsSize Number of bytes of interest in commandArgs.
rtnData Pointer to a pointer that contains a malloc'd chunk of memory
containing the returned data.
rtnSize Number of bytes of interest in the returned malloc'd data.
NOTE
It is the responsibility of the caller method to free() memory allocated for
rtnData.
This method interfaces to the Service Manager through the service manager
interface library. This function/method is prototyped in the auto-generated file,
autogen_service.h, where service is the name of this Service.
Auto-generated files are created running the autogen process for your Service at
build time.
All server-side service methods must have the following prototype:
int service_myfn(const char *commandArgs, const int argsSize,
char **rtnData, int *rtnSize);
where
service Name of this Service (for example, printer).
myfn Sub-name of server-side method.
commandArgs Pointer to any data to pass to this server-side method (string, int,
array, struct, and so on).
argsSize Number of bytes of interest in commandArgs.
rtnData Pointer to a pointer that contains a malloc'd chunk of memory
containing the returned data.
rtnSize Number of bytes of interest in the returned malloc'd data.
NOTE
It is the responsibility of the server-side method to malloc() memory allocated
for rtnData.
Special Server-side When a service must maintain state, you create the interface to a single user
Methods device using a server-side process. The server-side process is automatically
created when the first call is made to a server-side method from the client-side
method (see svcclient_call_server_function()).
For more control of service server process startup, use the special server-side
method calls in this section within the server-side process.
int {service}_serverOnBoot(void);
At system boot, the service manager scans all installed services and looks for any
service with a {service}_serverOnBoot(), where {service} is the name of
the service method.
If the service finds this service, the service server process starts and
{service}_serverOnBoot() executes within that process. This allows the
service to have its server daemon process start at bootup.
NOTE
The return value is currently ignored.
Notes
1 This method should ONLY be used when a service server process must be
started at bootup (controls fans, and so on). {service}_serverInit() is
the preferred method.
2 If this method exists, a {service}_serverInit() is not executed at
server process startup. However, the service can execute this method (for
example, from {service}_serverOnBoot()).
3 Do not call another service from this method. Other services may have not
started yet.
int {service}_serverInit(void);
On the first server-side request (when a client-side method makes a call to a
server-side method), if the server process is not already active or running (that is,
no {service}_serverOnBoot() method exists), a daemon process starts for
the service. On start, the server-side process looks for and executes
init method {service}_serverInit(), where {service} is name of the
service, if it exists.
This method is preferred over {service}_serverOnBoot() for the following
reasons:
• The service server process only starts or executes as required by the
application running in the system.
• Boot time is not affected, since the server-side process is started on demand
only.
• Development debug and testing is easier (that is, the unit does not have to be
rebooted for testing).
• Do not call other services during this call, since it is running in a protected
state.
int {service}_serverExit(void);
If a service server process receives a termination signal (SIGTERM) and if it
exists, the {service}_serverExit() method executes prior to terminating the
daemon process. Typically, a service server method is never terminated (an
exception may be during development/testing).
Service Compilation Figure 6 shows the flow of file development/processing to create a Service
Flow (shared .so library). {service}.c and svc_{service}.h are Service
developer source files. All others are either provided or generated by Verifone.
Building a Service The diagram in Figure 6 depicts the process of building a simple client-side only
Service. At the minimum Services require an interface definition (header file) and
its implementation (C file).
The first step is running the Service precompiler. This Java utility uses the
interface definition as input, and outputs a C file providing the links between the
Service methods and WDE XML commands. Service Interface and the
C Preprocessor provides command line syntax. Execute the Service precompiler
as:
(CC) -E -C (Includes) svc_{service}.h | java
-jar /usr/local/bin/ServicePrecompiler.jar
where:
(CC) Path name to the C compiler, usually
arm-none-linux-gnueabi-cpp.
(Includes) List of '-I' paths to #include'd files not in the Service source directory.
Include -I/usr/local/include for Verifone-provided header files.
The Service precompiler generates two files and outputs the Service Interface to
stdout. After running the Service precompiler, examine the console output. The
Service precompiler performs a number of compliance checks. When an interface
fails a compliance check the auto-generated files are not created and a
Compliance error is output. For example:
---------------------------
Compliance Error:
method return type is void* !
method : led_on
---------------------------
When the interface file passes all compliance checks, the output files are
generated and the interface is output to the console. It is important to verify that
the console output interface is correct; this is the interface detected by the Service
Precompiler and may be different than expected. For instance, if a comment tag
directive is missing, the definition is not included in the interface, or a function
prototype is not proceeded by /*SVC_PROTOTYPE*/ is not seen in the console
interface output and is not handled by the WDE autogen interface code.
The two auto-generated output files are:
After you are satisfied the interface is correctly processed, build the Service
library. The following required files are included in a Service compile:
WDE Environment west allows direct testing of Nexgen Services, bypassing the browser and server
Service Tester (lighttpd). It works with command and test XML files to interact with a service.
(west) To use west, develop a set of command and/or test files that exercise the
specified service functionality.
Usage :
west [-r cmd:fname] [-e] [-f] [-s] [-l logfname] [-t] [-i
count[:delay]] [-h]
Command Prompt
All command line arguments are optional. When west starts normally the
command prompt displays:
Enter Command [ m for menu ] :
Enter m to display the menu (output shown below). To keep the screen
uncluttered, the menu is not output at the command prompt.
Commands:
[1] cmd ; Run svc_cmd file
[2] cmdlist ; Run svc_cmd list file
[3] test ; Run svc_test file
[4] testlist ; Run svc_test list file
[0] Exit
The rtn xml section is not used when executing cmd commands, but can exist in
the file. This allows a single file to be used for both cmd and test commands.
Each xml section must be separated by at least one carriage return <CR>.
Order the sections as properties xml, then cmd xml, and lastly rtn xml.
properties xml has property name/value pairs contained within a
<svc_properties> parent:
<svc_properties>
<propName1>propValue1</propName1>
<propName2>propValue2</propName2>
...
<propNameN>propValueN</propNameN>
</svc_properties>
Refer to XML Command and Return Examples for detailed information on the
<svc_cmd> and <svc_rtn> XML formats. In general, they are of the form:
<svc_xxx>
<myServiceName>
<myMethodName>
... Method Data ...
</myMethodName>
</myServiceName>
</svc_xxx>
Note that in the WDE system, the properties provided by the browser furnish
information on settings a Service may need to react to, such as locality
(language). Refer to WDE Environment Service Tester (west) for the list of valid
WDE properties.
Automated Testing
The majority west command line parameters enable hands-off testing. For
example, a full regression test could be accomplished with a set of test
command files and a single testlist command file listing them. Then issue the
following west command:
$ west -r testlist:myTestlistFile -e -s -l testLogFile
to execute west and issue the testlist command (option 4), using
myTestlistFile.
-e Exit west on completion of this command (that is, do not display the command
prompt).
-s Suppress output to stdout; as the terminal is not interactive, there is no reason
to have it output to the screen.
-l Write all output to the specified log file; in this case, testLogFile.
Example 1
This is a simple Service function and combined cmd/test command file (with no
properties section).
function:
int math_square(int x)
{
errno = 0;
return (x*x);
}
cmd/test file:
<svc_cmd>
<math>
<square>
<x>5</x>
</square>
</math>
</svc_cmd>
<svc_rtn>
<math>
<square>
<return>25</return>
</square>
</math>
</svc_rtn>
SCGI Interface to This section details the requirements, architecture, and design of the Simple
Service Manager Common Gateway Interface (SCGI) interface to the Services of the Service
Manager stack.
The SCGI interface consists of an SCGI control daemon and supporting interface
library. This library is used by the http server (lighttpd), a PHP extension, and
the Stack Test Harness.
Requirements Following is a list of requirements, starting with the SCGI daemon manager, and
then the supporting library.
Architecture The Service Stack allows C applications, http server, or PHP to interface the
Service methods. Figure 7 illustrates the Service Stack architecture.
XML Interface This section contains the C and XML command and return format for each
exposed method in the Service utility.
utility getVersion
C Prototype
struct version utility_getVersion(void);
Command XML
<svc_cmd>
<utility>
<getVersion/>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<getVersion>
<return type="container">
<major>int</major>
<minor>int</minor>
<maint>int</maint>
<build type="string">string [max len 16]</build>
</return>
</getVersion>
</utility>
</svc_rtn>
utility gettime
C Prototype
char * utility_gettime(void);
Command XML
<svc_cmd>
<utility>
<gettime/>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<gettime>
<return type="string">string</return>
</gettime>
</utility>
</svc_rtn>
utility settime
C Prototype
int utility_settime(struct utilityDateTime * utildt /*NULL*/);
Command XML
<svc_cmd>
<utility>
<settime>
<utildt type="list">
<item type="container">
<tm_sec>int [default:0]</tm_sec>
<tm_min>int [default:0]</tm_min>
<tm_hour>int [default:0]</tm_hour>
<tm_mday>int [default:0]</tm_mday>
<tm_mon>int [default:0]</tm_mon>
<tm_year>int [default:0]</tm_year>
<tm_wday>int [default:0]</tm_wday>
<tm_yday>int [default:0]</tm_yday>
<tm_isdst>int [default:0]</tm_isdst>
</item>
</utildt>
</settime>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<settime>
<return>int</return>
</settime>
</utility>
</svc_rtn>
C Prototype
int utility_copyTime_linuxRTC(void);
Return Values
0 = Success
-1 = Failure
Command XML
<svc_cmd>
<utility>
<copyTime_linuxRTC/>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<copyTime_linuxRTC>
<return>int</return>
</copyTime_linuxRTC>
</utility>
</svc_rtn>
utility reboot
C Prototype
int utility_reboot(void);
Command XML
<svc_cmd>
<utility>
<reboot/>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<reboot>
<return>int</return>
</reboot>
</utility>
</svc_rtn>
utility getenvfile
C Prototype
struct utilityGetEnvFile utility_getenvfile(char * section /*NULL*/,
char * name /*NULL*/);
Command XML
<svc_cmd>
<utility>
<getenvfile>
<section type="string">string [default:NULL]</section>
<name type="string">string [default:NULL]</name>
</getenvfile>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<getenvfile>
<return type="container">
<count>int</count>
<value type="string">string [max len 512]</value>
</return>
</getenvfile>
</utility>
</svc_rtn>
utility getenvfilename
C Prototype
struct utilityGetEnvFile utility_getenvfilename(char * pathname /*NULL*/,
char * section /*NULL*/, c
Command XML
<svc_cmd>
<utility>
<getenvfilename>
<pathname type="string">string [default:NULL]</pathname>
<section type="string">string [default:NULL]</section>
<name type="string">string [default:NULL]</name>
</getenvfilename>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<getenvfilename>
<return type="container">
<count>int</count>
<value type="string">string [max len 512]</value>
</return>
</getenvfilename>
</utility>
</svc_rtn>
utility putenvfile
C Prototype
int utility_putenvfile(char * section /*NULL*/, char * name /*NULL*/,
char * value /*NULL*/);
Command XML
<svc_cmd>
<utility>
<putenvfile>
<section type="string">string [default:NULL]</section>
<name type="string">string [default:NULL]</name>
<value type="string">string [default:NULL]</value>
</putenvfile>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<putenvfile>
<return>int</return>
</putenvfile>
</utility>
</svc_rtn>
utility putenvfilename
C Prototype
int utility_putenvfilename(char * pathname /*NULL*/, char * section /
*NULL*/, char * name /*NULL*/,
Command XML
<svc_cmd>
<utility>
<putenvfilename>
<pathname type="string">string [default:NULL]</pathname>
<section type="string">string [default:NULL]</section>
<name type="string">string [default:NULL]</name>
<value type="string">string [default:NULL]</value>
</putenvfilename>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<putenvfilename>
<return>int</return>
</putenvfilename>
</utility>
</svc_rtn>
utility iniContents
C Prototype
struct utilityIniContents utility_iniContents(char * pathname /*NULL*/);
Command XML
<svc_cmd>
<utility>
<iniContents>
<pathname type="string">string [default:NULL]</pathname>
</iniContents>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<iniContents>
<return type="container">
<sections type="list">
<item type="container">
<section type="string">string</section>
<entries type="container">
<list type="pairlist">
<nameN>valueN</nameN>
<!-- ... -->
</list>
<list_count>int</list_count>
</entries>
</item>
<!-- ... list <item> count defined by sections_count -->
</sections>
<sections_count>int</sections_count>
</return>
</iniContents>
</utility>
</svc_rtn>
utility installfile
C Prototype
struct installStatus utility_installfile(void);
Command XML
<svc_cmd>
<utility>
<installfile/>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<installfile>
<return type="container">
<result>int</result>
<msg type="string">string [max len 256]</msg>
</return>
</installfile>
</utility>
</svc_rtn>
utility runApplication
C Prototype
struct installStatus utility_runApplication(char * app /*NULL*/);
Command XML
<svc_cmd>
<utility>
<runApplication>
<app type="string">string [default:NULL]</app>
</runApplication>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<runApplication>
<return type="container">
<result>int</result>
<msg type="string">string [max len 256]</msg>
</return>
</runApplication>
</utility>
</svc_rtn>
utility externalStorage
C Prototype
struct utilityExternalStorage utility_externalStorage(void);
Return Values
A list of available external devices.
Command XML
<svc_cmd>
<utility>
<externalStorage/>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<externalStorage>
<return type="container">
<storage_count>int</storage_count>
<storage type="list">
<item type="container">
<type>int</type>
<mountPoint type="string">string [max len 64]
</mountPoint>
</item>
<!-- ... list <item> count defined by storage_count -->
</storage>
</return>
</externalStorage>
</utility>
</svc_rtn>
utility displayBrightness
C Prototype
int utility_displayBrightness(int level /* 50 */);
Command XML
<svc_cmd>
<utility>
<displayBrightness>
<level>int [default: 50 ]</level>
</displayBrightness>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<displayBrightness>
<return>int</return>
</displayBrightness>
</utility>
</svc_rtn>
utility fbgrab
C Prototype
int utility_fbgrab(char * pngfile /*""*/, int interlace /* 0 */,
int x /*0*/, int y /*0*/, int w /*0);
Parameters
pngfile Full pathname of PNG image file to produce from grab of framebuffer
content.
h Height in pixels of screen capture (0 causes full height starting from y).
Return Values
0 = Successful request
-1 = Unable to complete request.
Notes:
• If pngfile is NULL or empty, default "/tmp/screenshot.png" will be used.
• All output capture files are of type png, regardless of name extension
specified.
• To get display pixel (w,h), see svc_sysinfo.h - sysinfo_platform(); On error
return, errno:
• EINVAL if the input params are invalid (negative or out of range).
• EACCES unable to create/open for write, pngfile as specified.
• EBADF unable to write to pngfile (no space?).
Command XML
<svc_cmd>
<utility>
<fbgrab>
<pngfile type="string">string [default:""]</pngfile>
<interlace>int [default: 0 ]</interlace>
<x>int [default:0]</x>
<y>int [default:0]</y>
<w>int [default:0]</w>
<h>int [default:0]</h>
</fbgrab>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<fbgrab>
<return>int</return>
</fbgrab>
</utility>
</svc_rtn>
utility isCgiWDE
C Prototype
int utility_isCgiWDE(void);
Command XML
<svc_cmd>
<utility>
<isCgiWDE/>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<isCgiWDE>
<return>int</return>
</isCgiWDE>
</utility>
</svc_rtn>
utility isSourceTrustedWDE
C Prototype
int utility_isSourceTrustedWDE(void);
Command XML
<svc_cmd>
<utility>
<isSourceTrustedWDE/>
</utility>
</svc_cmd>
Return XML
<svc_rtn>
<utility>
<isSourceTrustedWDE>
<return>int</return>
</isSourceTrustedWDE>
</utility>
</svc_rtn>
Data Structures This section presents the Service utility data structures.
Data Fields
int result
• 0 = Install complete; no reboot
• 1 = Install complete; reboot required
• < 0 = Error
char msg [256]
• Install error message (only valid when result < 0)
int installStatus::result
• 0 = Install complete; no reboot
• 1 = Install complete; reboot required
• < 0 Error
The documentation for this struct was generated from the following file:
• svc_utility.h
utilityAnExternalStorage
Data Fields
• int type – Storage media type:
• 1=USB
• 2 = microSD
int utilityAnExternalStorage::type
• char mountPoint [64] – Mount point.
Mount point.
char utilityAnExternalStorage::mountPoint[64]
utilityDateTime
Data Fields
• int tm_sec – seconds
int utilityDateTime::tm_sec
• int tm_min – minutes
int utilityDateTime::tm_min
• int tm_hour – hours
int utilityDateTime::tm_hour
• int tm_mday – day of the month
int utilityDateTime::tm_mday
• int tm_mon – month
int utilityDateTime::tm_mon
• int tm_year – year
int utilityDateTime::tm_yday
• int tm_wday – day of the week
int utilityDateTime::tm_wday
• int tm_yday – day in the year
int utilityDateTime::tm_year
• int tm_isdst – daylight saving time
int utilityDateTime::tm_isdst
utilityExternalStorage
Data Fields
• int storage_count
int utilityExternalStorage::storage_count
• struct utilityAnExternalStorage?
struct utilityAnExternalStorage? utilityExternalStorage::storage
utilityGetEnvFile
C Prototype
utility_getenvfile(char * section, char * name);
Parameters
Return Values
struct getEnvFile
Notes:
• On getEnvFile.count < 0 return, errno:
• ENOENT when name entry not found in section specified in config ini file.
For XML interface, see xml:utility_getenvfile
Data Fields
• int count
• >=0 – section/name exists in envFile,
• < 0 Error
int utilityGetEnvFile::count
• char value [UTILITY_MAX_VALUE_LEN] – Environment variable for section
and name (only valid when int count > 0)
char utilityGetEnvFile::value[UTILITY_MAX_VALUE_LEN]
utilityIniContents
Data Fields
• struct utilityIniSection * sections – The array of ini section data.
struct utilityIniSection * utilityIniContents::sections
• int sections_count – The number of ini sections (array len)
int utilityIniContents::sections_count
utilityIniSection
Data Fields
• char * section – The section name.
char * utilityIniSection::section
• struct pairlist entries – The name/value pairs under section.
struct pairlist utilityIniSection::entries
File Structures This section presents the Service utility file structures.
svc utility.h
The utility service interface methods file. The utility service contains general
purpose (non-category) methods for doing things such as get system time, reboot,
and so on.
#include "svcmgrSvcDef.h"
Data Structures
• struct installStatus – Returns the install status.
• struct utilityGetEnvFile – Returns getEnvFile.
• struct utilityIniSection – Returns the contents of a single section of
a Config (ini) file.
• struct utilityIniContents – Returns the complete contents of a
Config (ini) file.
• struct utilityAnExternalStorage – Returns information on a single
external storage device.
• struct utilityExternalStorage – Returns information on all available
external storage devices.
• struct utilityDateTime – Replica of the Linux structure tm in time.h.
Defines
• #define UTILITY_MAX_LABEL_LEN (32)
• #define UTILITY_MAX_VALUE_LEN (512)
Functions
• struct version utility_getVersion (void) – Retrieves the service
version.
Return Values
Structure version containing version.
Return Values
malloced string containing the system time or NULL on error.
• On NULL return, errno:
• ENOMEM – Unable to malloc space for return string.
Parameters
time The structure utilityDateTime
Return Values
• = 0 – Success
• = -1 – Failure
Return Values
• = 0 – successful request
• = -1 – unable to complete request.
• On error return, errno:
• ECHILD when unable to fork child process to handle reboot request.
Return Valutes
getEnvFile
• On getEnvFile.count < 0 return, errno:
• ENOENT when name entry not found in section specified in config ini
file.
For XML interface, see xml:utility_getenvfile
Return Values
• = 0 – Successful request
• = -1 – unable to complete request.
NOTE
section must be specified. If value is specified, name must be specified. If
name is specified, and value == empty, the entry is removed.
Return Values
= 0 – Successful request
= -1 – unable to complete request.
NOTE
section must be specified. If value is specified, name must be specified. If
name is specified and value == empty, the entry is removed.
Parameters
pathname The full pathname of ini file to retrieve contents.
Return Values
struct utilityIniContents
• On error return, errno:
• ENODATA – The filename is NULL or empty.
• ENOENT – The filename not found or could not be opened.
• ENOMEM – Out of memory.
• EFAULT – Internal error is preventing successful completion.
• struct installStatus utility_installfile (void) – Installs the
file/package in the system. For XML interface, see xml:utility_installfile.
Return Values
• = 0 – not from WDE cgi process
• = 1 – from WDE cgi process.
• struct installStatus utility_runApplication (char *app) –
Runs an application.
Parameters
app Executable to start, set to NULL to exit system mode and start default
applications.
Return Values
• installStatus – The install status code and error string (if appropriate)
• = 0 – success
• <0 error (see installStatus).
• If >= 0 current level returned (post level set); If = -1 then error, check errno:
Return Values
• EINVAL – Input level is > 100.
• ENOENT – Unable to open display brightness control device for read.
• EPERM – Unable to open display brightness control device for write.
• EBADF – Write of new brightness level failed.
NOTE Due to translation of user levels to hardware levels, setting brightness to a level
may result in another level value returned when successful. If the brightness is
decreased, a translated value is used that will decrease the brightness (down to
minimum allowed) that may result in a returned value different from what was
requested. The same is true when increasing brightness.
Return Values
• = 0 – from WDE and source is not trusted (unsigned)
• = 1 – Success. Trusted WDE source or any other source.
• errno == 0 always when returning from this method.
int utility_copyTime_linuxRTC ()
Input Events
V/OS terminals support input events as captured through the Linux kernel Input
Event module. The Input Events module supports the USB Human Interface
Device (HID), including the keyboard and scanner. The mouse device is not fully
implemented at this time. There is full support for the keyboard and scanner
devices.
Input Event These calls control the USB HID and capture event data.
Functions
inputOpen()
Opens the USB device. Only one device can be open at a time.
Prototype
int inputOpen(int vfi_device);
Parameters
vfi_device The device desired to open as defined in vfiInputAPI.h header file
as follows:
• VFI_USB_KBD
• VFI_USB_SCANNER
Return Values
inputRead()
Capture read events. Currently, touchpad and mouse events are not captured.
Only keyboard and scanner data is read. If inputRead() is called in a loop, data
is continually read from the keyboard or scanner device, allowing data to be
captured as it is entered/scanned.
Prototype
int inputRead(int inHdl);
Parameters
inHdl The device handle obtained from opening the device with inputOpen().
Return Values
Returns the ASCII value or the raw scancode of the key pressed or data scanned.
inputClose()
Close the device. When the device is closed, lit LEDs are shut off.
Prototype
int inputClose(int inHdl);
Parameters
inHdl The device handle obtained from opening the device with inputOpen().
Return Values
0 Success
Device Drivers
Details on the standard Linux drivers are available from the open source
community. The succeeding sections will detail the Verifone specific drivers.
Display
The V/OS supports the display of all devices on all platforms. The V/OS display
backlight supports 64 levels of intensity. Setting the brightness to 0 turns off the
backlight. The legacy API dspSetBrightness() changes the backlight intensity
to two counts with each call for compatibility.
Note that if legacy applications directly set the backlight intensity using the
*BACKLIGHT configuration variable, that value must be scaled (from 1–63) before
being set.
Refer to the hardware guide for your terminal for display resolution values.
Display Use the following function calls to manage the V/OS display.
Functions
dspSetBrightness()
NOTE Each call to dspSetBrightness() adjusts the level by two steps. If the
*BACKLIGHT configuration variable is set directly using the application or config
file, then the value must be between 1 and 63.
NOTE
When direction = 0, the backlight turns off.
Prototype
short dspSetBrightness(short direction);
Parameters
direction
0 Decrease brightness.
1 Increase brightness.
Return Values
=0 OK.
LEDs
V/OS-based terminals have LEDs to inform the user that they can swipe their
card. V/OS supports all types of LEDs on devices of all platforms. LEDs are
terminal-specific. V/OS supports the following LED configurations:
• Keypad
• MSR
• Smart card
• CTLS
• Device logo
• System indication
LEDs are controlled by the application using libled library. More complex use of
these LEDs requires a thread or timer for synchronization. Use the ecore timers
available in the GUI library.
NOTE
For legacy applications, if your application directly addresses the LEDs, update
the calls to use the definitions found in svc.h.
Led_ledOn()
Enables the LEDs. A bit mask selects which LED(s) to turn on.
Prototype
Enum result led_ledOn(int leds);
Parameters
leds
LED_MSR MSR top LED
LED_MSR1 MSR middle LED
LED_MSR2 MSR bottom LED
LED_KP Keypad LED
LED_LOGO Logo LED
LED_BOOT_ERROR Boot LED
LED_SC Smartcard LED
CTLS_FIRST First CTLS LED
CTLS_SECOND Second CTLS LED
CTLS_THIRD Third CTLS LED
CTLS_FOURTH Fourth CTLS LED
LED_SYSTEM_GREEN System LED
LED_SYSTEM_RED System LED
Return Values
enum result {
ERROR_INIT=1<<0,
ERROR_KP=1<<1,
ERROR_LOGO=1<<2,
ERROR_BOOT_ERROR=1<<3,
ERROR_MSR=1<<4,
ERROR_MSR2=1<<5,
ERROR_MSR3=1<<6,
ERROR_SC=1<<7,
LEDS_SUCCESS=1<<8,
ERROR_CTLS=1<<9,
ERROR_SYSTEM_GREEN=1<<10,
ERROR_SYSTEM_RED=1<<11,
};.
218 V/OS PROGRAMMERS MANUAL
LED S
led_ledOff()
led_ledOff()
Disables one or more LEDs. A bit mask selects which LED(s) to turn off.
Prototype
void led_ledOff(int leds);
Parameters
leds
LED_MSR MSR top LED
LED_MSR1 MSR middle LED
LED_MSR2 MSR bottom LED
LED_KP Keypad LED
LED_LOGO Logo LED
LED_BOOT_ERROR Boot LED
LED_SC Smartcard LED
CTLS_FIRST First CTLS LED
CTLS_SECOND Second CTLS LED
CTLS_THIRD Third CTLS LED
CTLS_FOURTH Fourth CTLS LED
LED_SYSTEM_GREEN System LED
LED_SYSTEM_RED System LED
Return Values
None.
led_init()
Prototype
int led_ledinit();
Parameters
None
Return Values
=0 Success
= -1 Failure
led_release()
Prototype
int led_release();
Parameters
None
Return Values
=0 Success
= -1 Failure
led_start_blinking()
Prototype
enum result * led_start_blinking(int leds, unsigned int duration_on,
unsigned int duration_off,unsigned int
timeout);
Parameters
leds The ioctl to one of the drivers (can be the LED driver or the
smart card driver).
duration_on The duration (in milliseconds) that the LED is on.
duration_off The duration (in milliseconds) that the LED is off.
timeout if > 0, the LED stops blinking after timeout seconds.
Return Values
enum result {
ERROR_INIT=1<<0,
ERROR_KP=1<<1,
ERROR_LOGO=1<<2,
ERROR_BOOT_ERROR=1<<3,
ERROR_MSR=1<<4,
ERROR_MSR2=1<<5,
ERROR_MSR3=1<<6,
ERROR_SC=1<<7,
LEDS_SUCCESS=1<<8,
ERROR_CTLS=1<<9,
ERROR_SYSTEM_GREEN=1<<10,
ERROR_SYSTEM_RED=1<<11,
};.
led_stop_blinking2()
Prototype
enum result led_stop_blinking2(int leds);
Parameters
leds
LED_MSR MSR top LED
LED_MSR1 MSR middle LED
LED_MSR2 MSR bottom LED
LED_KP Keypad LED
LED_LOGO Logo LED
LED_BOOT_ERROR Boot LED
LED_SC Smartcard LED
CTLS_FIRST First CTLS LED
CTLS_SECOND Second CTLS LED
CTLS_THIRD Third CTLS LED
CTLS_FOURTH Fourth CTLS LED
LED_SYSTEM_GREEN System LED
LED_SYSTEM_RED System LED
Return Values
enum result {
ERROR_INIT=1<<0,
ERROR_KP=1<<1,
ERROR_LOGO=1<<2,
ERROR_BOOT_ERROR=1<<3,
ERROR_MSR=1<<4,
ERROR_MSR2=1<<5,
ERROR_MSR3=1<<6,
ERROR_SC=1<<7,
LEDS_SUCCESS=1<<8,
ERROR_CTLS=1<<9,
ERROR_SYSTEM_GREEN=1<<10,
ERROR_SYSTEM_RED=1<<11,
};.
led_read_led()
Prototype
enum result led_read_led(int leds, unsigned char *cmd);
Parameters
leds
LED_MSR MSR top LED
LED_MSR1 MSR middle LED
LED_MSR2 MSR bottom LED
LED_KP Keypad LED
LED_LOGO Logo LED
LED_BOOT_ERROR Boot LED
LED_SC Smartcard LED
CTLS_FIRST First CTLS LED
CTLS_SECOND Second CTLS LED
CTLS_THIRD Third CTLS LED
CTLS_FOURTH Fourth CTLS LED
LED_SYSTEM_GREEN System LED
LED_SYSTEM_RED System LED
Cmd LED status (on/off):
• 0 = LED off
• 1 = LED on
Return Values
enum result {
ERROR_INIT=1<<0,
ERROR_KP=1<<1,
ERROR_LOGO=1<<2,
ERROR_BOOT_ERROR=1<<3,
ERROR_MSR=1<<4,
ERROR_MSR2=1<<5,
ERROR_MSR3=1<<6,
ERROR_SC=1<<7,
LEDS_SUCCESS=1<<8,
ERROR_CTLS=1<<9,
ERROR_SYSTEM_GREEN=1<<10,
ERROR_SYSTEM_RED=1<<11,
};.
led_read_led_ctls()
Prototype
enum result led_read_led_ctls(int leds, int *read_res);
Parameters
leds
LED_MSR MSR top LED
LED_MSR1 MSR middle LED
LED_MSR2 MSR bottom LED
LED_KP Keypad LED
LED_LOGO Logo LED
LED_BOOT_ERROR Boot LED
LED_SC Smartcard LED
CTLS_FIRST First CTLS LED
CTLS_SECOND Second CTLS LED
CTLS_THIRD Third CTLS LED
CTLS_FOURTH Fourth CTLS LED
LED_SYSTEM_GREEN System LED
LED_SYSTEM_RED System LED
read_res LED status (on/off):
• 0 = LED off
• 1 = LED on
Return Values
enum result {
ERROR_INIT=1<<0,
ERROR_KP=1<<1,
ERROR_LOGO=1<<2,
ERROR_BOOT_ERROR=1<<3,
ERROR_MSR=1<<4,
ERROR_MSR2=1<<5,
ERROR_MSR3=1<<6,
ERROR_SC=1<<7,
LEDS_SUCCESS=1<<8,
ERROR_CTLS=1<<9,
ERROR_SYSTEM_GREEN=1<<10,
ERROR_SYSTEM_RED=1<<11,
};.
led_switch_color()
Prototype
enum result led_switch_color(int leds,char color);
Parameters
leds
LED_MSR MSR top LED
LED_MSR1 MSR middle LED
LED_MSR2 MSR bottom LED
LED_KP Keypad LED
LED_LOGO Logo LED
LED_BOOT_ERROR Boot LED
LED_SC Smartcard LED
CTLS_FIRST First CTLS LED
CTLS_SECOND Second CTLS LED
CTLS_THIRD Third CTLS LED
CTLS_FOURTH Fourth CTLS LED
LED_SYSTEM_GREEN System LED
LED_SYSTEM_RED System LED
color Toggle LED color:
• 0 = color 1
• 1 = color 2
Return Values
enum result {
ERROR_INIT=1<<0,
ERROR_KP=1<<1,
ERROR_LOGO=1<<2,
ERROR_BOOT_ERROR=1<<3,
ERROR_MSR=1<<4,
ERROR_MSR2=1<<5,
ERROR_MSR3=1<<6,
ERROR_SC=1<<7,
LEDS_SUCCESS=1<<8,
ERROR_CTLS=1<<9,
ERROR_SYSTEM_GREEN=1<<10,
ERROR_SYSTEM_RED=1<<11,
};
CardSlot Library
The V/OS CardSlot Library is a layer above the OS, which communicates with
ICCs (Integrated Chip Cards). This library provides a high-level interface
independent of the protocol negotiated between the chip card slot and the ICC.
Use the V/OS CardSlot Library to build smartcard applications on V/OS-based
terminals. This document details the supported APIs. Figure 8 illustrates the
CardSlot architecture.
Some V/OS-based terminals have a touch panel, which can be used for signature
captures. The touch panel is calibrated (also called compensation) at the factory.
The touch panel requires calibration once placed in service. Once calibrated after
installation, no periodic calibration is required. Touch panel calibration is
performed using the System Mode menu under Administration > Touch Panel.
Touch Panel Touch capture technology supports Stylus Priority, which means that if a finger
and the stylus are placed on the panel, the position input comes from the stylus
and the finger is ignored. Stylus Priority mode is enabled by default.
TIFF Functions The TIFF function calls allow the application to generate a TIFF file from captured
signature data. It is normally called after SigCapGet().
These calls require libtiff.so available from Verifone in a publicly available
library distribution. The library distribution files are not changed in any way by
Verifone; we simply run a special configuration and build to reflect the functionality
to extract from the library, facilitating new library releases.
The library has four application header files: tiffvers.h, tiffconf.h,
tiffio.h, and tiff.h, built when the library gets configured and built. Do not
alter these files as any rebuild of the library might invalidate or overwrite them.
Applications using libtiff use #include tiffio.h, which automatically
includes these three files.
The main features (such as, CCITTFAX4 compression currently used in Verifone
products) are enabled. However, enabling every feature would result in a
significantly larger libtiff file. That is why JPEG is not supported.
Verifone also supplies library libcaptouch.so, which provides a wrapper
allowing easy use of the library for typical Verifone applications. The signature
capture functionality provided in the library is as follows:
#include sig.h that includes sigtiff.h,which prototypes the following:
typedef struct {
short x;
short y;
} __attribute__((packed)) xy_t;
It continues with:
typedef struct
{
short left,upper,right,lower;
} SigCapBox_t;
typedef struct
{
long joinPoints: 1;
long trimWidth: 1;
long trimHeight: 1;
long xminus1yminus1 : 1;
long xyminus1 : 1;
long xplus1yminus1 : 1;
long xminus1y : 1;
long xy : 1;
long xplus1y : 1;
long xminus1yplus1 : 1;
long xyplus1 : 1;
long xplus1yplus1 : 1;
SigCap2Tiff()
Creates the fname file in TIFF format. Do not set fname to 0; returns an error.
Prototype
int SigCap2Tiff
(
char *fname,xyz_t *sig, int count,short compression_scheme,
xy_t *dpi,SigCapBox_t *box, SigCapOptions_t *options,
void (*setTiffUserTags)(TIFF *)
);
Parameters
NOTE
setTiffUserTags can override the default date/time tag is automatically
inserted into the file.
This optional user-supplied parameter can override standard tags (be careful or
the TIFF image may be affected or unusable), and define and specify new user
tags in the range MIN_TIFFTAG_USER to MAX_TIFFTAG_USER (both defined in
sigtiff.h).
The following code snippet is an example of setTiffUserTags calling the
structure containing the user-specified tags. in the example, TIFFTAG_GEO…
user-defined tags have values in the range MIN_TIFFTAG_USER to
MAX_TIFFTAG_USER. Consult the tiffio.h header file for a summary of fields
in the TIFFFieldInfo structure.
CAUTION The open source TIFF library does not implement complete error checking. Use
only TIFF tag values within the defined range. Unpredictable results occur with
other tag values.
This function makes the user-defined tags available to the TIFF library, but only
actually uses one tag. The other tag is a standard TIFF tag set to a user-specified
value.
It is not necessary to call TIFFMergeField or a TIFFFieldInfo structure to
use standard tags. Consult tiff.h for a full list. Avoid using tags assigned by
other manufacturers. These tags are safest to use:
TIFFTAG_DOCUMENTNAME, TIFFTAG_IMAGEDESCRIPTION, TIFFTAG_MAKE,
TIFFTAG_MODEL, TIFFTAG_PAGENAME, TIFFTAG_SOFTWARE, TIFFTAG_ARTIST,
TIFFTAG_HOSTCOMPUTER, TIFFTAG_TARGETPRINTER, TIFFTAG_COPYRIGHT
Return Values
=0 Success
<0 Error
V/OS terminals use the Advanced Linux Sound Architecture (ALSA) solution. V/
OS terminals support both uncompressed audio (wav) and MP3 format audio.
Currently, V/OS terminals do not support a beeper function. All V/OS terminals
units have an independent audio codec that supports stereo output.
Audio Functions Use the following calls to control audio in V/OS terminals.
soundCtrl()
NOTE
This legacy audio function call is supported on V/OS, but there is no support for
setting bass and treble.
Prototype
int soundCtrl(int volume, int bass, int treble);
Parameters
volume Valid values: 0–100.
0 Sound off.
Return Values
=0 No error.
<0 Error.
The Linux operating system is divided into two spaces: the kernel space and the
user space. The kernel space is for device drivers that must interact closely with
the hardware. This interaction includes interrupt handling, precise timing, and
hardware interfaces that require bit flipping.
The user space code is easier to debug, maintain, and provides superior
protection from bugs. V/OS terminals perform most of its protocol processing in
libraries that reside in the user space. Kernel drivers implement the standard
open/close/read/write functions needed by the protocol libraries.
The mapping of COMx to ttyAMAx is different on each terminal.
NOTE On V/OS-based terminals the I/O module determines available ports. The
Wrenchman co-processor is in select I/O modules. COM1/COM2/COM3/COM4
may not be available on all configurations.
Port assignments are dependent on terminal configuration. All ports are available
as general RS-232 ports configured using different baud rates, character sizes,
parity, and stop bits through either standard Linux calls. Supported baud rates for
all ports are: 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200.
Serial port devices can be opened for control by more than one process at a time.
The following ioctl() calls prevent processes from using the port, allowing
exclusive access to the port.
TIOCEXCL Put the ttyAMAx into exclusive mode, where no further open()
operations are permitted. They will fail with EBUSY, except for
root.
V/OS-based terminal COM ports do not support parity errors and BREAK
condition detection. The application must know which control and status lines are
supported by each COM port. Control lines not supported by the hardware report
the last status set by the application, and unsupported status lines report as
asserted.
When a port is open through the O_NONBLOCK option, the read() command
return value for that port can have different results if configured with flow control
enabled. When flow control is enabled and no data is available on the port,
read() returns 0. If flow control is not enabled and no data is available, read()
returns -1 with errno set to EAGAIN (11 – try again). Both values indicate that no
data is available.
COM1 COM1, or device /dev/ttyAMA0, supports the RTS, CTS, and DCD hardware
lines.
COM2 COM2, or device /dev/ttyAMA1, supports the RTS, CTS, DTR, and DCD
hardware lines. RTS/CTS flow control is under device driver control, and the RTS
line must be controlled by the application using Linux ioctl() calls:
#include <unistd.h>
#include <termios.h>
int fd;
int status;
ioctl(fd, TIOCMGET, &status);
status &= ~TIOCM_RTS;
ioctl(fd, TIOCMSET, &status);
The USB (version 1.1) serial device gadget is only supported over a berg cable.
The USB OTG port does not support USB serial devices.
V/OS terminals support the following ioctl() to detect cable status:
int handle, connected;
#define port "/dev/ttyGS0"
// Re-open port
IPP Module
IPP Functions All IPP functions are defined in the header file svcsec.h. Applications must link
with the libvfisec.so library using -lvfisec.
ippOpen()
Takes ownership of the IPP and clears the internal IPP FIFO. This function always
returns 0.
Prototype
int ippOpen(void);
Return Values
=0 Success
ippClose()
Releases ownership of the IPP. All unread data is lost. This function always
returns 0.
Return Values
=0 Success
ippRead()
Transfers data from the IPP FIFO to the application data buffer.
Prototype
int ippRead(char *buffer, int size);
Parameters
buffer Pointer to the data area.
size Maximum number of bytes to read.
Return Values
>0 Number of bytes returned in buffer
=0 No data to read
For IPP PIN entry the IPP sends an <EOT> (0x04) character
For VSS PIN entry the iStatus value returned by the iPS_GetPINResponse()
function is set to 0x0C. Subsequent calls to iPS_GetPINResponse() return a
iStatus value of 0x01 indicating that the PINpad is idle (that is, not in a PIN session).
ippWrite()
Transfers a single complete IPP packet or a single character from the buffer into
the IPP. Incomplete, incorrectly framed packets, overly large, or multiple packets
in a single write are rejected. The valid start-of-packet characters are STX and SI.
The valid end-of-packet characters are ETX and SO. The only single characters
accepted are ACK, NAK, and EOT.
Prototype
int ippWrite(char *buffer, int size);
Parameters
buffer Pointer to the data area.
size Maximum number of bytes to write.
Return Values
=size The packet was transferred to the IPP.
-EACCES Too may PIN sessions requested during a short period of time. Try
again in a few seconds. See note below.
-EINVAL Buffer is too large to be a valid IPP packet, the buffer pointer is not
valid, the single character was not one of [ACK, NACK, EOT], the
packet has a bad LRC, or the packet is not framed correctly.
NOTE
PIN encryption is limited to one per 30 seconds on average to deter an
exhaustive PIN search.
SetSecurePINDisplayParameters()
On touch screen displays, this parameter registers the PIN entry callback function
for the upcoming PIN session. This function must be called before requesting a
PIN session either through an IPP packet (Z60, Z63 or Z69) or through the
VeriShield Security Script calls (iPS_RequestPINEntry()).
The hot spot table is relevant only for terminal models that perform PIN collection
through the touch panel. The first parameter is not used and is reserved for future
use. To ensure future compatibility, applications must pass a NULL pointer for the
first parameter.
Prototype
void setSecurePINDisplayParameters(struct touch_hs_s, void *callback);
With the callback function, the PIN entry process can control the audio and visual
aspects as each key press is detected, and its prototype is:
void callback(char value);
Value Action
Lower nibble:
0x?1 A numeric key was pressed. A PIN digit has been added to the
internal PIN buffer. Application should display an <echo>
character.
0x?2 BACKSPACE key was pressed. A PIN digit has been removed
from the internal PIN buffer. Application should display a
<default> character (for example, space, ‘-’, or ‘_’) in place of the
last <echo> character.
0x?3 CLEAR key was pressed. All PIN digits have been removed from
the internal PIN buffer. Application should replace all <echo>
characters with <default> characters.
0x?4 PIN entry is not allowed.
0x?5 Other key #1 was pressed. PIN entry is canceled as if the
CANCEL key was pressed. The application can use this code to
define an option key such as a CREDIT button.
0x?6 Other key #2 was pressed. PIN entry is canceled as if the
CANCEL key was pressed. The application can use this code to
define an option key such as a CREDIT button.
0x?7 PIN entry is canceled as if the CANCEL key was pressed. The
application can use this code to define an option key such as a
CREDIT button.
0x?8 Pin entry had started. The keypad is in Secure mode, and
applications do not receive the actual key, but only receive a
value from this callback.
Value Action
Upper nibble:
0x7? Play “normal” sound.
0xF? Play “error” sound. This is sent when:
• BACKSPACE or CLEAR is pressed when there is no PIN digit
in the internal buffer.
• A numeric key is pressed when there is already the maximum
number of PIN digits in the internal buffer.
• ENTER is pressed when there is not the minimum number of
PIN digits in the internal buffer.
Example 3: A key is pressed to clear the line when three inputs are entered:
callback(0x73);
/* Tell the application to play normal sound and that CLEAR was pressed*/
ippPinEntryStatus()
Returns the PIN entry status, the number of PIN digits currently in the internal PIN
buffer and the code of the last non-numeric key pressed.
Prototype
int ippPinEntryStatus(int *count, int *lastNonNumericKey);
Parameters
Return Values
=1 PIN entry in progress.
<0 Error.
ippTerminatePinEntry()
Prototype
int ippTerminatePinEntry(void);
Return Values
=0 Success
<0 Error
IPP MS and The required packet commands of the IPP for MS (Master Session) or DUKPT
DUKPT operations supported by the V/OS are described in this section.
Communications
Packets
Advanced The differences between the V/OS IPP MS and DUKPT are as follows:
Programming in IPP
IPP IPP6 IPP7 VVIPP IPP8 VVIPP8 V/OS IPP8
Secure Message Mode No Yes No Yes No No
Spain SEMP/4B Yes Yes No Yes No No
Key tagging Yes No No No No No
DUKPT Engines 1 1 1 3 3 3
VVIPP supports IPP7 GISKE 3DES key features with one enhancement: All 10
master keys can be triple-length. IPP7 is limited to at most three triple-length keys.
Minor Differences This section describes the differences between the IPP7 used in legacy products
by Packet and the V/OS IPP modules.
where, vvv is the version number, mm is the release month, and yy is the release
year.
Packets The packet set is similar to that used for external PIN pads, such as the
PINpad1000, however, unlike previous IPPs, the V/OS terminals IPP is a software
module running on the main CPU. Previous IPPs used dedicated microcontrollers
connected to the main CPU through a serial port. In V/OS terminals IPP the serial
port is emulated in software along with all IPP functionality.
The IPP command and response packets can be divided into the following
categories:
• Common packets: Packets used in both MS and DUKPT.
• MS-specific packets: Packets used while doing MS.
• DUKPT-specific packets: Packets used while doing DUKPT.
• MAC-specific packets: MAC generation of received message packets.
NOTE
The V/OS terminals IPP do not support Spain SEMP/4B mode or Secure
Messaging (SM) mode.
The IPP supports both MS and DUKPT key management modes concurrently.
Also, the IPP supports MAC processing while doing MS or DUKPT.
The following table lists packets used in both MS and DUKPT sessions.
Packet Description
01 Interactive diagnostic routine
05 Transfer serial number
06 Request PIN pad serial number
09 Response to Packet 01
11 PIN pad connection test
12 Dummy packet
13 Select baud rate
14 Response to Packet 01
Packet Description
15 Set IPP key management mode
17 Set IPP7 key management mode
18 Check IPP7 key management mode
M04 Read Permanent Unit Serial Number (IPP8 Emulation)
Packet Description
02 Load/set master key
04 Check master key
07 'Dummy' DES reliability test
08 Select master key
Z60 Accept and encrypt PIN (VISA mode)
Z63 Accept and encrypt PIN, custom PIN entry requirements (VISA mode)
71 Response PIN block
Z66 MAC processing
Z67 Return MAC
72 Cancel MAC session
Packet Description
90 Load initial key
91 Confirm initial key
75 Encrypt PIN/authentication data response
78 Encrypt PIN/authentication data test request
76 PIN entry test request
71 Response PIN entry test request of “76”
Z60 Accept and encrypt PIN request (VISA mode)
Z63 Accept and encrypt PIN, custom PIN entry requirements (VISA mode)
Z69 Accept and encrypt PIN/data authentication request (VISA mode)
73 Response PIN block
19 Select a DUKPT Engine (IPP8 Emulation)
25 Check the DUKPT Engine (IPP8 Emulation)
The IPP returns <ACK> within 20ms to the terminal when it receives a properly
framed packet with a valid LRC. When other framing is received for a command
that requires <STX><ETX> framing (for example, <SI><SO>, <SI><ETX>, or
<STX><SO>), <ACK> is returned if the LRC is valid; only the specified framing is
processed.
This rule also applies to <SI><SO> packet commands. The IPP does not act on
an incorrectly formatted packet. This includes a packet with a wrong header,
wrong trailer, wrong field separator, an out of range indexing, or incorrect packet
length. An example of a packet that has an out of range indexing would be
packet 02, master key address = 15.
The response message from the IPP follows the <ACK> if the packet command
has a response. However, the timing varies from different commands.
Encryption
There are two methods of PIN encryption in IPP:
• MS
• DUKPT
MS Method
IPP encrypts the customer’s PIN according to the ANSI X9.8 standard and the
ANSI X9.24 master key management method, based on the ANSI X3.92 DES
algorithm implemented in the IPP firmware. The encryption during a transaction is
as follows:
1 The master device sends a private communication key (or working key) to the
IPP, where it is decrypted using the currently selected master key. An account
number and PIN are also entered to IPP through the master device.
2 The IPP generates the clear text PIN block using the account number and
PIN.
3 Using the decrypted working key, the IPP encrypts the PIN block using the
DES algorithm and working key, then sends the encrypted PIN block to the
master device.
4 The master device appends the encrypted PIN block to a request packet and
forwards the completed request packet to the host.
The following illustrates an MS encryption session.
DUKPT Method
The IPP encrypts the customer’s PIN according to the ANSI X9.8 standard and
Visa's ANSI X9.24 DUKPT key management method, based on the ANSI X3.92
DES algorithm implemented in the IPP firmware.
Before actual operation, each IPP must be loaded with a unique initial KSN (Key
Serial Number) and a unique initial PEK (PIN Encryption Key). And the encryption
counter of the IPP is set to zero. The initial PEK is generated by encrypting the
initial KSN using appropriate derivation key.
The encryption per transaction of IPP during actual operation is as follows:
1 The master device sends an account number and a PIN to the IPP.
2 The IPP generates the clear-text PIN block using the account number and
PIN.
3 Using the generated PEK based on the encryption counter which is updated
after each transaction, the IPP do a special encrypt to the PIN block using the
DES algorithm and PEK, then sends the encrypted PIN block with current
KSN (the concatenation of the initial KSN and the encryption counter) to the
master device.
4 The master device then appends the encrypted PIN block and current KSN to
a request packet and forwards the completed request packet to the host.
The following illustrates the DUKPT method of encryption.
Constraints
The known software constraints for IPP are:
• All communication must be asynchronous, half-duplex, 1200/2400/4800/9600/
19200 baud, 7 data bits, even parity, and 1 stop bit (7E1).
• Packet length is limited to 255 characters.
NAKs
When the IPP receives NAK, it retransmits the last message and increments a
NAK counter for that communication session. If more than three NAKs are
received during any attempt to transmit the same item, the transmitting party send
an EOT, terminating the session.
Time Outs
During a communication session, the IPP or the terminal times out if it does not
receive the expected communication within 15 seconds. The unit sends an EOT
to terminate the communication session.
Key Insertion
This section describes MK insertion and DUKPT initial PIN encryption key
insertion.
NOTE All master keys must be loaded in the same key injection session, otherwise the
previous master key is erased in the next master key injection session. A master
key injection session is the duration of the power level is maintained in the IPP.
The master key insertion rule does not apply to the GISKE key loading key
(KLK).
The terminal or master device uses Packet 02: Transfer Master Key to transfer the
master keys into the IPP for MS.
Entering a PIN
Packets Z60, Z63, and Z69 are used to get and encrypt a PIN from the user. Z63
is similar to Z60, but allows more options for PIN entry, such as minimum and
maximum PIN length and echo character. Z69 is similar to Z60, but does DUKPT
MAC processing as well as PIN encryption using the same DUKPT key.
IPP7 This section discusses IPP7-specific features for the V/OS terminal IPP. IPP7 is
backward compatible with IPP6 and IPP5. Exceptions to this rule are noted.
GISKE
GISKE (Global Interoperable Secure Key Exchange) is an industry standard key
block format for secure transfer of secret keys between two devices that share a
secret key. Both master and session keys can be in GISKE format. The GISKE
KLK (Key Loading Key) is used to encrypt and authenticate master keys. Master
keys can be remotely updated using this key. GISKE is designed for secure
transfer of double- and triple-length 3DES keys. For details on GISKE, refer
GISKE Key Block Spec, P/N 22986.
Key
• NC = no change
• E = all keys erased
• 1K = valid 1DES keys (single-length keys) retained, other keys erased
• 2/3K = valid 3DES keys (double- and triple-length keys) retained, other keys
erased
The following table lists the Key Management Switching Rules.
a. Spain and SM modes not supported in the V/OS IPP. Keys are erased as specified.
b. Least secure mode.
c. For transition period.
d. Most secure mode.
e. The key management register is set using Packet 17: Set IPP7 Key Management Mode.
f. All DUKPT related keys, counters, and registers are erased when the IPP KM switches between 1DES DUKPT and 3DES
DUKPT. Other MS related information remains untouched.
g. Key attributes verified means that when a key stored in the IPP is used, the IPP must validate the content of all key
attributes. The attributes of the key are validated against the GISKE specification acceptable for that command.
h. GISKE key block verified means that when receiving a key block, the IPP must validate both the key block binding method
of the key block and the content of the header. The header of the key is validated against a list of headers acceptable for
that command.
Using a Session Key This sections describes session key loading, master keys for PIN encryption, rules
for downloading master keys, the GISKE KLK keys, 3DES keys, and 1DES keys.
NOTE
Zero GISKE session key for 3DES means all fields are zero in the GISKE key
block.
If zero GISKE support is disabled, the zero GISKE session key causes an error
response from the IPP. The zero session key support is enabled or disabled
through the KM flag. Zero GISKE session key support (PIN entry) is enabled or
disabled through the KM flag.
On erasure, the master key usage attribute is set to 0, the version is set to 0, and
the length is set to 1DES.
NOTE
Each key has its own key attribute register, key version register, and key length
register.
The register listed in the following table applies to 1DES master key, 3DES master
key (GISKE), and KLK (GISKE). The original GISKE (ASCII-hex) key usage
attribute value is saved in RAM (2 bytes).
Key
Attribute Value Definition
Register
[XX] AN ANY: Key is available in IPP, but the Key was not
loaded using GISKE format.
D0 Data encryption
I0 IV
T0 Control vector
K0 Key encryption or wrapping
G0 MAC generation
M0 MAC verification
P0 PIN encryption
V0 PIN verification
C0 CVK: card verification key
B0 BDK: base derivation key [A]
00 ISO 9797-1, MAC algorithm 1– 56 bits
10 ISO 9797-1, MAC algorithm 1–112 bits
20 ISO 9797-1, MAC algorithm 2–112 bits
30 ISO 9797-1, MAC algorithm 3–112 bits
40 ISO 9797-1, MAC algorithm 4–112 bits
50 ISO 9797-1, MAC algorithm 5–56 bits
60 ISO 9797-1, MAC algorithm 5–112 bits
The key version of an incoming GISKE format key must be greater than or equal
to the version set in the key attribute table for all keys (that is1DES master key,
3DES master key GISKE, and KLK GISKE). The rules for the GISKE key version
are:
• when the version is greater than or equal to the current key, OK is returned
and the IPP updates the new key
• when the version is less than the current key version, an error returns and the
IPP rejects the new key
NOTE
The key version comparison is only compared to the key it is replacing, not to any
other keys.
The following table lists the key length register values for 1DES, 3DES, and three-
key 3DES.
Length Comments
1DES Single-length key: Key length register = 00
3DES Double-length key: Key length register = 01
3-Key 3DES Triple-length key: Key length register = 10
Reserved Key length register = 11
KLK
The GISKE KLK is loaded as clear text if the KLK is not present in IPP. The
version of the incoming key is not checked. The version of the stored key is the
version carried in the message. The stored key attribute is set to the value in the
GISKE message, which should be 'K0'.
The GISKE KLK is loaded in cipher text if the stored KLK attribute location is 'K0'
and the KLK present flag in the IPP is set. The new GISKE KLK load is protected
by the previous GISKE KLK. The current and new KLK key must be a double- or
triple-length key. The version of the key is checked against the stored version. The
version of the stored key is the version carried in the message. The stored key
usage attribute is set to that carried in the GISKE message, which should be 'K0'.
The rules for the KLK are:
• KLK is present and clear text is being loaded, the IPP returns an error.
• KLK is not present and clear text is being loaded, OK is returned and the IPP
stores the first KLK.
• KLK is present and cipher text is being loaded that is not encrypted with the
previous KLK, the IPP returns an error.
• KLK is not present and cipher text is being loaded that is not encrypted with
the previous KLK, the IPP returns an error.
• KLK is present and cipher text is being loaded that is encrypted with the
previous KLK but has an incorrect key version, the IPP returns an error.
• KLK is not present and cipher text is being loaded that is encrypted with the
previous KLK but has an incorrect key version, the IPP returns an error.
• KLK is present and cipher text is being loaded that is encrypted with the
previous KLK, has the correct key version and the key attribute is not equal to
“KEK”, the IPP returns an error.
• KLK is present and cipher text is being loaded that is encrypted with the
previous KLK, has the correct key version and the key attribute is equal to
“KEK”, the IPP stores the KLK and its attributes.
• KLK is not present and cipher text is being loaded that is encrypted with the
previous KLK, has the correct key version, the key attribute KEK value has no
effect, the IPP returns an error.
3DES
All 3DES key loads are in GISKE format. 3DES master keys are loaded in clear
text without cryptographic protection if the KLK present flag is clear in the IPP. The
MAC value is all zero bytes. The version of the incoming key is checked against
the stored version. The version of the stored key is the version carried in the
GISKE message. The stored key attribute is set to that in the GISKE message.
3DES master keys load in cipher text under the protection of the KLK if the KLK
present flag is set. The KLK must be 3DES. The version of the key is checked
against the stored version. The version of the stored key is the version carried in
the GISKE message. The stored key usage attribute is set to that in the GISKE
message.
The rules for 3DES are:
• KLK is present (the current key attribute register in the IPP is GISKE format)
and clear text 3DES master key is being loaded, the IPP returns error
• KLK is not present (the IPP KLK present flag is clear) and clear text 3DES
master key is being loaded, the IPP stores the 3DES key
• KLK is present (the current key attribute register in the IPP is GISKE format)
and cipher text 3DES master key is being loaded with an incorrect key
version, the IPP returns an error
• KLK is present (the current key attribute register in the IPP is GISKE format)
and cipher text 3DES master key is being loaded with the correct key version,
the IPP decrypts and stores the 3DES key master key attribute equal to the
GISKE format length and equal to 3DES
• KLK is not present (the IPP KLK present flag is clear) and cipher text 3DES
master key is being loaded, the IPP returns an error
1DES
The 1DES master keys loaded in the short-form method (that is, IPP6 key-only
format) have the 'ANY' and 1DES attributes set. The 1DES master keys in GISKE
format are be loaded in GISKE clear text without cryptographic protection, if the
KLK present flag is clear in the IPP. The MAC value is all zero bytes. The version
of the incoming key is checked. The version of the stored key is the version
carried in the GISKE message. The stored key attribute is set to that carried in the
GISKE message.
The 1DES master keys in GISKE format are loaded in cipher text under the
protection of the KLK, if the KLK present flag is set. The KLK master key must be
3DES. The version of the key is checked against the stored version. The version
of the stored key is the version carried in the GISKE message. The stored key
attribute is set to that carried in the GISKE message.
Key
HB indicates the header block
Cipher text GISKE key block for transmit (encrypted with KLK or
KEK):
8 HB + 48 eHB + 48 eKB + 16 MAC
D 0 A ...
Common Packets This section presents the packets common to all protocols.
Packet 01 Length
• MAX: 7 characters
• MIN: 7 characters
Packet 01 Example
Send the IPP the request to run diagnostic test 1, RAM test/one time:
<SI>0101<SO>{LRC}
Packet 05 Length
• MAX: 21 characters
• MIN: 21 characters
Packet 05 Example
Set the IPP serial number to 246880401A001234:
<SI>05246880401A001234<SO>{LRC}
Transmit
Master Device IPP
Direction
<SI>05[vvv][dddddd][p][bb][nnnn]
<SO>{LRC}
• ACK if LRC
• NAK if LRC incorrect
• EOT after 3 NAKs
<SI>05[vvv][dddddd][p][bb][nnnn]
<SO>{LRC}
• ACK if LRC
• NAK if LRC incorrect; the IPP
saves serial number
• EOT after 3 NAKs
EOT
Packet 06 Length:
• MAX: 5 characters
• MIN: 5 characters
Packet 06 Length
• MAX: 21 characters
• MIN: 21 characters
Transmit
Master Device IPP
Direction
<SI>06<SO>{LRC}
• ACK if LRC
• NAK if LRC incorrect
• EOT after 3 NAKs
<SI>06[vvv][dddddd][p][bb][nnnn]<SO>{LRC}
• ACK if LRC
• NAK if LRC incorrect,
the IPP saves serial
number
• EOT after 3 NAKs
EOT
Transmit
Master Device IPP
Direction
00 Current Baud Rate
<SI>0100<SO>{LRC}
ACK/NAK/EOT
<SI>14yyyyy<SO>{LRC}
where, yyyyy indicates the current baud
rate:
• 1200
• 2400
• 4800
• 9600
• 19200
ACK/NAK/EOT
01 RAM Test/One-Time
<SI>0101<SO>{LRC}
ACK/NAK/EOT
ACK/NAK/EOT
ACK/NAK/EOT
Transmit
Master Device IPP
Direction
02 RAM Test/Continuous
<SI>0102<SO>{LRC} IPP7
ACK/NAK/EOT
ACK/NAK/EOT
ACK
ACK/NAK/EOT
ACK/NAK/EOT
<SI>14xx<SO>{LRC}
where, xx is the one-byte PROM internal
checksum. There are two checksums
inside the IPP:
• The PROM checksum, which is 2-bytes
long and is located at 7FFE/7FFF. This
checksum is for manufacturing purposes.
• The PROM internal checksum.
ACK/NAK/EOT
Transmit
Master Device IPP
Direction
06 Serial Number Check
<SI>0106<SO>{LRC} IPP6 and earlier
ACK/NAK/EOT
<SI>14xxxxxxxxxxxxxxxx<SO>{LRC}
where, xxxxxxxxxxxxxxxx indicates the
serial number of the IPP. Length is 16
digits, for example, 1234567890123456.
ACK/NAK/EOT
ACK/NAK/EOT
<SI>09<SO>{LRC}
ACK/NAK/EOT
<SI>09<SUB>PROCESS-
ING<SO>{LRC}
ACK/NAK/EOT
<SI>09<SUB>PROCESSING<SO>{LRC}
ACK/NAK/EOT
Transmit
Master Device IPP
Direction
08 IPP PROM Version Number
<SI>0108<SO>{LRC} IPP7
ACK/NAK/EOT
09 Reset IPP
<SI>0109<SO>{LRC} IPP7
ACK/NAK/EOT
<SI>14RESET COMPLETE<SO>{LRC}
ACK/NAK/EOT
Transmit
Master Device IPP
Direction
10 Clear IPP
<SI>0110<SO>{LRC} IPP7
ACK/NAK/EOT
<SI>14CLR COMPLETE<SO>{LRC}
ACK/NAK/EOT
Packet 11 Length
• MAX: 5 characters
• MIN: 5 characters
Sample Packet
<SI>11<SO>{LRC}
Transmit
Master Device IPP
Direction
<SI>11<SO>{LRC}
• ACK if LRC
• NAK if LRC incorrect
• EOT after 3 NAKs
Packet 13 Format
Packet 13 Length
• MAX: 6 characters
• MIN: 6 characters
Transmit
Master Device IPP
Direction
<SI>13x<SO>{LRC}
<SI>14yyyyy<SO>{LRC}
where,
• 1 • 1200 (default)
• 2 • 2400
• 3 • 4800
• 4 • 9600
• 5 • 19200
NOTE
In V/OS terminals IPP, switching to SEMP/4B mode clears all IPP memory but
leaves the IPP in VISA M/S+DUKPT mode.
If the terminal receives the response without any errors, then it sends ACK to the
IPP. The IPP then sends <EOT> { ASCII CODE is 04 } to terminate the
session.
Packet 15 Example
<SI>15SPAIN<SO>{LRC}( set Spain SEMP/4B mode)
<SI>15VISA<SO>{LRC}( set MS / DUKPT mode)
NOTE
In IPP6, the following packet 15 variation is included for compatibility purposes
only, and does not result in the key information being erased.
Packet 15 Format
Packet 15 Length
• MAX: 9 characters
• MIN: 9 characters
Transmit
Master Device IPP
Direction
<SI>15IPP2<SO>{LRC}
• ACK if LRC
• NAK if LRC incorrect
<SI>15IPP2<SO>{LRC}
ACK/NAK
For compatibility, the default key management mode for IPP7 is set to IPP5 mode
(MS- DUKPT or single DES mode). Once a new key management scheme is
selected, it is retained during power cycles.
Setting a new mode causes the IPP7 to erase all existing keys or non-volatile
security values stored for secure messaging.
Packet 17 Format
2 1 0
0 0 0 1DES MS (default)
0 1 0 3DES GISKE MS
0 1 1 Secure messaging
(not supported)
Bit 3 Description
1 3DES DUKPT
Bit 4 Description
Bit 5 Description
Bit 6 Description
0 N/A
Bit 7 Description
1 3DES DUPKT
1 3DES DUPKT
Bit 2 ~ 3
----------
Reserved
Example
Engine= 1 2
Packet 17 Length
• MAX: 8 characters
• MIN: 8 characters
Transmit
Master Device IPP
Direction
<SI>17[KMM][PINER]<SO>{LRC}
• ACK if LRC
• NAK if LRC incorrect
• EOT after 3 NAKs
<SI>17[KMM][PINER]<SO>{LR
C}
Notes:
• The default setting of the IPP KM mode is “old single DES mode” (IPP5/6 = all
zeros in the KMM register). When defaulting to IPP5/6 mode, the IPP is also
set to default to VISA mode (not SPAIN).
• When the IPP receives packet 17 to change KM modes (for example, to 3DES
or SM mode). the master device must know the new specification and
functions associated with the IPP. If the IPP is not in the “old single DES”
mode (IPP5/6), the IPP ignores packet 15 and will not allow itself to be
switched to SPAIN mode unless the KMM register is set to IPP5/6 mode.
• SPAIN mode is a submode of the single DES (IPP5/6) KMM register setting. A
change from 1DES to 3DES or mixed mode will disable SPAIN mode.
• When zero GISKE session key support is enabled (that is, on), the current
master key is used for PIN encryption only if packet Z60 has a zero GISKE
(3DES) session key and the current master key has its key attribute set to
“PIN Encryption” or “ANY.” A zero GISKE (3DES) session key means that all
fields are zero in the GISKE key block.
• The master device must delay for at least 500 msec before send a packet to
the IPP when the KMM is switched from IPP7 to SM or from SM to IPP7.
• Switching from SM to IPP7 mode causes a factory reset. The IPP clears the
contents of RAM and communication to the IPP is reset to the default, 1200
baud, 7 data bits, even parity, and 1 stop bit (7E1).
278 V/OS PROGRAMMERS MANUAL
IPP M ODULE
IPP MS and DUKPT Communications Packets
• Changing the MAC empty working key support flag erases all keys (that is, the
KLK, MS key, and DUKPT key).
Packet 17 Examples
The following examples only illustrate the command packet sent from the master
device. Some valid IPP KMM are shown below.
1 1DES MS mode, zero key support off, zero GISKE session key support off,
and 1DES DUKPT mode:
<SI>17000<SO>{LRC}
2 Mixed MS mode, zero key support off, zero GISKE session key support off,
and 1DES DUKPT mode:
<SI>17010<SO>{LRC}
3 3DES MS mode, zero key support off, zero GISKE session key support off,
and 1DES DUKPT mode:
<SI>17020<SO>{LRC}
4 1DES MS mode, zero key support off, zero GISKE session key support off,
and 3DES DUKPT mode:
<SI>17080<SO>{LRC}
5 Mixed MS mode, zero key support off, zero GISKE session key support off,
and 3DES DUKPT mode:
<SI>17090<SO>{LRC}
6 3DES MS mode, zero key support off, zero GISKE session support off, and
3DES DUKPT mode:
<SI>170A0<SO>{LRC}
7 1DES MS mode, zero key support on, zero GISKE session support off, and
1DES DUKPT mode:
<SI>17100<SO>{LRC}
8 Mixed MS mode, zero key support on, zero GISKE session support on, and
1DES DUKPT mode:
<SI>17310<SO>{LRC}
9 3DES MS mode, zero key support off, zero GISKE session key support on,
and 1DES DUKPT mode:
<SI>17220<SO>{LRC}
10 1DES MS mode, zero key support on, zero GISKE session key support off,
and 3DES DUKPT mode:
<SI>17180<SO>{LRC}
11 Mixed MS mode, zero key support off, zero GISKE session key support on,
and 3DES DUKPT mode:
<SI>17390<SO>{LRC}
12 3DES MS mode, zero key support off, zero GISKE session key support on,
and 3DES DUKPT mode:
<SI>172A0<SO>{LRC}
The combinations of KMM setting are limited, which means that the mixtures of
MS mode, zero key support, zero GISKE session key support, DUKPT mode, and
SM mode are not applicable in some cases. If there is a conflict in the KMM
setting, the following priority rules apply:
1 MS/DUKPT mode vs. SM mode If bit 1 and bit 0 of the KMM register is set
to “ONE,” the IPP switches to SM mode,
regardless how the other bits are set.
2 MS mode vs. zero key support Zero key support is not applicable in
3DES MS mode, due to the key usage
rule (that is, single-length key use is not
allowed in 1DES MS mode).
The IPP stores the setting, but it has no
affect on the MS function.
3 MS mode vs. zero GISKE Zero GISKE session key support is not
session key support applicable in 1DES MS mode, due to the
key usage rule (triple-length key use is
not allowed in 3DES MS mode).
The IPP stores the setting, but it has no
affect on the MS function.
Packet 18 Format
2 1 0
0 0 0 Old single DE
0 1 0 3DES GISKE MS
Bit 3 Description
0 1DES DUKPT
1 3DES DUKPT
Bit 4 Description
Bit 5 Description
Bit 6 Description
Bit 7 Description
1 3DES DUPKT
1 3DES DUPKT
Bit 2 ~ 3
----------
Reserved
Example:
Engine= 1 2
Packet 18 Length
• MAX: 8 characters
• MIN: 8 characters
Transmit
Master Device IPP
Direction
<SI>18<SO>{LRC}
• ACK if LRC
• NAK if LRC incorrect
• EOT after 3 NAKs
<SI>18[KMM][PINER]<SO>{LRC}
• ACK/NAK
Packet 18 Examples
The following examples show the response packet,
<SI>18[KMM][PINER]<SO>{LRC} from the IPP.
1 1DES MS mode, zero key support off, zero GISKE session key support off,
and 1DES DUKPT mode:
<SI>18000<SO>{LRC}
2 Mixed MS mode, zero key support off, zero GISKE session key support off,
and 1DES DUKPT mode:
<SI>18010<SO>{LRC}
3 3DES MS mode, zero key support off, zero GISKE session key support off,
and 1DES DUKPT mode:
<SI>18020<SO>{LRC}
4 1DES MS mode, zero key support off, zero GISKE session key support off,
and 3DES DUKPT mode:
<SI>18080<SO>{LRC}
5 Mixed MS mode, zero key support off, zero GISKE session key support off,
and 3DES DUKPT mode:
<SI>18090<SO>{LRC}
6 3DES MS mode, zero key support off, zero GISKE session support off, and
3DES DUKPT mode:
<SI>180A0<SO>{LRC}
7 1DES MS mode, zero key support on, zero GISKE session support off, and
1DES DUKPT mode:
<SI>18100<SO>{LRC}
8 Mixed MS mode, zero key support on, zero GISKE session support on, and
1DES DUKPT mode:
<SI>18310<SO>{LRC}
9 3DES MS mode, zero key support off, zero GISKE session key support on,
and 1DES DUKPT mode:
<SI>18220<SO>{LRC}
10 1DES MS mode, zero key support on, zero GISKE session key support off,
and 3DES DUKPT mode:
<SI>18180<SO>{LRC}
11 Mixed MS mode, zero key support off, zero GISKE session key support on,
and 3DES DUKPT mode:
<SI>18390<SO>{LRC}
12 3DES MS mode, zero key support off, zero GISKE session key support on,
and 3DES DUKPT mode:
<SI>182A0<SO>{LRC}
13 1DES MS mode, zero key support on, zero GISKE session key support off,
and 3DES DUKPT mode:
<SI>18580<SO>{LRC}
14 Mixed MS mode, zero key support on, zero GISKE session key support on,
and 3DES DUKPT mode
<SI>18790<SO>{LRC}
15 3DES MS mode, zero key support off, zero GISKE session key support on,
and 3DES DUKPT mode:
<SI>186A0<SO>{LRC}
On receipt of a packet Z60 that contains the account number and working key (if
MS) or DUKPT ENCRYPTION (if DUKPT), the IPP gets the PIN from the user
then checks if MS or DUKPT is selected.
• If MS is selected, the IPP encrypts the formatted PIN block using the working
key that was decrypted using the selected master key. The IPP returns the
cipher-text PIN block using packet 71 (see MS Packet 71: Transfer PIN Block.
• If DUKPT is selected, the IPP encrypts the formatted block using the DUKPT
algorithm. The IPP returns the key serial number and cipher-text PIN block
using packet 73 (see DUKPT Packet 73: Transfer PIN Block (for Packets Z60
or Z63)).
Note that [min len] and [max len] are two-character ASCII digits that
represent values between 04 and 12, inclusive. [max len] should not be less
than [min len] that is:
04 [min len] [max len] 12
Furthermore, [NULL allowed flag] and [echo char] each are 1-byte
values with the following requirements:
• [NULL allowed flag] = Y allows a zero-length PIN entry
• [NULL allowed flag] = N does not allow zero-length PIN entries
• [echo char] should be displayable and cannot be <STX>, <ETX>, <SI>,
<SO>, or <FS>, even if the currently selected font can display characters 02h,
03h, 0Fh, 0Eh, or 1Ch.
If any of these four fields do not conform to the restrictions, then the packet is
rejected by the driver (return code of -1 with errno set to EINVAL).
NOTE
This packet is added for IPP8 emulation.
• Minimum: 17 characters
Transmit
Master Device IPP
Direction
<SI>M04<SO>{LRC}
<SI>M04[PUSN]<SO>{LRC}
MS-Specific Packets The following packets are specific to MS 1DES and 3DES operations. The default
mode for the IPP at power up is MS 1DES.
MS Packet 02 Format
MS Packet 02 Length
• MAX: 126 characters
• MIN: 22 characters
Communication Protocols
Each key stored in the IPP contains its own key attributes.
Key-only Format
The key attribute information is not available when the key is loaded using the
key-only format (as compared to the GISKE communication protocol). The IPP
sets the default attributes to the key, as shown in the following table.
The single-DES communication protocol between the master device and the IPP
is shown below.
Transmit
Master Device IPP
Direction
<SI>02[n][hhhhhhhhhhhhh-
hhh]<SO>{LRC}
• ACK if LRC
• NAK if LRC incorrect
• EOT after 3 NAKs
<SI>02[n][hhhhhhhhhhhhhhhh]<SO>{LRC}
Transmit
Master Device IPP
Direction
• ACK if LRC and key echo are
okay
• NAK if LRC incorrect
• EOT after 3 NAKs
• EOT if LRC correct, but key
echo incorrect
• IPP saves the new master key only on
receipt of ACK
• EOT terminates session
Transmit
Master Device IPP
Direction
<SI>02[r][hhh.hhh]<SO>{LRC}
• ACK if LRC
• NAK if LRC incorrect
• EOT after 3 NAKs
<SI>02[n]<SO>{LRC}
MS Packet 04 Format
MS Packet 04 Length
• MAX: 6 characters
• MIN: 6 characters
Transmit
Master Device IPP
Direction
<SI>040<SO>{LRC}
Data
Characteristic Comments
Element
<SI> 1H Shift In, Value: 0Fh
Packet Type 2AN Value: 04
[r] 1AN Response code:
• 0 = No master key at address [a]
• F = Master key present at address [a]
Key Usage 2AH Only when master key is present at address [a]:
Attribute (KUA)
• AN: ANY: The key is available in the IPP, but was
not loaded using GISKE format.
• D0: Data encryption
• I0: IV
• T0: control vector
• K0: key encryption or wrapping
• G0: MAC generation
• M0: MAC verification
• P0: PIN encryption
• V0: PIN verification
• C0: CVK (card verification key)
• B0: BDK (base derivation key [A])
• 00: ISO 9797-1 MAC algorithm 1 (1–56 bits)
• 10: ISO 9797-1 MAC algorithm 1 (1–112 bits)
• 20: ISO 9797-1 MAC algorithm 2 (2–112 bits)
• 30: ISO 9797-1 MAC algorithm 3 (3–112 bits)
• 40: ISO 9797-1 MAC algorithm 4 (4–112 bits)
• 50: ISO 9797-1 MAC algorithm 5 (5–56 bits)
• 60: ISO 9797-1 MAC algorithm 5 (5–112 bits)
Data
Characteristic Comments
Element
Algorithm 1AH (optional) Only if the master key is present at
address [a]. The value is stored in the Key
Attributes register.
• D: DES [0]
• R: RSA [1]
• A: AES [2]
• S: DSA [3]
• T: TDES [4]
• U: Unknown [5]
• E: Elliptic Curve [6]
• [7]–[F] = Reserved
Note: To save storage space in RAM, the
algorithm attribute is converted to [x], a
hex number ranging form 0–F (4 bits). In
the response packet (to packet 04), the
IPP converts the number back to
characters used in GISKE specification.
Mode of Use 1AH (optional) Only if the master key present at
Attribute address [a]. The value is stored in the key
(MOUA) attributes register.
• N: No special restrictions [0]
• E: Encryption only [1]
• D: Decryption only [2]
• S: Signature only [3]
• 0: IV [4]
• G: MAC generate [5]
• V: MAC verify [6]
• C: Calculate = generate or verify) [7]
• [6]–[F]: Reserved
Note: To save storage space in RAM, the
mode of use attribute is converted to [x],
a hex number ranging form 0–F (4 bits).
In the response packet (to packet 04),
the IPP converts the hex number back
to characters used in the GISKE
specification.
Key Version 2AH (optional) Only if the master key present at
(KV) address [a]. The 2-digit ASCII character version
number is optionally used to re-inject old keys. If
not used, this field is filled with ASCII 0 (0x30).
Note: The IPP allocates 1 byte per key for
each key version register.
Data
Characteristic Comments
Element
Key Length 1AH (optional) Only if the master key present at
(KL) address [a].
• 1: single-length key
• 2: double-length key
• 3: triple-length key
Note: The IPP allocates 1 byte per key for
each key version register.
<SO> 1H Shift Out, Value: 0Eh
{LRC} 1H Error Check
Transmit
Master Device IPP
Direction
<SI>04[a]<SO>{LRC}
<SI>04[r][KUA][MOUA][MACMA][KV][KL]<S
O>{LRC}
• ACK if LRC okay
• NAK if LRC incorrect
• EOT after 3 NAKs
EOT
MS Packet 08 Format
MS Packet 08 Length
• MAX: 6 characters
• MIN: 6 characters
MS Packet 08 Example
To select Master Key 7:
<SI>087<SO>{LRC}
Transmit
Master Device IPP
Direction
<SI>08[a]<SO>{LRC}
• ACK if LRC
• NAK if LRC incorrect
• EOT after 3 NAKs
• PINpad makes master key [a] active.
EOT
Notes:
1 The 1DES and 3DES key usage rules (see Rules for Loading the Master Key
(MS Only)) applies when selecting a master key. If the selecting master key is
not available or is not applicable due to the 1DES or 3DES key usage rule, no
response is returned to the master device.
2 If the master key address does not contain any key, the IPP still sets the
currently selected key as the active master key due to a backward
compatibility requirement.
MS Packet 71 Format
MS Packet 71 Length
• MAX: 27 characters
• MIN: 27 characters
MS Packet 71 Example
<STX>71.000010123456789123456<ETX>{LRC}
This packet 71 is the response packet to PIN request Z60 and Z63 when no errors
are detected in the Z60 or Z63 packet. If errors are detected in the Z60 or Z63
packet, the response packet is in the following format:
MS Packet 71 Length
• MAX: 6 characters
• MIN: 6 characters
MS Packet 71 Example
<STX>711<ETX>{LRC}
DUKPT-Specific The following packets are specific to DUKPT operation. Two DUKPT modes are
Packets implemented in IPP7: 1DES or 3DES. All keys associated with DUKPT are erased
when switching between 1DES and 3DES DUKPT modes.
NOTE
This packet was added for IPP8 emulation.
Sample Packet
To select second DUKPT Engine:
<SI>192<SO>{LRC}
Transmit
Master Device IPP
Direction
<SI>19[a]<SO>{LRC}
Notes
• If there is any packet format error, IPP does not echo the response packet
back to the master device. The incorrect packet format includes out of range
DUKPT engine, incorrect packet type, incorrect packet length, etc.
• The default DUKPT engine is set to “0”.
Packet 25: Check The application sends this packet to the IPP to check the current active DUKPT
the DUKPT Engine engines (“0”, “1”, or “2”).
NOTE
This packet is added for IPP8 emulation.
Packet 25 Format
Packet 25 Length
• Maximum: 5 characters
• Minimum: 5 characters
Packet 25 Format
Packet 25 Length
• Maximum: 6 characters
• Minimum: 6 characters
Sample Packet
To Check DUKPT Engine:
<SI>25<SO>{LRC}
Transmit
Master Device IPP
Direction
<SI>25<SO>{LRC}
DUKPT Packet 73: Transfer PIN Block (for Packets Z60 or Z63)
Response packet to Packet Z60: Accept and Encrypt PIN (VISA Mode) and
Packet Z63: Accept and Encrypt PIN-Custom PIN Entry Requirements (VISA
Mode). The IPP encrypts the formatted clear-text PIN block and sends the cipher-
text PIN block to the master device.
Packet 73 is the response packet to Packet Z60: Accept and Encrypt PIN (VISA
Mode), the PIN request packet with no errors detected. If errors are detected in
the Z60 or Z63 packet, the response packet is in the following format:
NOTE
The difference between DUKPT 1DES mode and DUKPT 3DES mode is in the
size of the initial PIN encryption key and the sizes of the future keys.
Transmit
Master Device IPP
Direction
90 Packet
• ACK if LRC
• NAK if LRC incorrect
• EOT after 3 NAKs
• Initialization of 21 Future Keys
16AH 3DES 2
32AH 1DES 2
<ETX> 1H End of text; 03h value
{LRC} 1H Error check character
a. The following explains the alpha-numeric symbols represented in this table:
A - ASCII
AH - ASCII Hex
AN - ASCII Numeric
H - Hex
N - Numeric
1N and 1AN are the same, for example, 1N or 1AN is a 1-byte field ‘1’.
Transmit
Master Device IPP
Direction
Packet 91
• ACK if LRC
• NAK if LRC incorrect
• EOT after 3 NAKs
NOTE
The amount filed must be present in the packet command, but the format is not
confirmed.
Transmit
Master Device IPP
Direction
76 Packet
• ACK if LRC
• NAK if LRC incorrect
When no errors are detected in packet 76, the IPP returns response packet 71. If
errors are detected in packet 76, response packet 71 is in the following format:
DUKPT Z69 Packet: Accept and Encrypt PIN / Data Authentication Request
On receipt of the Z69 packet, the terminal reads the user’s PIN from the keyboard,
echoing to the display an asterisk for each digit accepted. The PIN length can be
between 4 and 12 digits.
Transmit
Master Device IPP
Direction
Z69 Packet
• ACK if LRC
• NAK if LRC incorrect
• EOT after 3 NAKs
ANSI:
<STX>Z6901234567890<US>C19.99<ETX>{LRC}
ANSI:
PC ---> PINPAD : <STX>7801234567890<US>C19.99<ETX>{LRC}
PC <--- PINPAD : <ACK>
PC <--- PINPAD :
<STX>7500000000D04396624CF6892B04A000002468000048D5D7AF0333800FD<ETX>{LRC
}
PC ---> PINPAD : <ACK>
Packet 75 is the response packet to packet Z69 or packet 78, PIN request, when
no errors are detected in the request packet. If errors are detected in packet Z69
or packet 78, the response packet is in the following format:
NOTE
Packet 78 is similar to packet Z69, but the PIN code is preset to “1234.” The user
is not prompted to enter a PIN.
This packet is used for testing and should not be used by applications.
NOTE Per the VISA specification: The amount field should be 3–12 numeric characters,
excluding the decimal point. Due to compatibility concerns, this packet is
designed to be the same as the Z60 or 76 packet commands. However, the
amount length is extended to be able to accept 12 numeric characters. The lack
of a decimal point or multiple decimal points does not cause an error. The PIN
pad does not confirm the decimal point location. The MAC value is calculated
across the entire account number and all amount numbers, and the decimal point
is filtered out.
ANSI:
<STX>7801234567890<US>C19.99<ETX>{LRC}
Transmit
Master Device IPP
Direction
78 Packet
• ACK if LRC
• NAK if LRC incorrect
MAC-Specific This section describes the master-session MAC generation of received message
Packets packets for the IPP. Two packet formats are specified: Z66 and Z67. The detailed
module design and interface design are discussed. ANSI (Standard) MAC
algorithms are used.
Notes
1 A maximum of 100 Z66 packets can be sent during one MAC session.
2 8*XAN in “Message for MAC” represents the number of 8-byte (or character)
blocks. For example,
• X = 0: no message data
• X = 1: 8 bytes of message data
• X = 2: 16 bytes of message data
• X = 3: 24 bytes of message data
:
:
• X = 27: 216 bytes of message data
• X = 28: 224 bytes of message data
Packet 72 Length
• MAX: 5 characters
• MIN: 5 characters
Transmit
Master Device IPP
Direction
<STX>72<ETX>{LRC}
• ACK if LRC
• NAK if LRC incorrect
GISKE Specification
GISKE Key Block Specification P/N 22986.
This section describes V/OS Account Data Encryption (ADE) module, and
presents ADE function calls.
ADE must be on and a minimum of one usable ADE key must be loaded to
enable ADE.
Turning ADE On When the following is true, call ade_status() or ade_active() to turn on ADE:
NOTE
ADE can only be turned on if these requirements are met.
ADE Key V/OS manages ten 2TDEA DUKPT engines for account data encryption. Key
Loading generation applies the “Data Encryption, request or both ways” variant, as defined
in ANSI X9.24-1:2009.
Unique Key V/OS ensures that all keys are unique by rejecting duplicate key loads. When a
Enforcement DUKPT key loads, the KSN is compared to the KSNs of all previously loaded
DUKPT keys to ensure that it is unique. Key uniqueness is enforced across IPP
DUKPT, VSS DUKPT, and ADE DUKPT. A SHA256 of the DUKPT IK is also
stored. If the KSN matches then the SHA256 of the DUKPT, IK is also checked.
During a key load, the target key slot is not checked for uniqueness, which allows
a key to be replaced by an identical key. Any key clearing caused by a key load is
always performed before the uniqueness check.
Cleartext Key In System Mode, use the ADE Key Loading menu to load ADE keys. During ADE
Loading using key loading:
Virtual Terminal • Keys are sent in cleartext.
Management
NOTE
Only perform cleartext key loading in a secure environment.
At the start of a cleartext key load session, all existing ADE keys are cleared.
IPP, VSS, VCL, and VRK keys are not affected. An ADE cleartext key load
session begins when the first valid cleartext ADE key load packet is received
after a restart.
• Keys are loaded using a packet-based protocol (see IPP MS and DUKPT
Communications Packets).
• The default port settings are 1200 7E1.
• Two timeouts are available:
• 15-minute session timeout – Time since session started.
• 1-minute communications timeout – Time since terminal last received data
from key loader.
• Two methods end the key loading session:
• When the user presses an exit key.
• When the Timeout timer expires.
ADE Packets This section presents the packets common to ADE protocols.
Packet A90 This packet loads a 2TDEA ADE DUKPT key. The packet length is 60 characters
(bytes).
Transmit
Master Device IPP
Direction
<STX>A90[Slot][IK][KSN]<ETX><LRC>
ACK
<STX>A90[Result]<ETX><LRC>
ACK
EOT
where,
• Slot is a 2-byte ADE key slot. Valid values: 00–09
• IK is a 16-byte DUKPT initial key (convert to 32 ASCII Hex characters to put in
packet)
• KSN is a 10-byte key serial number (convert to 20 ASCII hex characters to put
in packet)
• Result is a 2-byte result code:
• 00 = Success
• 01 = Internal error
• 02 = Invalid format
• 03 = Unsupported key slot
• 04 = Duplicate key
Encrypted Key You can load ADE keys using VRK. The following values must be in your TR-31
Loading using header:
VRK • Algorithm: “T” (TDEA)
• Mode of use: “E” (Encryption)
• Optional Block 04 (Key Engine Type): “a” (ADE)
• Optional Block 05 (Key Slot of Engine): A single digit between 0 and 9,
inclusive
ADE System On your V/OS terminal in System Mode the following two ADE menus are
Mode Menus available:
• ADE Status
• ADE Key Load
ADE Status Menu Displays the current status for the following ADE features:
• Key status for ADE DUKPT engines 0 through 9
• ADE on/off status (default: off)
• ADE feature status (default: disabled)
This menu displays the same information available by calling ade_status().
ADE Key Load You can start the ADE cleartext key loading service from this menu.
ADE IV Settings
#define ADE_IV_NONE 0
#define ADE_IV_ZERO 1
#define ADE_IV_RAND 2
ade_encrypt()
Encrypts the input data using the specified settings and ADE key.
Prototype
int ade_encrypt(ade_encrypt_in* in, ade_encrypt_out* out);
Parameters
Return Values
ADE_SUCCESS Success.
Example
int ade_encrypt(ade_encrypt_in* in, ade_encrypt_out* out)
typedef struct
{
unsigned char* ptext; // Plaintext
int ptextLen; // Plaintext Length
int keyIndex; // Key Index
int encAlg; // Encryption Algorithm
int encMode; // Encryption Mode of Operation
int iv; // IV Setting
int pad; // Padding Scheme
} ade_encrypt_in;
typedef struct
{
ade_status()
Returns the status of the ADE module. ADE is on when the “turning ADE on
requirements” are met.
Prototype
int ade_status();
Return Values
Returns a 32-bit map of the ADE status:
ade_active()
Indicates if the ADE system is fully functional. Calls ade_status() to turn on ADE if
the Turning ADE On requirements are met.
Prototype
int ade_active();
Return Values
0 ADE is turned on and has a minimum of one usable key loaded.
Magnetic Stripe Use the following calls to access the magnetic stripe reader.
Reader
Functions
msrOpen()
Prepares the firmware to accept and store card reads. If the programmer does not
make this call, the terminal ignores all card reads. The MSR device allows only
one open at a time.
Prototype
int msrOpen(int flags, void *callback);
Parameters
flags Specify device access permissions for the MSR device.
O_RDONLY Read only.
Return Values
>= 0 Magnetic stripe reader is open and ready.
<0 Error.
msrRead()
Reads the decoded and formatted MSR data. If the device is not opened with the
O_NONBLOCK flag set, this call is blocked until data is available.
Prototype
int msrRead(char *buffer, int size);
Parameters
buffer Pointer to data area
size Maximum number of bytes to read. Each invocation of msrRead()
transfers data from a card reader scan into the buffer.
c1 s1 d1 c2 s2 d2 c3 s3 d3
where:
The data includes the Start Sentinel, End Sentinel, and the LRC
characters.
The status byte (s1,s2,s3) can have one of the following values:
0 valid data
1 no data
5 parity error
6 special error
NOTE The returned error status may not reflect the exact cause because the algorithm
tries to decode data in both direction streams. An error in one direction stream
may not produce the same error as in the other.
The decode algorithm searches the entire data stream for the start sentinel.
Return Values
>=0 Total number of bytes read
<0 Error
-4 = EMF (if enabled using msrReportExtendedErrors())
msrWrite()
Transfers data from an application buffer into the device driver’s buffer. The data
is used for the next read operation.
Prototype
int msrWrite(char *buffer, int size);
Parameters
buffer Pointer to data area.
size Maximum number of bytes to read. Each invocation of msrRead()
transfer data from a card reader scan into the buffer.
Return Values
=0 No data written.
NOTE
This call is placed to support test program development and debugging modes.
msrMagneticCardPresent()
Returns the current status of the MSR data. If all three tracks report no data, then
a strong magnetic field may be present to set off an invalid MSR read.
Prototype
int result = msrMagneticCardPresent(void);
Example
void msrCallback(void)
{
if (msrMagneticCardPresent() == 1)
{
/* valid data */
msrRead(…);
…
}
else if (msrMagneticCardPresent() == 2)
{
/* magnetic field present */
…
}
}
“Magnetic Field Present” is reported to let the application know that a stray
electromagnetic field is interfering with the MSR data. It is up to the application to
notify the users so they can take appropriate action.
Prior to svcpak-016-02, EMF is returned when all three tracks report no data for
their status, a very common result of EMF-induced interrupts. For an application
that calls the blocking msrRead() instead of callbacks, it can use the same
criteria to determine if the terminal is in the presence of magnetic field induced
interrupts. However, that there may be instances where EMF-induced data from
the chip exceed the decodable data threshold, which then results in a different
error such as missing start or end sentinel.
Svcpak-016-02 and later improves the detection of EMF and will report it on the
msrRead() call, if enabled via the msrReportExtendedErrors(), making this
function obsolete. In svcpak-016-02 and later, also allows the application to
configure the number of times no data is reported on all tracks before deeming it
as EMF.
Return Values
=0 No data available.
=1 Data available.
msrRaw()
Allows an application to retrieve the raw magnetic stripe data and perform a
custom decode.
NOTE
This API is disabled if the HTdes module is installed.
Prototype
int msrRaw(MSR_DATA * msr);
Parameters
The MSR_DATA structure is as follows:
typedef struct {
unsigned char ucStatus; // status of track
unsigned char ucCount; // size in bytes of track data
char *cpData; // pointer to track data
} MSR_TRACK_DATA;
typedef struct {
MSR_TRACK_DATA stTrack1;
MSR_TRACK_DATA stTrack2;
MSR_TRACK_DATA stTrack3;
} MSR_DATA;
Return Values
=0 Data available.
-1 No data available.
msrStructured()
Prototype
int msrStructured(MSR_DATA * msr);
Parameters
The MSR_DATA structure is as follows:
typedef struct {
unsigned char ucStatus; // status of track
unsigned char ucCount; // size in bytes of track data
char *cpData; // pointer to track data
} MSR_TRACK_DATA;
typedef struct {
MSR_TRACK_DATA stTrack1;
MSR_TRACK_DATA stTrack2;
MSR_TRACK_DATA stTrack3;
} MSR_DATA;
Return Values
=0 Data available.
-1 No data available.
msrEnableLicenseDecode()
NOTE
By default, California Drivers Licenses are not decoded. This is for compatibility
with existing terminals and tests.
Prototype
int msrEnableLicenseDecode(void);
Return Values
msrDisableLicenseDecode()
NOTE
By default, California Drivers Licenses are not decoded. This is for compatibility
with existing terminals and tests.
Prototype
int msrDisableLicenseDecode(void);
Return Values
=0 Always returns zero.
msrSetMinBytes()
Sets the minimum number of track data bytes each track must have before
decoding. This value can also be changed by setting the *MSRMINBYTES
environment variable. If all three tracks have less than the minimum number of
bytes specified, it is deemed to be due to the presence of Electromagnetic Field.
This minimum can be increased for noisy environments, but ensure that actual
card swipes are not dismissed as being EMF induced.
Prototype
void msrSetMinBytes(int min_bytes);
Parameters
min_bytes The minimum number of track data bytes each track must have
before decoding. The default value is 3.
The track is deemed to have no data if it has less than
minimum bytes.
msrSetMaxNoDataCount()
Sets the number of consecutive times no data in all three tracks are seen before
reporting as EMF induced. This value can also be changed by setting the
*MSRMAXNODATA environment variable.
Prototype
void msrSetMaxNoDataCount(int max_count);
Parameters
max_count The number of consecutive times no data in all three tracks are seen
before reporting as EMF induced. The default value is 3.
msrReportExtendedErrors()
Prototype
void msrReportExtendedErrors(void);
msrVersion()
Prototype
int msrVersion(char*version);
Parameters
version Pointer to read in the MSR library version, in the form:
xx.yy.zz
Return Values
=0 Success
<0 Error
Example Card This program reads the card reader device and prints the result to STDOUT.
Reader Code main()
{ int result;
char buffer[200];
The V/OS terminal supports the Contactless RF Card Reader (RFCR or CTLS).
The module is embedded in V/OS terminal and uses sockets for inter-process
communication using a simple command and response protocol.
The user space shared library libvfirfcr and the RFCR_NGapi.h file helps to
interface common features of the module and are detailed in this chapter.
NOTE Applications can also use the low-level commands to communicate with the
module. Refer to the hardware reference guide your terminal for command
protocol, status, and error returns.
Contactless These sections discuss the calls that support the RFCR, the UI framework helper
RFCR Functions structures, CTLS application framework structures, and code examples.
NOTE
See the programmers manual for your device for functions specific to your
terminal.
CTLSClientGetVersion ()
Prototype
CTLSClientGetVersion(char* cVersion);
Parameters
cVersion The version of the RFCR interface.
Return Values
CTLSInitInterface()
Starts a user interface child thread during initialization. This child thread creates
and monitors IPC for contactless user interface requests.
Prototype
CTLSInitInterface(int timeout);
Parameters
timeout The timeout period while the child thread starts.
Return Values
CTLSOpen()
Prototype
CTLSOpen(void);
Return Values
CTLSGetUI()
Prototype
CTLSGetUI(CTLSUIFuncs* uiFuncs);
Parameters
uiFuncs Pointer to the UI handler functions.
Return Values
CTLSSetUI()
Prototype
CTLSSetUI(CTLSUIFuncs* uiFuncs);
Parameters
Return Values
If CTLSSetUI () passed a NULL argument, the CTLS UI framework callback
functions are set to their default values. If any function pointer in the callback table
is NULL, the CTLS UI framework uses the default handler for the corresponding
user interface function.
CTLSSend()
Prototype
CTLSSend(char * buff, int length);
Parameters
buff Pointer to the buffer where the message is stored.
length Message payload length.
Return Values
CTLSReceive()
Prototype
CTLSReceive(char * buff, int length);
Parameters
buff Pointer to the buffer where the message is stored.
length Message payload length.
Return Values
CTLSClose()
Prototype
CTLSClose();
Return Values
CTLSUIParms Structure
typedef struct
{
int uiMode;// EMV or PassThrough style.
} CTLSUIParms;
CTLSLCDText Structure
typedef struct
{
char stringToDisplay[64];
int backgroundColor;
int foregroundColor;
int fontId;
int format;// alignment
int column;
int row;
} CTLSLCDText
where:
• stringToDisplay – A NULL-terminated string to display.
• backgroundColor – RFU.
• foregroundColor – RFU.
• fontId – RFU (these IDs map to font files)
• format – A bit map defining the location to display the text. Valid values are
• CTLS_SET_LEFT
• CTLS_SET_RIGHT
• CTLSI_SET_CENTER
• CTLS_SET_HPIXEL
• CTLS_SET_TP
• CTLS_SET_BTTM
• CTLS_SET_VCENTER
• CTLS_SET_SPREAD
• CTLS_SET_VPIXEL
• column – The column (x coordinate) in pixels.
• row –
• 1/2 – display in message area above the tap icon.
• 3/4 – display below the icon.
• The constants LCD_LINE1_Y and LCD_LINE2_Y are defined with
corresponding pixel locations.
CTLSBuzzerRequest Structure
typedef struct
{
int frequency;
int pause;
int duration;
int nTimes;
} CTLSBuzzerRequest;
where:
• frequency – The tone frequency (in Hz).
• UI_BUZZER_FREQUENCY_OFF – Turns the buzzer off.
• pause – The silent time (in msec) between beeps.
• duration – The length of the beep (in msec).
• INT_MAX – Turns the buzzer on.
• nTimes – The number of beeps.
CTLSLEDStatus Structure
typedef struct
{
int nLED;
unsigned char led[MAX_LED];
} CTLSLEDStatus;
Where each byte in the LED array contains the setting for each LED (left to right).
The LED settings are:
• CTLS_LED_OFF
• CTLS_LED_ON
• CTLS_LED_FLASH
Example 1
Implements communication with CTLS application:
// get CTLS Interface version
CTLSClientGetVersion (cVersion);
printf ("%s\n",cVersion);
CTLSInitInterface (0);
// initialization of UI functions
Example 2
Using SetUI():
{
CTLSUIFuncs CTLtest;
CTLSSetUI (&CTLtest);
USB Device/Host
The V/OS supports up to three USB ports, 0–2. USB Port 0 is a USB OTG port (on
the I/O board on MX terminals) that supports either host or device functionality
on-the-go (OTG), depending on the connected device. Port 1 can either be a USB
host or USB device, depending on the multi-port cable type (USB host or USB
device port).
NOTE
This is not a dynamic switch. A system reboot is required. You can switch multi-
port cables without powering off the unit.
USB Device When acting as a USB device, V/OS terminals conform to the Linux USB On-the-
Go (OTG) 2.0 framework (see http://www.usb.org/developers/docs/) with full API
functionality to operate the USB OTG stack controlling USB port 0. The USB OTG
SW is built into a kernel module (usb_otg.ko) loaded by default on system reboot.
The device supports high-speed (480 Mbps), full-speed (12 Mbps) and low-speed
(1.5 Mbps) data transfer. The two devices that V/OS terminals emulate are:
Serial This exposes a tty style serial line interface, usable with Minicom and
similar tools. (There’s no serial console support at this time.) Most Linux
hosts can talk to this using the generic usb-serial driver. The latest versions
of this driver implement the CDC ACM class, as might be implemented by
cell phones or other modems. This driver works with the MS Windows
usbser.sys driver, the Linux cdc-acm driver, and many other USB Host
systems.
The V/OS terminal SDK includes an .inf file and usbser.sys required
by Windows 2000/XP to interface with the USB serial device. On the V/OS
terminal, the application can open COM5 or /dev/ttygser device. DDL
supports application download over serial USB. To enable the USB Serial
driver on the V/OS terminal, use the System Mode Configure USB display
or set the environment variable *USBDEVICE=1.
USB Host V/OS terminals can support USB host functionality, and run specific drivers for
different devices. V/OS terminals have tested the following devices:
• USB keyboard and mouse (HID Class)
• USB memory sticks and hard drives through the MSDOS-compatible FAT32/
VFAT format
Specific support for most USB devices requires that drivers be manually
loaded into the system and manually configured. Support for USB memory
and mass storage devices requires little or no manual intervention.
• USB hubs (expansion ports), either externally or bus powered.
• PC connections using a USB cable for file transfers.
• IBM AT keyboards and scanners using AT keyboard scan codes.
If a USB keyboard or a scanner is plugged into the V/OS USB host port, the
necessary HID drivers to support the device automatically load. To open and read
data from these devices, use inputOpen(), inputRead(), and
inputClose(). USB HID device support is described below.
NOTE The USB host is only supported using specific V/OS cables. These cables are:
• Red cable P/N 23739-02
• Green cable P/N 23740-02
USB Mass V/OS terminals have built-in automatic support for USB mass storage and
Storage and memory devices. The unit supports a single memory device plugged into the USB
Memory Devices host port on a V/OS terminal cable, or up to four memory devices at any one time
plugged in a USB hub.
V/OS terminals do not support more than four USB memory/mass storage
devices, but they can be plugged into the unit in any configuration of single or
multiple hubs. V/OS terminals automatically detect any memory/mass storage
device plugged in to the unit, and automatically mount the device on one of the
four directories located in the /mnt directory. Directory names for the memory
devices are:
• /mnt/usbstor1
• /mnt/usbstor2
• /mnt/usbstor3
• /mnt/usbstor4
NOTE The px suffix is added for partitioned disks. For example, for a DOK system with
two partitions:
• /mnt/usbstor1p1
• /mnt/usbstor1p2
These directories are used sequentially as devices are plugged in to the unit.
When a device is removed, it is automatically unmounted from the directory mount
point, and its data is no longer accessible. While the device is plugged in, any
application can access the data. The application can determine if a memory/mass
storage device was detected, mounted properly, and ready for access using
utilityExternalStorage.
utilityExternalStorage expects a pointer to a char buffer that can hold at
least 4 bytes. When called, it determines which mount points currently have a
device plugged in, mounted on its directory, and available for access. It returns the
pointer with a value of 1 for each mounted device, and 0 for each device that is
not. All files located on the device can be accessed at that mount point. For
example, if utilityExternalStorage returns the values: 0, 1, 0, 1. then:
/mnt/usbstor1 No USB memory/storage device plugged in and mounted.
/mnt/usbstor2 Device plugged in and files located on the memory device can be
accessed.
/mnt/usbstor3 No USB memory/storage device plugged in and mounted.
/mnt/usbstor4 Device plugged in and files located on the memory device can be
accessed.
The USB host is reset by removing all plugged in devices, and waiting for ~10–15
seconds. All entries, environment variables, and mounted devices are removed
and cleared. The USB host port can then accept newly inserted devices.
USB Human V/OS terminals also have built-in USB HID support for some devices through the
Interface Device Linux kernel Input Event module. When a HID is plugged in to the USB Host port,
(HID) Support it is automatically detected and the appropriate USB HID and event drivers load.
The device can be opened, read/written, and closed from an application.
Currently, the V/OS terminal either partially or fully supports HIDs:
USB Host Keyboard Enables an event interface to capture keys pressed on a USB
host keyboard. V/OS terminals only support IBM AT
keyboards, with scancode set 1. Other scancode sets (2
and 3) are not supported. There is full support for this device.
It can be opened, read, and closed using V/OS terminal Input
Library APIs. This library consists inputOpen(),
inputRead(), and inputClose().
USB Host Scanner Enables an event interface to capture scanned data from a
USB handheld scanner. The scanner must utilize the IBM AT
keyboard scancode set 1. There is full support for this device.
It can be opened, read, and closed using V/OS Input Library
APIs. This library consists inputOpen(), inputRead(),
and inputClose().
USB Host Mouse Enables an event interface the application uses to capture
events from a USB mouse. There is support to open and close
the device, but is not fully supported at this time. Further
implementation of a complete API to read events from the
mouse may be done some time in the future.
Some V/OS-based terminals use NET Service to configure IPv4 Ethernet and Wi-
Fi communications device (terminal specific) and support various protocols (IP,
PPP, SSL, and so on). NET Service uses an XML file to store the Ethernet and the
Wi-Fi parameters.
NOTE
NET Service supports both IPv4 and IPv6, however, in V/OS only v4 is currently
supported. Parameters related to IPv6 will be ignored.
This chapter describes creating and modifying the XML configuration file, enabling
the Ethernet and Wi-Fi interfaces, and the NET application function calls.
NOTE
For UX terminal-specific PPP services, see Appendix C. For VX terminal-specific
PPP services, see Appendix F.
Management NET Service establishes communication sessions for applications. The following
Communication are supported session types:
Sessions for • TCP/IP (or SSL) over Ethernet
Applications
• TCP/IP (or SSL) over Wi-Fi
• TCP/IP (or SSL) over PPP over Modem (PSTN, ISDN)
• TCP/IP (or SSL) over PPP over Serial Port
• Modem direct calls
The application uses a configuration file (XML format) to perform communication
sessions through the NET Service. The configuration file uses communication
tags to describe the session type such as SSL over PPP over modem. It also
stores the corresponding parameters such as SSL certificates, PPP user name
and password, the phone number, and so on. Figure 9 shows how NET Services
facilitate application communications.
This function takes as parameter the configuration file in XML format, and
returns 0 on success or -1 on error.
2 Use net_sessionConnect() to start the communication session.
int handle = net_sessionConnect( int sessionType );
You can define more than one communication session (for example, SSL over
Wi-Fi and SSL over Ethernet) in the same XML configuration file. The
sessionType parameter selects which session to use first.
where,
• handle = the value returned by net_sessionConnect()
• data = the data to send to the peer. The structure definition is:
struct netDataTransfer
{
void *data;/**< array of bytes to transfer */
int data_count; /**< number of bytes to transfer */
};
where,
• handle = the value returned by net_sessionConnect()
• count = the number of bytes to read
• timeout = the number of seconds to wait for data
NOTE
On success (errno=0), the application must free the data in the
netDataTransfer structure.
where,
• handle = the value returned by net_sessionConnect()
This call releases the context. All handles are no longer valid.
XML The following is the general structure of a NET Service communication files:
Communication <?XML VERSION="1.0" ENCODING="UTF-8" STANDALONE="YES" ?>
Files <SETTINGS>
<SESSION_LIST>
<SESSION name_id="session name" next_media="tag1 name" />
</SESSION_LIST>
<TAG1_LIST>
<TAG1 name_id="tag1 name" param1a="value" …param1n="value"
next_media="tag2 name"/>
</TAG1_LIST>
<TAG2_LIST>
<TAG2 name_id="tag2 name" param2a="value" …param2n="value" />
</TAG2_LIST>
</SETTINGS>
Every NET Service XML communication file begins with a SESSION tag. This is
mandatory. Each SESSION tag entry is uniquely identified by the name_id
parameter within the entire XML file (here session name). The next_media
parameters (tag1 name) links the SESSION tag to another tag in the XML file
(TAG1).
TAG1 indicates what the purpose of this session (for example, TCP/IP, SSL,
modem, and so on). TAG1 parameters (param1a … param1n) Convoy data for
TAG1 (for example, the IP address for a TCP/IP session or SSL certificates for
SSL).
TAG1 is uniquely identified by its name_id (tag1 name) within the entire XML
file. next_media refers to another tag (TAG2) in the XML file may be required to
fully work. For example, if TAG1 is TCP/IP, TAG2 can store parameters for
Ethernet, Wi-Fi, or PPP. Some tags such as SESSION require a next_media
parameter, and some don’t such as Ethernet, Wi-Fi.
Every NET Service communication file follows this structure.
• Protocols tags define SSL and TCP/IP layers in the configuration file.
TAG Name Description
SOCKPROTO TCP/IP socket parameters.
SSL SSL parameters.
• Modem tags define tags for modems and the GPRS layer. Modem tags can
link to a PPP layer or be used directly by a SESSION entry.
NOTE
A tag is defined by a list of attributes and their values. Not all attributes are
required. Mandatory attributes are written in bold in the following tables.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identification name of the media
Priority int 1… Priority of the session
Timeout double 1… Connection timeout (RFU)
Retry int 0… Number of connection tries (RFU)
next_media char[32] Next media name Identifies the protocol used by the
session.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identification name of the media.
protocol char[8] tcp Socket type (for example, one
possible value is TCP).
remote_ip char[128] IP:PORT or DNS:PORT Server address and port number.
next_media char[32] Next media name Identifies the physical layer used
by this protocol such as Wi-Fi,
ETHERNET, or PPP.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies the SSL layer.
remote_ip char[128] IP:PORT or DNS:PORT Socket protocol.
server_profile char[128] Full path + file name Identifies the place where the
server CA is stored.
client_profile char[128] Full path + file name Identifies the place where the
client certificate and the client
private key are stored.
session_ttl int 0… Indicates in seconds how long
to keep the Resume Session
before performing a complete
handshake.
next_media char[32] Next media name Identifies the linked media.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies the name of the media.
usedhcp int 0, 1 1=DHCP is used
0 = DHCP not used
local_ip char[16] ip range Identifies the network adapter IP
address.
netmask char[16] ip range Network mask.
broadcast char[16] ip range Broadcast.
gateway uint8[16] ip range Gateway IP address.
Activate int 0,1 Indicates if this interface must be
activated.
Dhcpid char[16] The client id string for DHCP.
Clienthostname char[128] The client hostname string for
DHCP.
Speed char[16] (0, Auto), (1,100F), Defines the link speed as 10F,
(2, 10F), (3,100H), 100F, 10T, 100T, or AUTO (default
is AUTO).
(4,10H)
dns1 char[16] ip range Domain Name Server number 1.
dns2 char[16] ip range Domain Name Server number 2.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies the name of the media.
usedhcp int 0, 1 1=DHCP is used
0 = DHCP not used
local_ip char[16] ip range Identifies the network adapter IP address
netmask char[16] ip range Network mask.
broadcast char[16] ip range Broadcast.
gateway uint8[16] ip range Gateway IP address.
activate int 0,1 Indicates if this interface must be activated.
suppliconf char[16] Wi-Fi configuration security file location
(standard format).
dns1 char[16] ip range Domain Name Server number 1.
dns2 char[16] ip range Domain Name Server number 2.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies name of the media.
user char[32] User name for PPP.
password char[32] Password for PPP.
auth char[32] auto, chap, pap Authentication mode for PPP.
pppOption char[16] RFU.
next_media char[16] ip range Indicates the media used to connect the
PPP layer
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies the name of the
media.
number char[32] The phone number to
dial.
dial_type char 1=Tone, Identifies the dial tone
2=Pulse type.
Attribute Accepted
Type Description
Name Values
max_line_rate char (1=300), (2=300_B), Identifies the modem
(3=1200), (4=1200_FAST), connection rate.
(6=1200_B), (7=2400),
(8=4800), (12=14400),
(14=33600), (15=56000),
connect_timeout char Identifies the whether the
modem is waiting for an
answer. If expired, there
are no more retries.
error_correction char 1 = Activate correction error Indicates whether to
0 = otherwise activate the modem
connection error.
compression char 1 error_correction must be
enabled to use
compression.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies the name of
the media.
number char[32] The phone number to
dial
isdn_prot char (3, HDLC_SYNC_TO_ASYNC), ISDN transmission
(4, HDLC_TRANSPARENT), protocols.
(10, X75),
(20, X31_B_CHL)
x25_packet_size char[5] 64 - 2048 Identifies the mode
as asynchronous or
synchronous.
facilities char[20] starting with 'G' Access to X.25
Closed User Group.
nui char[20] a-z, A-Z, 0-9 NUI (Network User
Identification) and
password with call
setup.
x25_number char[20] X.25 call number,
(X.25 B channel
only).
Attribute Accepted
Type Description
Name Values
user_data char[20] User data starting
with D (without
protocol ID, data
length max. 16 char).
P with protocol ID,
data length max. 12
characters.
max_retries char 0… The maximum
number of dial
retries.
connect_timeout char Identifies the whether
the modem is waiting
for an answer. If
expired, there are no
more retries.
country_code char Identifies the country
code.
NOTE
GPRS is not supported in UX terminals.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies the name of the media.
APN char[32] GPRS access point name.
operator_id char Operator LAI number.
reg_mode char[5] 1 = AUTO Network registration mode.
2 = MANUAL
3 = AUTO_MANUAL
number char[32] Phone number for GSM data calls
(RFU).
bearer char[32] GSM Data modulation (RFU).
Attribute Accepted
Type Description
Name Values
name_id char[32] Media name of Identifies the name of the media.
another tag in
the XML file for
which this
option applies
option char[256] List of options.
NET Service This section provides XML example files for NET Service communication
Communication File structures.
Examples
TCP/IP Over Ethernet
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<SETTINGS>
<SESSION_LIST>
<SESSION name_id="eth-session" priority="1" timeout="10000" retry = "3"
next_media="tcp-layer" />
</SESSION_LIST>
<SOCKPROTO_LIST>
<SOCKPROTO name_id="tcp-layer" protocol="tcp"
remote_ip="www.verifone.com:80" next_media="eth-layer" />
</SOCKPROTO_LIST>
<ETHLINK_LIST>
<ETHLINK name_id="eth-layer" interface="eth0" usedhcp="1"/>
</ETHLINK_LIST>
</SETTINGS>
<SESSION_LIST>
<SESSION name_id="ssl-session" priority="1" next_media="ssl-eth"
timeout="10000" retry = "3"/>
</SESSION_LIST>
<SSL_LIST>
<SSL name_id="ssl-eth" remote_ip="mmsgto.fr:443" server_profile="/tmp/"
client_profile="/tmp/" next_media="eth-iface" />
</SSL_LIST>
<ETHLINK_LIST>
<ETHLINK name_id="eth-iface" interface="eth0" usedhcp="1"/>
</ETHLINK_LIST>
</SETTINGS>
SSL is the tag for an SSL entry used with the following attributes:
• remote_ip: defines the server IP address to connect to.
• server_profile: specifies the path that contains the server CA root.
• client_profile: specifies the path that contains the client CA root and the
Private key.
NOTE • For server_profile, the server CA root name must be CA_Key.pem. For
example:
/tmp/CA_Key.pem
• For client_profile, the client CA root name must be CC_Key.pem and the
Private Key name is CP_Key.pem. For example:
/tmp/CA_Key.pem
/tmp/CP_Key.pem
• client_profile must be provided only when SSL mutual authentication is
required.
where,
• profile = client_profile
• password = the passphrase that protects the private key in plain text
• gshared is 1 if the passphrase is shared within the group, or 0 if it is private to
the application
Overriding the Default PCI - Cipher List
In some cases the application may need to use its own cipher list to connect to a
specific server. The application uses the net_sessionCipherList() API to indicate
to the NET Service layer which cipher suite applies for a specific profile. This API
can be called at any time.
o int net_sessionCipherList(char *profile, char *cipher, int gshared);
where,
• profile = server_profile
• cipher = the cipher suite used for a given server profile.
• gshared = 1 if the cipher suite is shared within the group, or 0 if it is private to
the application.
Default PCI - Cipher List
An SSL/PCI configuration file restricts the SSL ciphers to only those that are PCI
compatible. It allows defining the cipher suite used for SSL sessions if the
application is not providing one. The file is located at
/mnt/flash/etc/config/svcnet/cipher_pci.xml
This file is loaded only when the application is not providing its own cipher suite.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<SETTINGS>
<CIPHER_SUITE_LIST>
<CIPHER_SUITE cipher_id="1" cipher="pciciphersuite" />
</CIPHER_SUITE_LIST>
</SETTINGS>
where,
• pciciphersuite = the PCI cipher suite string.
• cipher_id="1" This is reserved for future use, and is always 1.
NOTE • If the cipher_pci.xml file is not present and the application does not provide
one, the default OpenSSL cipher list applies.
• Applications cannot change the PCI cipher suite.
</SOCKPROTO_LIST>
<PPPPROTO_LIST>
<PPPPROTO name_id=" ppp-gprs" user="magic" password="isdn" auth="pap"
pppOption="" next_media="gprs_layer"/>
</PPPPROTO_LIST>
<MODLINK_LIST>
<GPRS_LIST>
<GPRS name_id="gprs_layer" APN="m2minternet" />
</GPRS_LIST>
<OPTION_LIST>
<OPTION name_id=" ppp-gprs" option="asyncmap 0 noauth noipdefault
usepeerdns lcp-echo-interval 3 lcp-echo-failure 2"/>
</OPTION_LIST>
</SETTINGS>
Creating a Applications may need to create an XML communication file. This section
Communication File describes how to do that using the NET Service API.
Dynamically
Each communication type (TCP/IP, SSL, Wi-Fi) has a corresponding descriptor
structure defined in svc_net.h. This structure writes data in the XML
communication file or reads from it. NET Service associates each communication
family (Socket, SSL, Wi-Fi) with a fixed communication type value, COM Type,
which are also defined in svc_net.h. Descriptors and COM types create and
modify the XML files.
Table 8 lists all NET Service communication descriptors and corresponding COM
types.
Table 8 NET Service COM Types
Name Tag COM Type Description
sessionDescriptor SESSION NETCOM_SESSION Parameters for SESSION tags.
socketDescriptor SOCKPROTO NETCOM_SOCKPROTO Parameters for socket tags.
sslDescriptor SSL NETCOM_SSL Parameters for SSL tags.
ethernetDescriptor ETHLINK NETCOM_ETHLINK Parameters for Ethernet tags.
wifiDescriptor WIFI NETCOM_WIFI Parameters for Wi-Fi tags.
pppDescriptor PPPPROTO NETCOM_PPPPROTO Parameters for PPP tags.
modemDescriptor MODLINK NETCOM_MODLINK Parameters for PSTN modem tags.
modemIsdnDescriptor MODISDNLINK NETCOM_MODISDNLINK Parameters for ISDN modem tags.
gprsDescriptor GPRS NETCOM_GPRS Parameters for GPRS tags.
gprsDescriptor OPTION NETCOM_OPTION Parameters for Option tags.
If the path /tmp/com_file.xml does not exist, it is created at the end of the
process.
3 Fill the socket descriptor parameters:
strncpy( sckDesc.name, "socket", strlen("socket") );
/** value for name_id*/
strncpy( sckDesc.protocol, "tcp", strlen("tcp") );
strncpy( sckDesc.remote_ip, "www.verifone.com:80",
strlen("www.verifone.com:80") );
strncpy( sckDesc. nextMedia, "eth-layer", strlen("eth-layer") );
/* value for next_media */
The data is stored in the context, but is not saved in the destination file until
the next step.
6 Save the file.
int ret = net_sessionSave( "/tmp/com_file.xml" );
You can use a different filename. The existing file is not modified.
The result /tmp/com_file.xml is:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<SETTINGS>
<SOCKPROTO_LIST>
SOCKPROTO name_id="socket" protocol="tcp" remote_ip="www.verifone.com:80"
next_media="eth-layer" />
</SOCKPROTO_LIST>
</SETTINGS>
NOTE
/tmp/com_file.xml must be an existing file.
NOTE
If errno is 0 (success), the caller must free the netDataTransfer structure.
Net Service provides calls to enable the Ethernet and Wi-Fi interfaces as set
by the configuration file parameters.
Create and Modify The Ethernet and Wi-Fi parameters are stored in netconf.xml, the default XML
the Default XML configuration file located at:
Configuration File /mnt/flash/etc/config/svcnet/netconf.xml.
Use the netIfConfig structure to Convoy parameters for both Ethernet and Wi-
Fi. Its definition is shown in NET Service Structures. The next section shows how
to use this structure to read or to write data to or from the netconf.xml.
Set the config.interface parameter to "eth0", to indicate that the data is for
Ethernet:
strcpy( config.interface, "eth0");
strcpy( config.local_ip, "192.168.18.2");
strcpy( config.broadcast, "192.168.45.15");
strcpy( config.netmask, "255.255.255.0");
strcpy( config.gateway, "192.168.18.1");
strcpy( config.dns1, "10.35.07.14");
strcpy( config.dns2, "10.35.13.16");
config.usedhcp = 0;
config.activate = 1;
Parameters
config.interface IP interface name.
config.local_ip Local IP address.
config.broadcast Broadcast IP address.
config.gateway Address of the gateway.
config.dns1 Domain name server 1 IP address.
config.dns2 Domain name server 2 IP address.
config.usedhcp 0 = Use static IP address.
1 = Start DHCP client.
config.activate 0= The Ethernet interface is never brought up.
1= Enable the Ethernet interface.
Set the interface parameter to "wlan0" to indicate that the data is for Wi-Fi:
strcpy( config.interface, "wlan0");
strcpy( config.suppliconf, "/mnt/flash/etc/config/svcnet/wificfg.conf" );
config.usedhcp = 1;
config.activate = 1;
Parameters
Package: wpa-config-file
Version: 1.0.0
Type: flashconfig
User: usr1
Group: system
Unmask:
Bring Up a Specific Use net_interfaceUp() to bring up the Ethernet or the Wi-Fi interface.
Network Interface net_interfaceUp() reads the configuration parameters from netconf.xml.
Configure the There are two methods for configuring the Ethernet interface:
Ethernet Interface
• Automatic
When an Ethernet cable is plugged in or during the boot process, the V/OS
terminal reads the Ethernet parameters from netconf.xml and brings up
the network (activate = 1 to enable the network).
• If activate = 0, Ethernet is not configured.
• If usedhcp = 1, the DHCP client starts; otherwise use static IP.
• If the Ethernet cable is unplugged, the Ethernet interface is disabled.
• Manual
NOTE
The eth0 parameter indicates only that the Ethernet interface is down
(disabled).
The wlan and dbus packages are required for Wi-Fi. These are provided as
extra packages in V/OS delivery, and must be loaded into the terminal
separately. They must also be properly signed.
• Start the WPA supplicant
It is not possible to get an IP address if the WPA supplicant has not started.
• Get an IP address on the Wi-Fi interface (wlan0)
• Automatic configuration
<PPPPROTO_LIST>
<PPPPROTO name_id="ppp0" user="username" password="password" auth="pap"
next_media="modem_uart"/>
</PPPPROTO_LIST>
<MODLINK_LIST>
<MODLINK name_id=" modem_uart" … other parameters … />
</MODLINK_LIST>
</SETTINGS>
NET Service API This section presents the NET Service constants, structures, and function calls.
/** \} */
/** @name svc net max sizes*/
/** \{ */
#define NET_IFACE_MAX 32 /**< Interface name max size */
#define NET_NAMEID_MAX 32 /**< XML entry name max size */
#define NET_IPV4_MAX 16 /**< IPv4 max length */
#define NET_IPV6_MAX 48 /**< IPv6 max length */
#define NET_MAC_MAX 17 /**< MAC address max length */
#define NET_DHID_MAX 16 /**< DHCP id max length */
#define NET_HOST_MAX 128 /**< DHCP id max length */
#define NET_SPEED_MAX 8 /**< Ethernet speed parameter */
/**< max length */
#define NET_PROTO_MAX 8 /**< Protocol name max size */
#define NET_PPP_USER_MAX 32 /**< PPP username max length */
#define NET_PPP_PASSWD_MAX 32 /**< PPP password max length */
#define NET_PPP_AUTH_MAX 8 /**< PPP authentication mode */
/**< maxlength */
#define NET_PPP_OPTION_MAX 128 /**< PPP options max length */
#define NET_WIFI_WPACONF_MAX 128 /**< WPA supplicant configuration */
/**< file max length */
#define NET_WIFI_SSID_MAX 64 /**< ssid string max length */
#define NET_WIFI_ENCTYPE_MAX 32 /**< WiFi encryption type max size */
#define NET_WIFI_AUTHMODE_MAX 32 /**< WiFi authentication mode */
/**< max size */
/** \} */
?
/** @name values for networkType in netWifiInfo & netSiteSurvey */
/** \{ */
#define NET_WIFI_NETWORK_MANAGED 1
#define NET_WIFI_NETWORK_ADHOC 2
/** \} */
/**
• Define a list of interface configuration:
*/
struct netIfconfigList
{
struct netIfconfig *ifconfig; /**< list of interfaces IPv4 */
/**< configured */
int ifconfig_count; /**< number of interfaces in the */
/**< list IPv4 configured */
struct netIfconfigIpv6 *ifconfigIpv6;/**< list of interfaces */
/**< IPv6 configured */
int ifconfigIpv6_count; /**< number of interfaces in the */
/**< list IPv6 configured */
};
• Define a route to an IPv4 address:
struct netRoute
{
char interface[NET_IFACE_MAX];/**< interface name (eth0, */
/**< ppp0, wlan0...)*/
char destination[NET_IPV4_MAX]; /**< route destination */
char gateway[NET_IPV4_MAX]; /**< route gateway */
char netmask[NET_IPV4_MAX]; /**< network route netmask */
};
• Define a route to an IPv6 host:
struct netRouteIpv6
{
char interface[NET_IFACE_MAX];/**< interface name (eth0, ppp0, */
/**< wlan0...)*/
char globalHostAddress[NET_IPV6_MAX];/**< global address */
unsigned char globalHostAddressMask; /**< Network mask */
char IPv6Gateway[NET_IPV6_MAX];/**< Gateway to globalHostAddress */
};
390 V/OS PROGRAMMERS MANUAL
NET S ERVICE E THERNET AND W I -F I C ONFIGURATION
NET Service API
NET Service This section contains V/OS-based terminal NET service function call descriptions.
Functions
net_getVersion()
Prototype
struct version net_getVersion(void);
Return Values
version struct as defined in svcmgrSvcDef.h.
On success, errno = 0.
net_interfaceSet()
Prototype
int net_interfaceSet( struct netIfconfig config );
Parameters
config Convoy interface data to store in the XML file.
Return Values
errno = 0 Success
net_interfaceGet()
Prototype
struct netIfconfig net_interfaceGet( char *p_iface );
Parameters
p_iface Network interface name (eth0 or wlan0) where the data to read is present.
Return Values
errno = 0 Success
A netIfconfig struct containing fields corresponding to p_iface.
net_interfaceModemSet()
Prototype
int net_interfaceModemSet(struct netModemInfo mdnInfo);
Parameters
[input] mdnInfo Convoy modem parameters to store in the XML file.
Return Values
errno = 0 Success
A netModemInfo struct containing modem parameters read from the
XML file.
net_interfaceModemGet ()
Prototype
struct netModemInfo mdnInfo net_interfaceModemGet();
Return Values
errno = 0 Success
A netModemInfo struct containing modem parameters read from the
XML file.
net_interfaceModemExtSet()
Prototype
int net_interfaceModemExtSet(char *iface, struct netModemInfo mdnInfo);
Parameters
[input] iface The modem name.
[input] mdnInfo Convoy modem parameters to store in the XML file.
Return Values
errno = 0 Success
A netModemInfo struct containing modem parameters read from the
XML file.
net_interfaceModemExtGet()
Prototype
struct netModemInfo mdnInfo net_interfaceModemExtSet(char *iface);
Parameters
[input] iface The modem name.
Return Values
errno = 0 Success
A netModemInfo struct containing modem parameters read from the
XML file.
net_interfaceModemIsdnSet()
Prototype
int net_interfaceModemIsdnSet( struct netModemIsdnInfo mdnInfo );
Parameters
[input] mdnInfo Convey the ISDN modem parameters to store in the XML file.
Return Values
errno = 0 Success
A netModemInfo struct containing the ISDN modem parameters
read from the XML file.
net_interfaceModemIsdnGet()
Prototype
struct netModemIsdnInfo net_interfaceModemIsdnGet();
Return Values
errno = 0 Success
A netModemInfo struct containing the ISDN modem parameters
read from the XML file.
net_interfaceGprsSet()
Prototype
int net_interfaceGprsSet( struct netGprsInfo gprsInfo );
Parameters
None.
Return Values
errno = 0 Success.
net_interfaceGprsGet()
Prototype
struct netGprsInfo gprsInfo net_interfaceGprsSet();
Parameters
[input] gprsInfo Convoy GPRS parameters to store in the XML file.
Return Values
errno = 0 Success
net_optionSet()
Prototype
int net_optionSet( char *p_iface, char *p_option );
Parameters
[input] p_iface Interface for Wi-Fi to write options.
[input] p_option Options to write to the XML file.
Return Values
errno = 0 Success
net_optionGet()
Prototype
char *net_optionGet(char *p_iface);
Parameters
[input] p_iface Interface name on which to read the configuration.
[input] p_option Options to write to the XML file.
Return Values
errno = 0 On success the option string read from the XML file.
Note: The user must free the string.
net_interfaceUp()
Prototype
int net_interfaceUp( char *p_iface, int ipVersion );
Parameters
p_iface Network interface to configure (eth0 or wlan0).
ipVersion NET_IP_V4
Return Values
=0 Success
net_interfaceDown()
Closes the network for the specified IP interface. The activate parameter in
netconf.xml is not impacted.
Prototype
int net_interfaceDown( char *p_iface, int ipVersion );
Parameters
p_iface Network interface to bring down (eth0 or wlan0).
ipVersion NET_IP_V4
Return Values
=0 Success
net_interfaceStatus()
Reads the interface link status and return the current interface IP information. The
MAC Address is filled. The activate parameter updates according to its value in
netconf.xml.
Prototype
struct netIfconfig net_interfaceStatus( char *p_iface );
Parameters
p_iface Network interface to read (eth0 or wlan0).
Return Values
errno = 0 Success
net_networkUp()
Brings the network up for all interfaces as set in the netconf.xml parameters. If
the netconf.xml activate parameter is 1, bring up the network; otherwise do
nothing.
Prototype
int net_networkUp( int ipVersion );
Parameters
ipVersion Must be NET_IP_V4.
Return Values
=0 Success
net_networkDown()
Closes the network for all interfaces as set in the netconf.xml parameters. The
netconf.xml activate parameter is not impacted.
Prototype
int net_ networkDown ( int ipVersion );
Parameters
ipVersion Must be NET_IP_V4.
Return Values
=0 Success
net_interfaceStatusList()
Prototype
struct netIfconfigList net_interfaceStatusList( void );
Return Values
errno = 0 Success
struct netIfconfigList contains the list of network interface
configurations.
net_getTable()
Prototype
struct netRouteTable net_getTable( void );
Return Values
errno = 0 Success
net_getRoutes()
Prototype
struct netRouteTable net_getRoutes( char *p_dest );
Parameters
p_dest IP destination for the routes.
Return Values
errno = 0 Success
struct netRouteTable the table route information structure.
net_addHostRoute()
Prototype
int net_addHostRoute( char *p_dest, char *p_gateway, char *p_iface );
Parameters
p_dest Host IP address.
p_gateway Gateway address for host.
p_iface IP interface (eth0 and wlan0).
Return Values
=0 Success
net_delHostRoute()
Prototype
int net_delHostRoute( char *p_dest );
Parameters
p_dest Host IP address.
Return Values
=0 Success
net_addNetRoute()
Prototype
int net_addNetRoute( char *p_net, char *p_netmask, char *p_gateway,
char *p_iface );
Parameters
p_dest Host IP address.
p_netmask Network mask for the host.
p_gateway Gateway address for host.
p_iface IP interface (eth0 and wlan0).
Return Values
=0 Success
net_delNetRoute()
Prototype
int net_delNetRoute( char *p_net, char *p_netmask, char *p_gateway,
char *p_iface );
Parameters
p_dest Host IP address.
p_netmask Network mask for the host.
p_gateway Gateway address for host.
p_iface IP interface (eth0 and wlan0).
Return Values
=0 Success
net_autoSetDefaultRoute()
Selects the default route per priority policy (eth0, wlan0) settings.
Prototype
int net_addNetRoute( char *p_net, char *p_netmask, char *p_gateway,
char *p_iface );
Return Values
=0 Success
net_setDefaultRoute()
Prototype
int net_setDefaultRoute( char *p_iface );
Parameters
p_iface Default IP interface (eth0 and wlan0).
Return Values
=0 Success
net_getDefaultRouteInfo()
Prototype
char * net_getDefaultRouteInfo( void );
Return Values
Interface name (eth0, wlan0) of the default route.
Null on error.
net_startDHCP()
Starts a DHCP client for the specified interface. Does nothing if DHCP is up.
Switches from static IP to dynamic configuration.
Prototype
int net_startDHCP( char *p_iface, int ipVersion );
Parameters
p_iface IP interface (eth0 and wlan0).
ipVersion Must be NET_IP_V4.
Return Values
=0 Success
net_renewDHCP()
Causes udhcpc to renew the current lease or, if it does not have one, obtain a
new lease.
Prototype
int net_renewDHCP( char *p_iface, int ipVersion );
Parameters
p_iface IP interface (eth0 and wlan0) for the renewal request.
ipVersion Must be NET_IP_V4.
Return Values
=0 Success
net_releaseDHCP()
Prototype
int net_releaseDHCP( char *p_iface, int ipVersion );
Parameters
p_iface IP interface (eth0 and wlan0) to release.
ipVersion Must be NET_IP_V4.
Return Values
=0 Success
net_stopDHCP()
Prototype
int net_stopDHCP( char *p_iface, int ipVersion );
Parameters
p_iface IP interface (eth0 and wlan0) of the DHCP client.
ipVersion Must be NET_IP_V4.
Return Values
=0 Success
net_setDNS()
Prototype
int net_setDNS( char *p_iface, char *p_dns1, char *p_dns2 );
Parameters
p_iface IP interface (eth0 and wlan0) of the DHCP client.
p_dns1 Domain name server 1.
p_dns2 Domain name server 2.
Return Values
=0 Success
net_addRouteFromXML()
Prototype
int net_addRouteFromXML( char *p_fileName );
Parameters
p_fileName XML file containing the static routes.
Return Values
=0 Success
net_nsLookup()
Prototype
struct netIfconfig net_nsLookup( char *p_dnsName, char *p_iface );
Parameters
p_dnsName DNS name to resolve.
p_iface IP interface (eth0 and wlan0) of the DHCP client.
Return Values
errno = 0 Success
net_ping()
Removes all stored DNS resolution results for the specified server.
Prototype
struct netPingInfo net_ping( char *p_host, unsigned char pingCount );
Parameters
p_host Ping destination (IPv4 or IPv6).
pingCount
Return Values
errno = 0 Success
net_wifiStart()
Starts the Wi-Fi module and WPA supplicant as set in the specified parameter.
Prototype
int net_wifiStart( int startwpa );
Parameters
startwpa = 1 – power up the Wi-Fi module and start the WPA supplicant
= 0 – only power up the Wi-Fi module.
Return Values
=0 Success
net_wifiStop()
Stops the Wi-Fi module and WPA supplicant as set in the specified parameter.
Prototype
int net_wifiStop( int stopmodule);
Parameters
stopmodule = 1 – Stop the WPA supplicant and Wi-Fi module.
= 0 – Stop the WPA supplicant only.
Return Values
=0 Success
net_wifiSiteSurvey()
Prototype
struct netSiteSurveyList net_wifiSiteSurvey( void );
Return Values
errno = 0 Success
struct netIfconfigList is a list of discovered Wi-Fi
sites.
net_wifiInfo()
Prototype
struct netWifiInfo net_wifiInfo( char *p_iface );
Parameters
p_iface IP interface (wlan0).
Return Values
errno = 0 Success
struct netWifiInfo – structure containing connected Wi-Fi network
information.
net_setNTP()
Prototype
int net_setNTP( char *p_hostname );
Parameters
p_hostname Network Time Protocol host name.
If NULL, pool.ntp.org is used as the default NTP server.
Return Values
=0 Success
net_sessionOpen()
Prototype
int net_sessionOpen( char *p_xmlFile );
Parameters
*p_xmlFile Name of the XML file that stores the current session information.
Return Values
=0 Success
net_sessionConnect()
Prototype
int net_sessionConnect(int sessionType);
Parameters
sessionType Valid values are:
• NET_FIRST_SESSION – Connect the session with lowest
priority.
• NET_NEXT_SESSION – Connect the following session in the
XML file.
• NET_CURRENT_SESSION – Reconnect to the current session.
Return Values
=0 Success; connection handle returns
net_sessionConnectExt()
Prototype
int net_sessionConnectExt(int priority);
Parameters
priority Session priority number to connect to (must be greater than 0)
Return Values
=0 Success; connection handle returns.
net_sessionRead()
Prototype
struct netDataTransfer net_sessionRead(int handle, int count,
int timeout);
Parameters
handle Communication returned by net_sessionConnect().
count The number of bytes to read.
timeout The first timeout in seconds to wait for data reception.
Return Values
=0 Success.
The struct netDataTransfer contains the general data structure transfer.
net_sessionWrite()
Prototype
int net_sessionWrite(int handle, struct netDataTransfer data);
Parameters
handle Communication returned by net_sessionConnect().
data Convoy data to send to the host
Return Values
=0 Success.
The struct netDataTransfer contains the general data structure transfer.
net_sessionSetTag()
Prototype
int net_sessionSetTag(int comtype, char *nameid,
struct netDataTransfer data);
Parameters
comtype Communication family type (NETCOM_SESSION, COM_SSL, and
so on).
nameid The entry in the entire XML file
data Contains a pointer to the tag descriptor (sessionDescriptor,
socketDescriptor, and so on).
Return Values
=0 Success.
net_sessionGetTag()
Prototype
int net_sessionSetTag(int comtype, char *nameid,
struct netDataTransfer data);
Parameters
comtype Communication family type (NETCOM_SESSION, COM_SSL, and
so on).
nameid The entry in the entire XML file
Return Values
=0 Success.
net_sessionDisconnect()
Prototype
int net_sessionDisconnect(int handle);
Parameters
handle Current session ID.
Return Values
=0 Success.
net_sessionClose()
Prototype
int net_sessionClose();
Parameters
None.
Return Values
=0 Success.
net_gprsVerifyPin()
Prototype
int net_gprsVerifyPin(int pin);
Parameters
pin PIN value to send to the SIM card to unlock it.
Return Values
=0 Success.
net_gprsGetStatus()
Retrieves the GPRS module status (SIM present, PIN Ready, GPRS Connected,
and so on).
Prototype
int net_gprsGetStatus();
Parameters
None.
Return Values
=0 Success returns NET_GSM_STT_[XXX].
net_gprsGetStatus()
Prototype
int net_gprsGetStatus();
Parameters
None.
Return Values
=0 Success returns the GSM module information to struct netGsminfo.
net_gprsGetRssi()
Prototype
int net_gprsGetRssi();
Parameters
None.
Return Values
=0 Success returns the RSSI level information to struct netGsmRssi.
net_gprsRssi()
Prototype
int net_gprsRssi();
Parameters
pin PIN value to send to the SIM card to unlock it.
Return Values
=0 Success.
Example 1 wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="my_ssid_here"
key_mgmt=WPA-EAP
proto=WPA2
pairwise=CCMP
group=CCMP
eap=TLS
identity="client"
ca_cert="/etc/wpa_supplicant/cert/ca.crt"
client_cert="/etc/wpa_supplicant/cert/client1.crt"
private_key="/etc/wpa_supplicant/cert/client1.key"
}
Example 2 wpa_supplicant.conf
# WPA-PSK/TKIP
ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
# ap_scan=2 was the one for me you may try 0 or 1 indstead of 2
ap_scan=2
fast_reauth=1
#
# WPA Personal, TKIP algorithm, shared key: testing123-vfi
network={
ssid="ViperNest"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
psk="testing123-vfi"
}
# NOTE! This file may contain password information and should probably be
# made readable only by root user on multiuser systems.
# Note: All file paths in this configuration file should use full
# (absolute, not relative to working directory) path in order to allow
# working directory to be changed. This can happen if wpa_supplicant is
# run in the background.
ctrl_interface=/var/run/wpa_supplicant
# network block
#
# Each network (usually AP's sharing the same SSID) is configured as a
# separate block in this configuration file. The network blocks are in
# preference order (the first match is used).
#
# network block fields:
#
# disabled:
# 0 = this network can be used (default)
# 1 = this network block is disabled (can be enabled through ctrl_iface,
# e.g., with wpa_cli or wpa_gui)
#
# id_str: Network identifier string for external scripts. This value is
# passed to external action script through wpa_cli as WPA_ID_STR
# environment variable to make it easier to do network specific
configuration.
#
# ssid: SSID (mandatory); either as an ASCII string with double quotation
# or as hex string; network name
#
# scan_ssid:
# 0 = do not scan this SSID with specific Probe Request frames (default)
# 1 = scan with SSID-specific Probe Request frames (this can be used to
# find APs that do not accept broadcast SSID or use multiple SSIDs;
# this will add latency to scanning, so enable this only when needed)
#
# bssid: BSSID (optional); if set, this network block is used only when
# associating with the AP using the configured BSSID
#
# priority: priority group (integer)
# By default, all networks will get same priority group (0). If some of
# the networks are more desirable, this field can be used to change the
# order in which wpa_supplicant goes through the networks when selecting a
# BSS. The priority groups will be iterated in decreasing priority (i.e.,
# the larger the priority value, the sooner the network is matched against
# the scan results).
# Within each priority group, networks will be selected based on security
# policy, signal strength, etc.
# Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are not
# using this priority to select the order for scanning. Instead, they try
# the networks in the order that used in the configuration file.
#
# mode: IEEE 802.11 operation mode
# 0 = infrastructure (Managed) mode, i.e., associate with an AP (default)
# 1 = IBSS (ad-hoc, peer-to-peer)
# Note: IBSS can only be used with key_mgmt NONE (plaintext and static
# WEP) and key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In addition,
# ap_scan has to be set to 2 for IBSS. WPA-None requires following network
# block options: proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP
# (or CCMP, but not both), and psk must also be set.
#
# frequency: Channel frequency in megahertz (MHz) for IBSS, e.g.,
# 2412 = IEEE 802.11b/g channel 1. This value is used to configure the
# initial channel for IBSS (adhoc) networks. It is ignored in the
# infrastructure mode.
# In addition, this value is only used by the station that creates the
# IBSS. If an IBSS network with the configured SSID is already present,
the frequency of the network will be used instead of this configured
value.
#
# proto: list of accepted protocols
# WPA = WPA/IEEE 802.11i/D3.0
# RSN = WPA2/IEEE 802.11i (also WPA2 can be used as an alias for RSN)
# If not set, this defaults to: WPA RSN
#
# key_mgmt: list of accepted authenticated key management protocols
# WPA-PSK = WPA pre-shared key (this requires 'psk' field)
# WPA-EAP = WPA using EAP authentication (this can use an external
# program, e.g., Xsupplicant, for IEEE 802.1X EAP Authentication
# IEEE8021X = IEEE 802.1X using EAP authentication and (optionally)
# dynamically generated WEP keys
# NONE = WPA is not used; plaintext or static WEP could be used
# If not set, this defaults to: WPA-PSK WPA-EAP
#
# auth_alg: list of allowed IEEE 802.11 authentication algorithms
# OPEN = Open System authentication (required for WPA/WPA2)
# SHARED = Shared Key authentication (requires static WEP keys)
# LEAP = LEAP/Network EAP (only used with LEAP)
# If not set, automatic selection is used (Open System with LEAP enabled
# if LEAP is allowed as one of the EAP methods).
#
# pairwise: list of accepted pairwise (unicast) ciphers for WPA
# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
# NONE = Use only Group Keys (deprecated, should not be included if APs
# support pairwise keys)
# If not set, this defaults to: CCMP TKIP
#
# group: list of accepted group (broadcast/multicast) ciphers for WPA
# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
# WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key
# WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key [IEEE 802.11]
# If not set, this defaults to: CCMP TKIP WEP104 WEP40
#
# psk: WPA preshared key; 256-bit pre-shared key
# cert://substring_to_match
# hash://certificate_thumbprint_in_hex
# for example: private_key="hash://63093aa9c47f56ae88334c7b65a4"
# Note that when running wpa_supplicant as an application, the user
# certificate store (My user account) is used, whereas computer store
# (Computer account) is used when running wpasvc as a service.
# Alternatively, a named configuration blob can be used by setting this
# to blob://<blob name>.
# private_key_passwd: Password for private key file (if left out, this
# will be asked through control interface)
# dh_file: File path to DH/DSA parameters file (in PEM format)
# This is an optional configuration file for setting parameters for an
# ephemeral DH key exchange. In most cases, the default RSA
# authentication does not use this configuration. However, it is
# possible setup RSA to use ephemeral DH key exchange. In addition,
# ciphers with DSA keys always use ephemeral DH keys. This can be used to
# achieve forward secrecy. If the file is in DSA parameters format, it
# will be automatically converted into DH params.
# subject_match: Substring to be matched against the subject of the
# authentication server certificate. If this string is set, the server
# sertificate is only accepted if it contains this string in the subject.
# The subject string is in following format:
# /C=US/ST=CA/L=San Francisco/CN=Test AS/[email protected]
# altsubject_match: Semicolon separated string of entries to be matched
# against the alternative subject name of the authentication server
# certificate.
# If this string is set, the server sertificate is only accepted if it
# contains one of the entries in an alternative subject name extension.
# altSubjectName string is in following format: TYPE:VALUE
# Example: EMAIL:[email protected]
# Example: DNS:server.example.com;DNS:server2.example.com
# Following types are supported: EMAIL, DNS, URI
# phase1: Phase1 (outer authentication, i.e., TLS tunnel) parameters
# (string with field-value pairs, e.g., "peapver=0" or
# "peapver=1 peaplabel=1")
# 'peapver' can be used to force which PEAP version (0 or 1) is used.
# 'peaplabel=1' can be used to force new label, "client PEAP encryption",
# to be used during key derivation when PEAPv1 or newer. Most existing
# PEAPv1 implementation seem to be using the old label, "client EAP
# encryption", and wpa_supplicant is now using that as the default value.
# Some servers, e.g., Radiator, may require peaplabel=1 configuration to
# interoperate with PEAPv1; see eap_testing.txt for more details.
# 'peap_outer_success=0' can be used to terminate PEAP authentication on
# tunneled EAP-Success. This is required with some RADIUS servers that
# implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g.,
# Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode)
460 V/OS PROGRAMMERS MANUAL
NET S ERVICE E THERNET AND W I -F I C ONFIGURATION
WPA Supplicant for Wi-Fi Security
# Example blocks:
priority=2
}
# Only WPA-EAP is used. Both CCMP and TKIP is accepted. An AP that used
# WEP104 or WEP40 as the group cipher will not be accepted.
network={
ssid="example"
proto=RSN
key_mgmt=WPA-EAP
pairwise=CCMP TKIP
group=CCMP TKIP
eap=TLS
identity="[email protected]"
ca_cert="/etc/cert/ca.pem"
client_cert="/etc/cert/user.pem"
private_key="/etc/cert/user.prv"
private_key_passwd="password"
priority=1
}
# WPA-EAP, EAP-TTLS with different CA certificate used for outer and inner
# authentication.
network={
ssid="example"
key_mgmt=WPA-EAP
eap=TTLS
# Phase1 / outer authentication
anonymous_identity="[email protected]"
ca_cert="/etc/cert/ca.pem"
# Phase 2 / inner authentication
phase2="autheap=TLS"
ca_cert2="/etc/cert/ca2.pem"
client_cert2="/etc/cer/user.pem"
private_key2="/etc/cer/user.prv"
private_key2_passwd="password"
priority=2
}
# EAP-PSK
network={
ssid="eap-psk-test"
key_mgmt=WPA-EAP
eap=PSK
identity="eap_psk_user"
eappsk=06b4be19da289f475aa46a33cb793029
nai="[email protected]"
}
network={
ssid="leap-example"
key_mgmt=IEEE8021X
eap=LEAP
identity="user"
password="foobar"
}
network={
ssid="eap-fast-test"
key_mgmt=WPA-EAP
eap=FAST
anonymous_identity="FAST-000102030405"
identity="username"
password="password"
phase1="fast_provisioning=1"
pac_file="blob://eap-fast-pac"
}
priority=5
}
# Shared WEP key connection (no WPA, no IEEE 802.1X) using Shared Key
# IEEE 802.11 authentication
network={
ssid="static-wep-test2"
key_mgmt=NONE
wep_key0="abcde"
wep_key1=0102030405
wep_key2="1234567890123"
wep_tx_keyidx=0
priority=5
auth_alg=SHARED
}
# Catch all example that allows more or less all configuration modes
network={
ssid="example"
scan_ssid=1
key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
pairwise=CCMP TKIP
group=CCMP TKIP WEP104 WEP40
psk="very secret passphrase"
eap=TTLS PEAP TLS
identity="[email protected]"
password="foobar"
ca_cert="/etc/cert/ca.pem"
client_cert="/etc/cert/user.pem"
private_key="/etc/cert/user.prv"
private_key_passwd="password"
phase1="peaplabel=0"
}
engine=1
# Optional PIN configuration; this can be left out and PIN will be
# asked through the control interface
pin="1234"
}
blob-base64-exampleblob={
SGVsbG8gV29ybGQhCg==
}
# Wildcard match for SSID (plaintext APs only). This example select any
# open AP regardless of its SSID.
network={
key_mgmt=NONE
}
TCP/IP Networking
For legacy support the V/OS terminal supports the network configuration and
function calls in this chapter.
The V/OS terminals fully support the Linux sockets interface for client and server
network programming. The networking API is contained in the svc.net.h header
file and the libvfisvc shared library.
“localhost” (loopback) is supported only on the Ethernet port, the eth0 device and
localhost, with a standard IP address of 127.0.0.1. Wireless support is subject to
hardware availability.
Network Configuration variables are read for network configuration in bringing the interface
Configuration up at boot time and user control. Tune network parameters using putSysctl()
to optimize performance and for security purposes.
Environment The following table of configuration variables is read by the system on power up/
Variables reboot and in bringing the interface up. Either the *DHCP or *IFCONFIG
environment variable must be defined to bring up the eth0 network interface.
The configuration variables in Table 9 must be set in the usr1 account.
Table 9 Network Configuration Environment Variables
Variable Name Values Definition
*NET “e”,”E” (default) or If “e”, “E” or not defined, use Ethernet (wired)
““n”,”N” for network interface. This applies to
netUp( ). “n”, “N” specifies no networking
(disabled).
*DHCP 1 If *DHCP is present and the system supports
Ethernet, then it attempts to initialize its
connection using DHCP.
*DNS1 IP Address in the If not DHCP, *DNS1 is used as the name
form server IP address.
xxx.xxx.xxx.xxx
*DNS2 IP Address in the If not DHCP, *DNS2 is used as the name
form server IP address.
xxx.xxx.xxx.xxx
net_interfaceUp()
NOTE This function uses the Network Configuration environment variables and either
the *DHCP or *IFCONFIG variable must exist. *DHCP takes precedence if both
variables exist.
Prototype
int net_interfaceUp(char *p_iface, int ipVersion );
Parameters
p_iface The interface to configure. Valid values = eth0.
ipVersion Set to NET_IP_V4.
Return Values
=0 Success
net_interfaceDown()
Deactivates the specified network interface. The activate parameter in the XML
file is not impacted.
Prototype
int net_interfaceDown(char *p_iface, int ipVersion);
Parameters
p_iface The interface to deactivate. Valid values = eth0.
ipVersion Set to NET_IP_V4.
Return Values
=0 Success
net_interfaceStatus()
Reads the interface link status and returns the current Interface IP information.
The MAC address is the interface status. The activate parameter updates
according to its XML file value.
Prototype
struct netIfconfig net_interfaceStatus(char *p_iface );
Parameters
p_iface The network interface to read.
Return Values
struct netIfconfig IP information of the network interface.
net_networkUp()
Brings up all network interfaces set by parameters in the default file. If the activate
attribute in the XML file is set to 1 for a specific interface, bring up the network,
otherwise do nothing for that interface.
Prototype
int net_networkUp(int ipVersion);
Parameters
ipVersion Set to NET_IP_V4.
Return Values
=0 Success
net_networkDown()
Closes all network IP interfaces. The activate parameter in the XML file is not
impacted.
Prototype
int net_networkDown(int ipVersion);
Parameters
ipVersion Set to NET_IP_V4.
Return Values
=0 Success
net_interfaceStatusList()
Prototype
struct netIfconfigList net_interfaceStatusList(void);
Return Values
struct netIfconfigList is the list of network interface configurations.
=0 Success
net_getTable()
Prototype
struct netRouteTable net_getTable(void);
Parameters
ipVersion Set to NET_IP_V4.
Return Values
=0 Success
net_getRoutes()
Prototype
struct netRouteTable net_getRoutes(char *p_dest);
Parameters
p_dest Destination to load the routes.
Return Values
=0 Success
net_addHostRoute()
Prototype
int net_addHostRoute(char *p_dest, char *p_gateway, char *p_iface);
Parameters
p_dest Destination host IP address.
p_gateway Gateway to this host.
p_iface IP interface (for example, eth0, wlan0, and so on).
Return Values
=0 Success
net_delHostRoute()
Prototype
int net_delHostRoute(char *p_dest);
Parameters
p_dest Destination host IP address.
Return Values
=0 Success
net_addNetRoute()
Prototype
int net_addNetRoute( char *p_net, char *p_netmask, char *p_gateway,
char *p_iface );
Parameters
p_net Network IP address.
p_netmask Network mask.
p_gateway Gateway to use.
p_iface IP interface (for example, eth0, wlan0, and so on).
Return Values
=0 Success
net_delNetRoute()
Prototype
int net_delNetRoute(char *p_net, char *p_netmask, char *p_gateway,
char *p_iface);
Parameters
p_net Network IP address.
p_netmask Network mask.
p_gateway Gateway to use.
p_iface IP interface (for example, eth0, wlan0, and so on).
Return Values
=0 Success
net_autoSetDefaultRoute()
Selects the default route according to the priority policy (eth0, wlan0).
Prototype
int net_autoSetDefaultRoute(void);
Return Values
=0 Success
net_setDefaultRoute()
Prototype
int net_setDefaultRoute(char *p_iface);
Parameters
p_iface IP interface for the default route (for example, eth0, wlan0, and so on).
Return Values
=0 Success
net_getDefaultRouteInfo()
Prototype
char * net_getDefaultRouteInfo(void);
Return Values
Success = Interface name (eth0, wlan0) of the default route.
net_startDHCP()
Starts a DHCP client for a specified network interface. If DHCP already up, do
nothing. If static IP up, start DHCP and switch to dynamic configuration.
Prototype
int net_startDHCP(char *p_iface, int ipVersion);
Parameters
p_iface IP interface for the default route (for example, eth0, wlan0, and so on).
ipVersion Must be set to NET_IP_V4.
Return Values
=0 Success
net_renewDHCP()
Causes UDHCPC to renew the current lease; if it does not have one, obtains a
new lease.
Prototype
int net_renewDHCP(char *p_iface, int ipVersion);
Parameters
p_iface IP interface to request the renewal (for example, eth0, wlan0, and so
on).
ipVersion Must be set to NET_IP_V4.
Return Values
=0 Success
net_releaseDHCP()
Causes UDHCPC to release the current lease. To get a new lease, call
net_renewDHCP().
Prototype
int net_releaseDHCP(char *p_iface, int ipVersion);
Parameters
p_iface IP interface to release (for example, eth0, wlan0, and so on).
ipVersion Must be set to NET_IP_V4.
Return Values
=0 Success
net_stopDHCP()
Prototype
int net_stopDHCP(char *p_iface, int ipVersion);
Parameters
p_iface IP interface to stop DHCP on (for example, eth0, wlan0, and so on).
ipVersion Must be set to NET_IP_V4.
Return Values
=0 Success
net_setDNS()
Prototype
int net_setDNS(char *p_iface, char *p_dns1, char *p_dns2);
Parameters
p_iface IP interface to set DNS on (for example, eth0, wlan0, and so on).
p_dns1 Domain name server 1.
p_dns2 Domain name server 2.
Return Values
=0 Success
net_addRouteFromXML()
Prototype
int net_addRouteFromXML(char *p_fileName);
Parameters
p_fileName XML file that contains static routes.
Return Values
=0 Success
net_nsLookup()
Prototype
struct netIfconfig net_nsLookup(char *p_dnsName, char *p_iface);
Parameters
p_dnsName Domain name server name to resolve.
p_iface IP interface for domain name resolution.
Return Values
=0 Success
net_setNTP ()
Prototype
int net_setNTP(char *p_hostname);
Parameters
p_hostname Network Time Protocol host name.
If p_hostname is NULL, pool.ntp.org is used.
Return Values
=0 Success
Wireless These functions tune and configure the wireless device used for network
Network communication. These functions are for use in an application in special
Interface architecture/configuration. Otherwise, the application should use the wlan.conf
Functions file (located in /home/usr1/).
NOTE
The wireless network interface is subject to hardware availability.
net_wifiStart()
Prototype
int net_wifiStart(int startwpa);
Parameters
startwpa 1 = Power up the module and start the WPA Supplicant.
0 = Only power up the module.
Return Values
=0 Success
net_wifiStop()
Stops the module and Wi-Fi Supplicant and module specified in stopmodule.
Prototype
int net_wifiStop( int stopmodule);
Parameters
stopmodule 1 = Stops WPA Supplicant and Wi-Fi module.
0 = Stops the WPA Supplicant only.
Return Values
=0 Success
net_wifiSiteSurvey()
Prototype
struct netSiteSurveyList net_wifiSiteSurvey(void);
Return Values
=0 Success; struct netIfconfigList returns a list of discovered Wi-Fi sites.
net_wifiInfo()
Prototype
struct netWifiInfo net_wifiInfo(char *p_iface);
Parameters
p_iface Wi-Fi interface; valid value is wlan0.
Return Values
=0 Success; struct netWifiInfo structure containing connected Wi-Fi
information.
Supported The V/OS terminal API includes support for common networking programs such
Network as ping and FTP file transfers.
Programs For FTP file transfers, the FTP server must support Passive mode for the data
socket connection and the file transfers are always in Binary mode. The FTP
server must support the following FTP commands:
• USER
• PASS
• TYPE I
• PASV
• RETR
• CWD
• STOR
• QUIT
net_ping()
Removes all stored DNS resolution results for the specified server.
Prototype
struct netPingInfo net_ping(char *p_host, unsigned char pingCount);
Parameters
p_host Server ping destination (IPv4 or IPv6).
pingCount Number of times to retry ping.
Return Values
=0 Success
ftpGet()
NOTE
This function logs in to the FTP server, retrieves the file, and logs off.
Prototype
int result = netGetConfig(net_conf_t *net);
Parameters
net Pointer to the FTP parameter structure
typedef struct{ ftpHost In the “xxx.xxx.xxx.xxx” IP
char ftpHost[96];
char port[8]; address format or the fully
char userID[32]; qualified domain name format
char password[32]; ftp.site.com
char localFile[96];
char port FTP port. Defaults to 21 if not
remoteFile[96]; specified.
char errorMsg[128];
} ftp_parm_t; userID FTP user name
password FTP password
localFile Local file name, with directory
path (relative to “/home/
usr1/”)
remoteFile Remote file name:
• For ftpGet(), this is the
directory pathname and
filename.
• For ftpPut(), this is the
directory pathname only.
errorMsg Returns the verbose error
message
Return Values
=0 Success; network interface is up.
<0 Error
ftpPut()
NOTE
This function logs in to the FTP server, sends the file to the server, and logs off.
Prototype
int result = ftpPut(FTP_parm_t *ftp)
Parameters
ftp Pointer to FTP parameter structure (see ftpGet()). The remoteFile field is
the directory path name only. The resultant filename is the same as the source
filename.
Return Values
=0 Success
<0 Error
Bluetooth Service
Bluetooth This section lists the calls for the Bluetooth service.
Functions
bluetooth_getVersion()
Prototype
struct version bluetooth_getVersion(void);
XML Prototype
<svc_cmd> <bluetooth> <getVersion/> </bluetooth> </svc_cmd>
Return Values
<svc_rtn> <bluetooth> <getVersion>
<return type="container">
<major>int</major>
<minor>int</minor>
<maint>int</maint>
<build type="string">string [max len 16]</build>
bluetooth_scan()
Prototype
int bluetooth_scan(void);
Return Values
<svc_rtn> <bluetooth> <scan> <return>int</return> </scan> </bluetooth>
</svc_rtn>
bluetooth_scanResults()
Prototype
struct btDeviceList bluetooth_scanResults(void);
XML Prototype
<svc_cmd> <bluetooth> <scanResults/> </bluetooth> </svc_cmd>
Return Values
<svc_rtn> <bluetooth> <scanResults>
<return type="container">
<deviceCount>int</deviceCount>
<device type="list">
bluetooth_hidConnect()
Connects to an HID.
Prototype
int bluetooth_hidConnect(char * remoteDeviceAddr /*NULL*/);
XML Prototype
<svc_cmd> <bluetooth> <hidConnect> <remoteDeviceAddr type="string">
string [default:NULL]</remoteDeviceAddr> </hidConnect> </bluetooth>
</svc_cmd>
Return Values
<svc_rtn> <bluetooth>
bluetooth_hidDisconnect()
Prototype
int bluetooth_hidDisconnect(char * remoteDeviceAddr /*NULL*/);
XML Prototype
<svc_cmd> <bluetooth> <hidDisconnect> <remoteDeviceAddr
type="string">string [default:NULL]</remoteDeviceAddr> </hidDisconnect>
</bluetooth> </svc_cmd>
Return Values
<svc_rtn> <bluetooth> <hidDisconnect> <return>int</return>
</hidDisconnect> </bluetooth> </svc_rtn>
bluetooth_getConnectedHids()
Prototype
struct btDeviceList bluetooth_getConnectedHids(void);
XML Prototype
<svc_cmd> <bluetooth> <getConnectedHids/> </bluetooth> </svc_cmd>
Return Values
File List This section lists all files in the local Bluetooth configuration structure.
#include <svc_bluetooth.h>
btConfig::address[]
Prototype
char btConfig::address[18]
btConf::discoverable
Prototype
char btConf::discoverable
btConf::name[]
Prototype
char btConf::name[128]
Data Fields
char name [128] – Bluetooth device name.
char address [18] – Bluetooth device address.
char class [3] – Bluetooth device class.
btDevice::address[]
Prototype
char btDevice::address[18]
btDevice::class[]
Prototype
char btDevice::class[3]
btDevice::name[]
btDevice* btDeviceList::device
Prototype
struct btDevice* btDeviceList::device
btDeviceList::deviceCount
Prototype
int btDeviceList::deviceCount
Defines
• #define BT_PWR_DOWN 0 –Bluetooth power down.
• #define BT_PWR_UP 1 –Bluetooth power up.
bluetooth_getVersion()
Prototype
struct version bluetooth_getVersion(void);
Prototype
struct version bluetooth getVersion(void); [read]
Return Values
The version structure defined in svcmgrSvcDef.h.
bluetooth hidConnect()
Prototype
int bluetooth hidConnect ( char * remoteDeviceAddr );
Return Values
Success struct btDeviceList for the nearby devices.
bluetooth hidDisconnect()
Prototype
int bluetooth hidDisconnect ( char * remoteDeviceAddr );
Return Values
Success struct btDeviceList for nearby devices.
Prototype
struct btDeviceList bluetooth getConnectedHids(void); [read]
Return Values
Success struct btDeviceList for nearby devices.
NOTE
There is no class information in struct btDevice.
Prototype
struct btConf bluetooth getConfig( void );
Return Values
Success struct btConf - bluetooth configuration structure.
XML Prototype
<svc_cmd> <bluetooth> <getConfig/> </bluetooth> </svc_cmd>
Return Values
<svc_rtn> <bluetooth> <getConfig>
<return type="container"> <name type="string">string [max len 128]
</name> <address type="string">string [max len 18]</address>
<discoverable> char</discoverable>
</return> </getConfig> </bluetooth> </svc_rtn>
bluetooth isUp()
Prototype
int bluetooth isUp(void);
Return Values
=0 Bluetooth down
1 Power is up
XML Prototype
<svc_cmd> <bluetooth> <power> <operation>int [default:0]</operation>
</power> </bluetooth> </svc_cmd>
Return Values
<svc_rtn> <bluetooth> <power> <return>int</return> </power> </bluetooth>
</svc_rtn>
bluetooth power()
Prototype
int bluetooth power(int operation);
Parameters
operation
Return Values
=0 Success
NOTE
BT_PWR_ON does nothing when Bluetooth is already up (return value is still 0).
bluetooth scan()
Prototype
int bluetooth scan(void);
Return Values
=0 Scan stared successfully
Prototype
struct btDeviceList bluetooth scanResults(void);
Return Values
Success struct btDeviceList for nearby devices.
Security Module
This section describes V/OS function calls related to security and cryptography.
The functions are divided into two groups:
• VeriShield Security Scripts (VSS) functions related to the use of scripts to
support custom key managements beyond the usual DUKPT and M/S
schemes.
• Generic functions that provided services related to security and cryptography
such as DES, AES, SHA-1, RSA computation support, file encryption support,
random generation, tamper detection status, file authentication and OS file
upgrades.
• Service switch functions related to tamper detection.
VeriShield The V/OS terminal supports the VeriShield Security Scripts concept as
Security Scripts implemented in the SC 5000 PINpad and V/OS terminals. Existing scripts run on
Functions the V/OS terminal platform without requiring any modification. All VSS-related
functions listed below are defined in the header file svcsec.h. Applications must
link with the libvfisec.so library by using -lvfisec.
NOTE
Refer to document P/N 21883, VeriShield Security Scripts, for information
implementing security scripts.
In its default configuration, the unit supports two key management schemes
through the IPP emulation: DUKPT and Master/Session. Those two schemes
should meet the needs of most of the customers and since they are hard coded,
no customizing of the security module is required.
For customers who need more flexibility, the VeriShield Security Script feature
provides support for:
• different key management schemes,
• different PIN block formats such as PVV, CVV, IBM3624,
• different encryption algorithms such as triple-DES, AES, RSA.
All the information is written in a script file (ASCII) using a .VSS extension. This
script is processed by a PC tool and converted into a downloadable file (*.VSO).
The download is protected by the VeriShield File Authentication (FA) module.
Therefore, the VeriShield Security Script file will have to be downloaded along
with its signature file generated with the VeriShield File Signature tool.
Up to eight VeriShield Security Scripts can coexist in the unit at a same time. Each
script defines its independent key space and defines whether or not those keys
can be loaded using the generic key loading functions
(iPS_LoadMasterClearKey() and iPS_LoadMasterEncKey()).
The VSS Key Loading Key (VSS_KLK) is a double-length key. It is loaded in the
clear, but can also be loaded encrypted under its previous value. Since there is no
default value in the firmware for the VSS_KLK, the first time it must be loaded in
the clear. In that case, other keys in the unit will be erased, so it must be loaded
before all other keys. This must be done in a secure environment before
deployment.
The security script’s master keys can be loaded in the clear or encrypted under
VSS_KLK. Loading additional keys without erasing the keys previously loaded
must be done in encrypted form and therefore requires the knowledge of
VSS_KLK.
Each script defines its own set of keys and also defines if the keys may be loaded
with those generic key-loading functions. Some scripts may disallow their use and
implement custom macro commands for key loading.
iPS_DeleteKeys()
Prototype
int iPS_DeleteKeys(unsigned long ulKeyType);
Parameters
ulKeyType Indicates which set of keys to erase. Each bit corresponds to a set of
keys; that is, several sets can be erased in one function call.
Return Values
• =0 Success
• E_KM_SYSTEM_ERROR
iPS_LoadSysClearKey()
Loads the VSS_KLK (that is, system keys). The values are presented in cleartext.
Before writing the new value of the key, all other keys in the terminal are erased.
Use this function exclusively in a secure environment.
Prototype
int iPS_LoadSysClearKey(unsigned char ucKeyID,
unsigned char * pucINKeyValue);
Parameters
ucKeyID The key identifier.
0x00 VSS_KLK (16 bytes)
Return Values
• =0 Success
• E_KM_SYSTEM_ERROR
iPS_LoadSysEncKey()
Loads the system encryption keys. The new values must be presented encrypted
under the current value of VSS_KLK. Contrary to cleartext loading, this encrypted
loading does not erase all other secrets in the unit. An error code returns if the
VSS_KLK is not present.
Prototype
int iPS_LoadSysEncKey(unsigned char ucKeyID,
unsigned char * pucINKeyValue);
Parameters
ucKeyID The key identifier.
0x00 VSS_KLK (16 bytes)
Return Values
• =0 Success
• E_KM_SYSTEM_ERROR
iPS_LoadMasterClearKey()
Loads the master key of the security script. The values are sent in cleartext, but
must be all loaded in the same session. Before loading the first key after a power
cycle, all previously loaded keys (including the system keys) are erased. This
means that loading additional keys in a different session must be done encrypted.
Use this function to load the keys defined by the Security Module. Use this
function exclusively in a secure environment.
Prototype
int iPS_LoadMasterClearKey(unsigned char ucKeySetID,
unsigned char ucKeyID, unsigned char * pucINKeyValue);
Parameters
ucKeyID The key set identifier.
00 Key set defined in VeriShield Security Script #0.
...
pucINKeyValue Pointer to the 8-byte buffer containing the encrypted value Master
Key.
Return Values
• =0 Success
• E_KM_SYSTEM_ERROR
iPS_LoadMasterEncKey()
Loads the security script’s master keys without deleting the keys already loaded.
The new values must be presented encrypted under the current value of
VSS_KLK. Use this function to load the keys defined by the Security Module. An
error code returns if the VSS_KLK is not present.
Prototype
int iPS_LoadMasterEncKey(unsigned char ucKeySetID,
unsigned char ucKeyID, unsigned char * pucINKeyValue);
Parameters
ucKeyID The key set identifier.
00 Key set defined in VeriShield Security Script #0.
...
pucINKeyValue Pointer to the 8-byte buffer containing the cleartext value Master
Key.
Return Values
• =0 Success
• E_KM_SYSTEM_ERROR
iPS_CheckMasterKey()
Indicates if a key is present in the specified location. The Key Verification Code
(KVC) argument is irrelevant in the V/OS terminal because this function is used
only for security script keys. The key can be part of a double- or triple-length DES
key. The KVC of a portion of the key cannot be returned.
Prototype
int iPS_CheckMasterKey(unsigned char ucKeySetID, unsigned char ucKeyID,
unsigned char * pucINKVC);
Parameters
ucKeyID The key set identifier.
00 Key set defined in VeriShield Security Script #0.
...
pucINKVC Unused
Return Values
• =0 Success
• E_KM_SYSTEM_ERROR
SetSecurePINDisplayParameters()
Registers the callback function for the upcoming PIN session. Call this function
each time before requesting a PIN session either through an IPP packet (Z60, Z63
or Z69) or through a VeriShield Security Script API (iPS_RequestPINEntry()).
See SetSecurePINDisplayParameters(), page 246.
Prototype
void setSecurePINDisplayParameters(struct touch_hs_s *hotspot_table,
void *callback);
iPS_SetPINParameter()
Prototype
int iPS_SetPINParameter( PINPARAMETER * psKeypadSetup);
Parameters
psKeypadSetup
typedef struct {
unsigned char ucMin,
unsigned char ucMax,
unsigned char ucEchoChar,
unsigned char ucDefChar,
unsigned char ucOption,
} PINPARAMETER;
ucEchoChar Not used on V/OS. The characters echoing PIN digits are
displayed by the SetSecurePINDisplayParameters()’s
callback function.
Return Values
• =0 Success
• E_KM_SYSTEM_ERROR
iPS_SelectPINAlgo()
Selects the PIN algorithm or mode for the next VSS PIN session. The PIN
algorithm cannot be changed during a PIN session.
In the V/OS terminal, the only supported modes are 0Ah for EMV offline PIN or
0Bh for use with VeriShield Security Scripts. In these modes, the PIN is saved
internally and retrieved by the security code for presentation to the smartcard (in
plaintext or encrypted form) or by a Security Script command for post-processing.
Prototype
int iPS_SelectPINAlgo(unsigned char ucPinFormat);
Parameters
ucPinFormat
0Ah EMV mode: Store the PIN internally to present to the
smartcard later.
Return Values
• =0 Success
• E_KM_SYSTEM_ERROR
iPS_RequestPINEntry()
Initiates PIN collection. Once the PIN entry is complete, the PIN is formatted and
encrypted according to the algorithm specified by iPS_SelectPINAlgo(). The
encrypted PIN block is placed in a buffer and made available for
iPS_GetPINResponse(). This function is non-blocking, which allows the unit to
perform other tasks while the customer is entering their PIN.
Prototype
int iPS_RequestPINEntry( unsigned char cPANDataSize,
unsigned char * pucINPANData);
Parameters
ucPANDataSize RFU – ignored in V/OS terminals.
pucINPANData RFU – ignored in V/OS terminals.
Return Values
• =0 Success
• E_KM_SYSTEM_ERROR
iPS_GetPINResponse()
Checks the status of the VSS PIN session. It is typically used by the application in
a loop to poll the system until the PIN session ends. The information returned by
this function during the PIN session can be used in conjunction with a timer to
implement an inter-character timeout as required in certain countries. This
functions returns the number of PIN digits entered and the last non-numeric
pressed.
Prototype
int ippGetPINResponse (int * piStatus, PINRESULT * pOUTData);
Parameters
piStatus
OK Done. Data contains the result of the comparison/
(0x00) encryption.
0x0C The PIN session timed out. See the Note on the PIN
session timeout in ippRead(), page 244.
OK(0x00) Done.
pOUTData Number of PIN digits
->nbPinDigits entered (PIN length).
pOUTData Contains no relevant
->encPinBlock information.
Return Values
• =0 Success
• E_KM_SYSTEM_ERROR
iPS_CancelPIN()
Prototype
int iPS_CancelPIN(void);
Return Values
• =0 Success
• E_KM_SYSTEM_ERROR
iPS_InstallScript()
NOTE
Included for backward compatibility only. V/OS script management is done using
Secure Installer.
Prototype
int iPS_InstallScript(void);
Return Values
• =0 Always
iPS_GetScriptStatus()
Checks if a VeriShield Security Script file is installed in the specified script location
and if so, returns the name of the script.
Prototype
int ippGetScriptStatus(unsigned char ucScriptNumber,
unsigned char *pucINName);
Parameters.
ucScriptNumber Script number. Range [0..7].
pucINName The pointer to the application buffer to which the 8-character
name of the VeriShield Security Script value transfers.
Return Values
• =0 Success
iPS_UninstallScript()
NOTE
Included for backward compatibility only. V/OS script management is done using
Secure Installer.
Prototype
int ippGetScriptStatus(unsigned char ucScriptNumber);
Parameters.
ucScriptNumber Script number. Range [0..7].
Return Values
• =0 Always
iPS_ExecuteScript()
Spawns the execution of a given macro from a loaded VeriShield Security Script.
Prototype
int iPS_ExecuteScript(unsigned char ucScriptNumber,
unsigned char ucMacroID, unsigned short usINDataSize,
unsigned char * pucINData unsigned short usMaximumOUTDataSize,
unsigned short *pusOUTDataSize, unsigned char * pucOUTData);
Parameters
ucScriptNumber Script number. Range [0..7].
ucMacroID Number of the macro function to be executed.
usINDataSize The size of the input data (in bytes).
pucINData The pointer to the buffer containing the input data.
usMaximumOUTDataSize The maximum size of the output data. This is typically the
size of the output buffer.
pusOUTDataSize Pointer to number of bytes returned by the macro in the
output buffer.
pucOUTData The pointer to the output buffer. The number of bytes
returned in the output buffer is specified by
pusOUTDataSize. If the macro is returns more data than
the output buffer can contain, an error E_VS_BAD_LENGTH
is returned and nothing is copied into the output buffer.
Return Values
• =0 Success
• Value in the range [0...255] Macro execution error - The returned value is the
value of the opcode that caused the execution
error. Refer to P/N 21883 for the list of opcodes.
• E_VS_SYSTEM_ERROR
pcPS_GetVSSVersion()
Prototype
char* pcPS_GetVSSVersion(void);
Return Values
It returns a char pointer to the following null-terminated string:
"PSVSSvX.Y"
• X Major version
• Y Minor version
Security All listed security services calls are defined in the header file svcsec.h.
Services Applications must link with the libvfisec.so library by using
Functions -lvfisec.
cryptoWrite()
Use the File Encryption feature to guarantee that the file content is lost if the unit
is tampered with. The file is encrypted with a key derived from the top-level key
erased from the terminal in case of attack, making it impossible to recover the
content of the encrypted file. The key is unique for each terminal and is not known
outside the cryptographic unit of the terminal.
This feature can be used, for instance, when tamper detection must cause the
deletion of the transaction batch file.
cryptoWrite() encrypts and writes count bytes of data from buffer to the
open file associated with handle. It returns the number of bytes actually written,
which is count bytes unless an error occurs. The file must be open for both reads
and writes (that is, if the file was opened with flag O_WRONLY set, the function
returns –1 and errno set to EBADF).
Prototype
int cryptoWrite(int handle, const char *buffer, int count);
Parameters
handle File handle
buffer Pointer to the buffer holding the input data.
count Number of byes to write.
Return Values
cryptoRead()
Reads a maximum of count bytes of encrypted data from the open file
associated with handle, decrypts the data, and stores the result in buffer. It
returns the number of bytes actually read, which may be less than count if fewer
bytes are available.
Prototype
int cryptoRead(int handle, char *buffer, int count);
Parameters
handle File handle.
buffer Pointer to the buffer holding the input data.
count Maximum number of byes to write.
Return Values
rsa_calc()
Performs a public key RSA computation. It supports key lengths from 9 bits up to
2048 bits, and exponent values that can be written as (2exp+1), for instance 2, 3,
65537.
Prototype
int rsa_calc(unsigned char * msg, unsigned char * mod, int count, int exp,
unsigned char * result);
Parameters
msg Pointer to the buffer holding the input data.
mod Pointer to the buffer holding the modulus.
Note: If count is odd, the first byte (leftmost) cannot be null, if count is
even the first two bytes (leftmost) cannot be null or the function
returns an error.
count Length of the modulus and input data in bytes. Min = 3; Max = 256.
exp Code for exponent: actual exponent is 2exp+1.
For example, set exp to 16 for exponent 65537.
result Pointer to the buffer receiving the result on exit.
Return Values
• =0 Success
vfi_SHA1()
Prototype
int vfi_SHA1(unsigned char * option, unsigned char * input_buffer,
unsigned long nb, unsigned char * sha20);
Parameters
option
SHA1INIT First call. The SHA-1 engine is initialized before
processing the data. No digest is returned.
SHA1BUFF Intermediate call. It feeds the SHA-1 engine more
data. No digest is returned.
SHA1TERM Final call. The 20-byte digest is returned after the
data is processed.
SHA1ALL One-step operation; combines all options above.
Return Values
• =0 Success
• <0 Error
DES()
Performs DES, DESX and Triple-DES computations. The operation type and key
length are specified using the parameter ucDeaOption.
Prototype
int DES(unsigned char ucDeaOption, unsigned char *pucDeaKey8N,
unsigned char *pucInputData, unsigned char *pucOutputData);
Parameters
ucDeaOption Algorithm:
DESX1KE(02h)
DEAX encryptions with single-length key
DESX1KD(03h)
DESX2KE(04h)
DEAX encryptions with double-length key
DESX2KD(05h)
DESX3KE(06h)
DEAX encryptions with triple-length key
DESX3KD(07h)
DESE(08h)
DEA encryptions with single-length key
DESD(09h)
TDES2KE(0Ch)
TDEA encryptions with double-length key
TDES2KD(0Dh)
TDES3KE(0Eh)
TDEA encryptions with triple-length key
TDES3KD(0Fh)
Return Values
• =0 Success
• <0 Error
AES()
Performs AES computations on a 128-bit data block. The operation type and key
length are specified using the parameter ucAesOption.
Prototype
int AES(unsigned char ucAesOption, unsigned char *pucAesKey8N,
unsigned char *pucInputData, unsigned char *pucOutputData);
Parameters
ucAesOption Algorithm:
AES128E (04h)
AES encryptions using a 128-bit key.
AES128D (05h)
AES192E (06h)
AES encryptions using a 192-bit key.
AES192D (07h)
AES256E (08h)
AES encryptions using a 256-bit key.
AES256D (09h)
Return Values
• =0 Success
• <0 Error
generateRandom()
Prototype
int generateRandom(char *random8);
Parameters
random8 Pointer to the 8-byte buffer where the random value is transferred.
Return Values
• =0 Success
• <0 Error
isAttacked()
NOTE
Included for backward compatibility only. On V/OS terminals, always returns 0.
Indicates if an attack occurred causing the loss of the transactions key and/or
encrypted files. However, the V/OS system does not allow applications to run until
the unit is de-tampered, so the return value is always 0.
Prototype
int isAttacked(void);
Return Values
• =0 Always
secVersion()
Returns the version number strings for the security module and the security library
in the form xx.yy.zz.
Prototype
int secVersion(char *pchModVersion, char *pchLibVersion);
Parameters
pchModVersion Pointer to the 9-byte buffer receiving the security module
version number.
pchLibVersion Pointer to the 9-byte buffer receiving the security library version
number.
Return Values
• =0 Success
• <0 Error
authFile()
NOTE
When specifying a filename, ensure that the full path is included. For example:
/home/usr1/example.exe.
Parameters
Return Values
• =1 File is authenticated
loadOSFiles()
NOTE
Deprecated – Do not use – See Secure Installer for information on downloads to
V/OS terminals.
Prototype
int loadOSFiles(void)
Return Values
• =0 Always
osHash()
Linux has a rich API to support RTC functionality, so we will not be supplementing
or modifying that API. The V/OS of terminals include Verifone-specific RTC
hardware required to keep the time accurate when the unit is off.
On power up, the operating system automatically sets the Linux (soft) RTC from
the V/OS terminal RTC hardware. Call setRTC() immediately after any call that
sets the time and date of the Linux RTC or the updated time/date is lost when the
unit is off.
setRTC()
Sets the RTC hardware to the Linux RTC time/date. This function must be called
immediately after any function that sets the Linux RTC time/date. This API has no
parameters or return codes.
Prototype
void setRTC(void);
setDateTime()
As user processes are not allowed to set the Linux RTC, applications must call
setDateTime(), passing the date and time in the same format used in the shell
command date: MMDDhhmmYYYY.ss, where:
• MM = Month
• DD = Day
• hh = Hour (24-hour format)
• mm = Minute
• YYYY = Year
• ss = Seconds
NOTE
setDateTime() only sets the Linux RTC. To set the hardware RTC, the
application must follow setDateTime() with setRTC().
Prototype
int setDateTime(char *dateTime);
Return Values
• =0 Success
• <0 Error
Pre-expired It is a PCI requirement for passwords allowing access to sensitive areas of the
Passwords system to expire when the unit is shipped from the factory. The first login after the
unit leaves the factory forces the operator to change the password. The new
password cannot be the same as the default password.
Unique
Used by Notes
Password
System mode Verifone, Acquirer for This is the usr1 account password.
(sensitive areas) cleartext key loading The password cannot be set by the
/ Tamper clearing user to the default value.
Cleartext key Deployment, Acquirer Two passwords names keyloading1
loading and keyloading2.
Accessed through the System mode
menu after usr1 login.
The password cannot be set by the
user to the default value.
System mode Deployment, Customer usr2 through usr16
Limited access The password cannot be set by the
user to the default value.
Unique
Used by Notes
Password
System mode Repair depots Maintenance mode
Limited access Does not require expired passwords
as there is no ability to access
sensitive areas or clear tamper codes.
Allows the password to be reset to the
default.
System mode Customer Level1 and Level2 System mode
access.
There is no default password for these
logical logins so they expire.
An authenticated security policy file is
required to enable Level1 and Level2
logins.
Login / Password Prior to entering System mode, the PINpad allows you to select a login account,
Management and then prompts for a password. If the password is expired or pending change,
you must enter the current password and then a new password (pre-defined for
pending password changes). New passwords must be entered twice for
validation.
System Mode System Mode access can be limited when logging in as Level1 and Level2. Use
Access Control configuration variables in the security policy file to define specific tabs accessible
to the user. For example, if the INFORMATION tab is disabled there is no access
to the functionality (sub-menus) defined under it. This includes the OS Details,
Packages, Flash, Cable, COM3, and Ethernet buttons.
Another example is the CONFIGURATION tab. You can disable all capabilities in
the sub-menus or the ability to select one or more sub-menu items. For example,
it is possible to only disable the ECR PORT and EDITOR functions, but leave all
remaining features enabled.
See Security Policy File Details for how to define System mode access control
variables for Level1 and Level2 users.
Secure Remote Simple and consistent secure password download are allowed to:
Password Download
• Perform a SHA256 hash on all password values, ensuring they are never
passed in the clear.
• Enhance the strength of the SHA256 by using both the existing and new
password in the hash generation.
• Use the authenticated security policy file to download new passwords as well
as password state changes.
A simple PC tool, the Security Policy File Generation tool, was developed to
simplify creation of the SHA256 from old and new passwords. The output of this
tool is a Security Policy file that can then be signed and downloaded.
Password States As demonstrating in Figure 11 the V/OS PINpad is secure in each stage of its
product life cycle. There is no need for different controlling entities to share
common passwords.
Manufacturing
Shipment
Security Policy
File
Deployment
Shipment
Security
Policy File
Entity Role
Manufacturing Creates device, performs initial firmware install, loads a security
policy file generated by the deployment entity. Security policy
includes pending password changes for all system passwords. The
Security Policy file can be viewed in the clear without concern of
discovering dual control passwords. Existing (default) passwords
expire prior to shipment, placing the unit into the deploy state.
Shipment Being in the deploy state keeps the device secure from tampering
while being transported between controlling entities.
Deployment Accepts the device from manufacturing. Dual operators must
present passwords to gain access to the device. Once the device
is under deployment control it is prepared for the end-user by
loading customer-specific application software. This application
software includes a signed (using Verifone VeriShield) Security
Policy file that includes pending passwords for all system
passwords. Existing (deployment) passwords expire prior to
shipment.
End-User Accepts the device from Deployment, and installs it at a retail
location. The application automatically activates. If the store
manager requires access to a System mode function, a dual
control password known only to them is required. The unit is
secure and the Manufacturing and Deployment entities have no
knowledge of the system access password.
State Definition
Password Change is The Security Policy file contains a pending password
Pending change variable for a given login. The pending password is
composed of a SHA256 of the old and new password.
Hashing the old and new password enhances security and
allows the value to be publicly invisible. At the next login,
the user must present the old and new passwords (dual
control) that comprise the pending password.
Password is The Security Policy file contains a flag for a given account
Expired that determines if on the next login the current password
must be changed. Note that when the Expired flag is set it is
required that the existing password be entered before the
user can enter a new password.
BOTH Password This is a SPECIAL case. When both the password expired
Expired AND Change flag and the password change pending value are set, on the
Pending next login the user must present two passwords that make
up the pending password change SHA256 value. The
existing password is ignored because it is expired.
Implementing this state allows the unit to remain secure
without having a default password or sharing a password
between controlling entities.
State Definition
Secure No password change is pending AND the password is not expired.
This is the most common in field state where no password
changes are required.
Pending A password change is pending AND the password is not expired.
A download has included an authenticated Security Policy file that
defines a new password. On login, the operator is asked to enter
the existing and new passwords.
Deploy A password change is pending AND the password is expired.
The Deploy state is used when a unit is being transferred from one
device controlling entity to another. For example, from the
deployment facility to the customer site.
Expired No password change is pending AND the password is expired.
When set without a pending password change, security is at its
weakest in that on login the operator must present the current
password and then must enter a new (arbitrary) password. While
this state meets PCI 2.0 regulations, it is recommended that a
password pending change be implemented at the same time.
NOTE System mode supports a feature called “Prepare unit for shipment” that performs
one of the following:
• Reset all passwords to default settings and expire all passwords (except
Maintenance)
OR
• Expire all passwords (except Maintenance)
Enter and N
Enter Pending Is pwd
Confirm New Password Correct?
Password
Y
N N
Pwd update Is pwd
successful? Correct?
Y Y
Y Are pwd’s
Correct?
Logged Out!
Logged Wait
A
Out! 5 sec
Enter PWD
Yes
Save but do NOT
Deploy? compare to current
password.
No
No
PWD
Correct? A
Yes
No No Pending? No
Secure? Expired?
A
Yes Yes
Yes
Enter and Confirm Enter New Pending Enter New Pending
New PWD PWD PWD
No No No
PWDs PWD PWD
A Match? Correct? Correct?
Enter Both
Logged Pending PWD’s
In!
Yes PWD’s No
Correct? A
Use Case To better explain the flow chart in Figure 13, review the life cycle of the V/OS
PINpad being built at the factory, shipped to a deployment center, and finally
arriving at a customer’s location.
At the Factory
The factory assembles and tests the V/OS PINpad. To accomplish this task,
access is needed to the following System mode functionality:
• Information screens
• Limited TTY–needed to run mfginit process
• Diagnostics
The factory MAY download test applications, therefore access to the usr1 account
is required. All passwords are set to their default values with no pending or
expired state changes.
TIP If the Security Policy file was downloaded at the factory prior to shipping the unit,
there is no need for the deployment site to share ANY passwords with the
factory. Security is greatly enhanced for the unit as it travels from site to site and
there is no sharing of secrets!
NOTE
The customer application includes an updated Security Policy file with password
pending changes set for all critical passwords.
Once the deployment site has loaded the customer application, it selects the
System mode option to prepare the unit for shipment. This expires all passwords.
Security Policy File The Security Policy file is similar to the config.usr file in that it uses the INI
Details format with the concept of variable/label = value. The Security Policy file does not
support sections, as supported on config.usr files. Also, unlike the
config.usr files, the Security Policy file only supports a fixed set of entries. It is
not intended for general-purpose application parameter storage. The Security
Policy file MUST be signed using VeriShield and the application certificates. Once
processed, the Security Policy file is deleted and the values set in it cannot be
viewed or edited from System mode.
VeriShield VeriShield Remote Key (VRK) occurs as part of a download without interaction
Remote Key with the application. The following function calls are available for use by
(VRK) Functions applications.
copyPublickey_RKL()
Copies the VRK public key certificate to the /tmp directory. The filename is
KRD_sss-sss-sss.crt where, sss-sss-sss is the serial number of the unit.
Prototype
void copyPublicKey_RKL(void);
Return Values
• =0 Successful
• -1 Error
getKeyStatus_RKL()
Prototype
rkl_key_status_t getKeyStatus_RKL(void);
From svcsec.h:
typedef enum // enumeration for RKL file status
{
NO_KEYS_RKL, // Neither file exists
PUBLIC_KEY_RKL, // Only /root/rkl_keys/rkl_cert.crt exists
PRIVATE_KEY_RKL,// Only /root/rkl_keys/rkl_priv_key.der exists
BOTH_KEYS_RKL // Both files exist
}rkl_key_status_t;
Return Values
• -1 Error
Diagnostic Counters
NOTE
Reference the diag_counters_API.h header file to supplement the information in
this chapter.
The diagnostic counters are a set of 256 4-byte variables in Non-Volatile Memory
(NVM). Most are straight counters, but some have other purposes such as to
record time stamps. Counters are referenced as numbers 0–255, symbolically
defined in enum diag_counter_index_number in diag_counters_API.h.
Counter 0 is the ID (signature). On terminal boot up, the ID is checked against the
opsys counters table in RAM (see Accessing Group Descriptions). If the ID is
incorrect, the block is cleared to 0 and the ID reset to the value in the counters
table. This allows new terminals to self-initialize the counter block.
Counters 1–127 are reserved for definition by applications. Counters 128–254
record various operating system (opsys) events. Counter 255 is reserved for
system use.
Diagnostic The Diagnostic Counter APIs provide calls to read and write the counters.
Counters
Functions
NOTE
The opsys counters, 0 and 128–255, are read only.
diag_counter_info Structure
struct diag_counter_info
{
char text[17];
// Max of 16 chars + 1 null - Concise ascii description of the counter
__u32 groups; // Bit mask of group(s) the counter belongs to
__u32 flags; // Bit mask of display behavior modifiers
__s32 value; // Convenient place to retrieve counter value
__s16 index; // Counter number
};
Counter Attributes In addition to the counters in NVM, the opsys maintains in RAM an array of 256
copies of the diag_counter_info structure to define the attributes of each counter.
• The <text>, <groups>, and <flags> elements are for formatting display
routines (for example, as used by the Home > Info > Counters tab).
• When retrieving counter attributes, the <value> element retrieves the current
counter value.
• The <index> element specifies the counter number.
Setting Counter Applications can use counters 1–127, and assign attributes to these counters. For
Attributes example, application counters can define groups and flags, or re-use those
defined in the diag_counter enums mentioned above.
Use this call to set counter attributes:
int diag_counter_set_info(__s16 index, struct diag_counter_info *info);
Formatting Counter Use these calls to format counter displays. They are also used by the
Displays Home > Info > Counters tab.
• To get counter attributes and value:
int diag_counter_get_info(__s16 index,struct diag_counter_info *info);
• To read the attributes and values of all counters into the
struct diag_counter_info[256] array:
int diag_counters_get_info_all(struct diag_counter_info *info);
Accessing Group The opsys maintains a small table of group descriptions. This table is for opsys
Descriptions use only. However, applications can use this call to access group descriptions for
counter display formatting. The first entry in the group table that matches any bit
set in ginfo returns.
int diag_counter_get_info_group(struct diag_counter_info_group *ginfo);
diag_counter_info_group Structure
struct diag_counter_info_group
{
char text[13]; // Max of 12 chars + null
__u32 group;
};
The VCL software component provides Format Preserving encryption services for
payment applications. It is transparent to the payment running application and to
the payment infrastructure, except that data must be decrypted before
presentation to the payment authorizing gate. See the VeriShield Crypto Library
Technical Reference Manual (P/N D45-20021) for complete information.
LEDs MX terminals have three blue LEDs located in magnetic stripe reader, an LED in
the smartcard reader, and an LED array for the keypad. These inform the user
that they can swipe their card. More complex use of these LEDs requires a thread
or timer for synchronization. Use the ecore timers available in the GUI library.
NOTE
For legacy applications, if your application directly addresses the LEDs, update
the calls to use the definitions found in svc.h.
ledRunway()
NOTE
Disable the runway effect before calling led_ledOff() or Led_ledOn() as
undesirable side affects may occur.
Parameters
enable 0 = Disable the runway effect
Serial Ports and Figure 14 presents an overview of the three UARTs available on the multiport
Protocols cable on MX terminals.
NOTE On V/OS-based terminals the I/O module determines available ports. The
Wrenchman co-processor is in select I/O modules. COM1/COM2/COM3 may not
be available on all configurations.
FEATURE C PROTOCOL
USER SPACE
(VISA LAYER)
PACKET MODE PROTOCOL
LINUX KERNEL
CHARACTER DEVICE
WRENCHMAN
CPU SILICON LABS
HARDWARE
COMMUNICATION
COPROCESSOR
Serial The following structures are defined for configuring serial ports on V/OS terminals.
Communication They contain all elements for defining the ports to the different supported modes.
Control These structures comprise the necessary settings to configure a serial port for
Structure RS-232/485, Tailgate, Visa, Packet mode, or other protocols.
typedef struct{
short status;
short comm_handle;
short visa_sel; /* 0 - visa not selected, 1 - visa selected */
int port;
void (*pEcrReceive) (void); /* ecr rx callback for application */
struct Opn_Blk openBlock;
}ECR_INFO;
Parameters
protocol The main structure is the Open Block structure (Opn_Blk), which
contains the protocol element. protocol indicates port mode
configuration and defines applicable fields for that mode.
trailer The trailer field value depends on protocol. Because
trailer consists of different types, only one type is valid at any
time. If Tailgate mode is the protocol, ECRtailgate_parms is
the valid field. All future mutually exclusive protocols are defined
here.
Packet Mode Packet mode protocol manages packet-based protocols over any serial port. It
Functions supports the definition of a packet start and end character, as well as error
detection characters (such as LRC/CRC).
The packet mode library buffers incoming data until a complete packet is received.
Once a complete packet is in the receive buffer, the library calls a callback
function to deliver the message to the application. Outgoing messages must be
fully defined including start, end, and error detection characters before writing to
the packet library.
Packet mode protocol has been implemented as the libvfiprot.a static
library.
startPktMode()
Parameters
hCom Handle of an open serial port.
openBlock Serial communication control structure.
Return Values
=0 Success
<0 Error
endPktMode()
Prototype
void endPktMode(void);
packetRX()
Prototype
void packetRX(char * rxBuffer, int rxLength);
Parameters
rxBuffer Pointer to a character buffer with the received message.
rxLength Length of received message.
COM Ports The following COM ports are available on MX terminals, and are referenced in
software as the following devices:
• COM1 = /dev/ttyAMA0
• COM2 = /dev/ttyAMA1
• COM3 = /dev/ttyWR0
• COM4 = /dev/ttyAMA2
• COM5 = /dev/ttyGS0
Some ports are optional depending on terminal configuration. All ports are
available as general RS-232 ports configured using different baud rates, character
sizes, parity, and stop bits through either standard Linux calls or the legacy call
svcSetOpenBlock(). Configure ports to work in character or packet mode such
as the Visa protocol, and with or without flow control if available on the port.
Supported baud rates for all ports are: 1200, 2400, 4800, 9600, 19200, 38400,
57600, and 115200.
Serial port devices can be opened for control by more than one process at a time.
The following ioctl() calls prevent processes from using the port, allowing
exclusive access to the port.
TIOCEXCL Put the ttyAMAx into exclusive mode, where no further open()
operations are permitted. They will fail with EBUSY, except for
root.
V/OS terminals COM ports do not support parity errors and BREAK condition
detection.
The application must know which control and status lines are supported by each
COM port. Control lines not supported by the hardware report the last status set
by the application, and unsupported status lines report as asserted.
When a port is open through the O_NONBLOCK option, the read() command
return value for that port can have different results if configured with flow control
enabled. When flow control is enabled and no data is available on the port,
read() returns 0. If flow control is not enabled and no data is available, read()
returns -1 with errno set to EAGAIN (11 – try again). Both values indicate that no
data is available.
COM1 COM1, or device /dev/ttyAMA0, supports the RTS, CTS, and DCD hardware
lines.
COM2 COM2, or device /dev/ttyAMA1, supports the RTS, CTS, DTR, and DCD
hardware lines. RTS/CTS flow control is under device driver control, and the RTS
line must be controlled by the application using Linux ioctl() calls:
#include <unistd.h>
#include <termios.h>
int fd;
int status;
ioctl(fd, TIOCMGET, &status);
status &= ~TIOCM_RTS;
ioctl(fd, TIOCMSET, &status);
COM Port Use the following functions to control the communications ports of V/OS terminals.
Functions
comMonitorHandshake()
NOTE
Due to hardware constraints, this function ONLY works for COM 2 on V/OS
terminals.
Enables a counter increment on transitions on the CTS and/or DCD lines. A call
back function notifies the application of the handshake line state change. Before
calling comMonitorHandshake(), open the COM2 port as the file descriptor is
required for the second parameter.
The mask parameter monitors the DCD, CTS, or both handshake lines.
Parameters
Return values
=0 Success
<0 Error
NOTE
Due to firmware limitations, this port does not support true full duplex mode.
Do not use full duplex protocols with this port.
If this port is connected to a full duplex device and a full duplex protocol is used in
communication, this port may not be able to transmit and receive data without
loss, depending on the amount of data and configured baud rate.
If this port is connected to any device capable of full duplex mode but uses a half
duplex protocol in its communication (that is, the packet is sent, waits for response
such as ACK/NAK, packet is sent), there is no problem of data loss.
Protocols and devices that do not use full duplex and that can safely connect to
this port are: ECR, Zontalk, DL, DL5, DDL, most COM devices, printers, and
check readers.
NOTE All baud rates configurations listed in this section, character sizes, parity and stop
bits are supported, except 7N1 (7 bits, No Parity, and 1 stop bit). This setting is
not supported on COM3. Use 2 stop bits (7N2) if you require the port be
configured for 7-bit character sizes with no parity bit.
COM5 COM5, or device /dev/ttyGS0, is a serial device that transmits and receives
data over a USB cable using USB Gadget technology. This allows V/OS terminals
to act like any other serial port when connected to a USB host port. Configure the
V/OS terminals to be a USB device that emulates a serial port connected to a
USB host. Connect the terminal’s USB device cable to a Windows or Linux OS
based machine as another COM port. This allows serial USB transfers between
the terminal and a PC.
The USB (version 1.1) serial device gadget is only supported over a berg cable.
The USB OTG port does not support USB serial devices. Use the COM5 definition
in vficom.h for the V/OS device name. V/OS terminals support the following ioctl()
to detect cable status:
int handle, connected;
// Re-open port
handle = open(COM5,O_RDWR | O_NONBLOCK);
if (handle < 0)
// Port open failed!
}
else if (connected==1)// Good connection, OK to write date to port
{
// Write data to port
}
else // No connection
// Cable is disconnected
}
else
// Port open failed!
Service Switch When license enabled, the service switch triggers a stand tamper event on V/OS-
based terminals to signal when the unit is removed from its stand. A “true” security
tamper event is not triggered; the unit does not erase sensitive information on
service switch tampers. There are two stand tamper modes:
• Default mode – the operating system manages the stand tamper event. On a
stand tamper event, the unit reboots and displays the System Mode login
screen. If the stand tamper signal is not active and a valid password is
entered, the stand tamper event clears. While the unit is in a stand tamper
condition, System Mode runs normally except that applications cannot
execute.
Set the following configuration variable to enable OS-managed stand tamper
events:
*standtamperactive= 0 | 1 | 2
where, 0, 1, 2 identify the system mode login account that can clear the
tamper.
• 0 = Supervisor (can always clear a stand tamper event)
• 1 = Level 1
• 2 = Level 2
NOTE
The maintenance account can never be used to clear a stand tamper.
• Mode 1 – the application manages the service switch using the security
service function calls.
Touch Panel This section presents MX terminal touch screen specifications and function calls.
Functions
touchCmd()
Prototype
int touchCmd(int cmd, int value);
Parameters
Signature Signature Capture is implemented as a widget at the FancyPants GUI level. The
Capture widget supports the definition of a signing region as well as the ability to track
Functions stylus movement. Note that the strokes returned by the Signature Capture widget
are scaled to 320x234 (72dpi). During signature capture, the system automatically
enables palm rejection (finger is not recognized). Applications can use Stylus
Priority mode during signature capture, but must call touchCmd(11,0) to
disable palm rejection before initiating a signature capture. touchCmd(11,1) to
restore palm rejection during signature capture.
Use the following calls to read and process the raw data for higher resolution
images.
NOTE
During signature capture with a stylus connected, the unit switches to stylus-only
mode.
#include "svc.h"
#include "sig.h"
typedef struct {
long x : 12; // X co-ordinate 0…1880 of touched point
long y : 12; // Y co-ordinate 0…1360 of touched point
long z : 8; // Z co-ordinate/pressure 0…63 of touched point
} __attribute__((packed)) xyz_t;
This is a representation of the x,y,z value of a single touched point packed into
32-bits – x,y, and z are signed quantities.
Also defines PENUP, which has the value:
{.x = -1, .y = -1, .z = -1}
SigCapCount()
Prototype
int SigCapCount(void);
SigCapGet()
Copies up to maxPoints of data from the kernel buffer to the user buffer. Returns
the number of points actually copied, which is less than maxPoints if fewer
points are available.
Use SigCapCount() to retrieve the number of points captured. Ensure that the
buffer is large enough to hold the number of points captured. For example, if
SigCapCount returns 1000, then the buffer must be (xyz_t)*1000 bytes.
Prototype
int SigCapGet(void *data, int maxPoints);
SigCapBoxApply()
Applies a signature box to the data in the results of SigCapGet(). Data outside
the box is replaced by PENUP. The data is also compressed to remove adjacent
duplicate points and adjacent PENUPs. The function returns the new number of
unique points.
The application supplies the signature box to the function call.
The box coordinates are in screen format, that is:
• x = 0...479 and y = 0...271 for MX915 terminals
• x = 0...799, y = 0...479 for MX925 terminals
Signature data is in touch panel coordinates 0…1880 and 0…1360 for best
resolution. It is not necessary to call this function before calling SigCap2Tiff().
Prototype
int SigCapBoxApply(xyz_t *Sig, int count, SigCapBox_t *box);
vf_sig_cature_options()
Sets the rendering options (signature thickness bits) according to the union
pointed to by the argument. It controls only how the signature looks on the screen.
Note that a separate method in the TIFF function calls control thickening of
signature lines in the TIFF file.
To retrieve the call and the union definitions:
#include vf_sig_capture.h
Prototype
void vf_sig_cature_options(union renderOptions *ro);
union renderOptions
{
struct
int xminus1yminus1 : 1;
int xyminus1 : 1;
int xplus1yminus1 : 1;
int xminus1y : 1;
int xy : 1;
int xplus1y : 1;
int xminus1yplus1 : 1;
int xyplus1 : 1;
int xplus1yplus1 : 1;
} __attribute__((packed));
int options;
};
union structure represents a bit map of pixels to plot in addition to the original
pixel when a line is rendered using Bresenham’s algorithm. The options are
specified as either a bit field or an absolute value from 0 ... 511. This is how the
bits are mapped to pixels:
A null pointer causes a local static copy of union to be cleared; otherwise the
union pointed to is copied into the local static copy. A cleared union is the
power-up default and means that only the original point x,y is plotted with no
thickening. This also provides runtime-savings as there is no scanning of
individual bits when the union is clear.
To plot point (x,y) as well as (x+1,y) and (x,y+1) to get a thicker line use:
vf_sig_capture_render_options(&(union renderOptions){.options = 0x0b0});
RFCR Functions
RFCRlibVersion()
Prototype
int RFCRlibVersion(char *libVersion);
Parameters
libVersion Pointer to read in the RFCR library version, in the form
xx.yy.zz
Return Values
>=0 Success
<0 Error
RFCRInit()
Performs device initialization, and opens and configures the serial port. The
device handle returned on success can be used by applications.
Prototype
int RFCRInit(void);
Return Values
>= 0 Success
<0 Error
RFCRClose()
Closes the serial port used to communicate with the Contactless RFCR module.
This function does not power down the Contactless RFCR module.
Prototype
int RFCRClose(int handle);
Parameters
handle The handle returned from RFCRInit().
Return Values
=0 OK
<0 Error
RFCRGetVersion()
Prototype
int RFCRGetVersion(char *fwVersion);
Parameters
fwVersion Pointer to read in the RFCR firmware version.
Return Values
=0 Success
<0 Error
RFCRPing()
Prototype
int RFCRPing(void);
Return Values
=0 Success
<0 Error
RFCRReset()
Prototype
int RFCRReset(int onOffPulse);
Parameters
onOffPulse 0 = OFF
1 = ON
2 = PULSE (OFF then ON)
Return Values
=0 Success, for OFF, ON or PULSE
<0 Error
RFCRSetAntenna()
Prototype
int RFCRSetAntenna(short onOff);
Parameters
onOff 0 = Disable the RF Antenna
1 = Enable the RF Antenna
Return Values
=0 Success, for OFF
<0 Error
RFCRSetIndicator()
Configures the optional indicator controls of the Contactless RFCR module. The
configurable LED is located on the right side of the reader face. The LED on the
top-left side of the reader face is not configurable.
NOTE
The current RFCR hardware does not support the optional buzzer control.
Prototype
int RFCRSetIndicator(int led, int buzz);
Parameters
led 0 = disable LED
1 = enable LED for 100 ms
2 = enable LED for 200 ms
...
15 = enable LED for 1500 ms
buzz Not used at this time
Return Values
=0 Success
<0 Error
RFCRGetCardPayload()
Prototype
int RFCRGetCardPayload(char* buff, int maxlen);
Parameters
buff Pointer to store the Card Payload packet.
maxlen Maximum size of buff.
Return Values
>0 Success with the length of the Card Payload packet data read.
<0 Error
RFCRParseCardPayload()
Prototype
int RFCRParseCardPayload(CardPayload* payLoad, char* buff, int len);
Parameters
payLoad Pointer to CardPayload structure to store the data.
buff Pointer to Card Payload packet data.
len Size of the Card Payload packet data in buff.
Return Values
=1 Success
not 1 Any return value that is not 1 (either < = 0 or >1) are considered errors.
RFCRPurge()
Prototype
void RFCRPurge(void);
RFCRInputPending()
Prototype
int RFCRInputPending(void);
Return Values
=0 No data available
<0 Error
RFCRRawWrite()
Prototype
int RFCRRawWrite(unsigned char *buff, int len);
Parameters
buff Pointer containing the data to send to the RFCR module
len Number of bytes to send
Return Values
>0 Number of bytes written
<0 Error
RFCRRawRead()
Prototype
int RFCRRawRead(unsigned char *buff, int maxlen, int msecs);
Parameters
buff Pointer to store the data read from the RFCR module.
maxlen Maximum size of the buffer.
msecs Maximum wait time in milliseconds for data to arrive.
Return Values
>=0 Number of bytes read
<0 Error
RFCRAddCRC()
Calculates the CRC of the data contained in buff and inserts it at the offset
position of the buffer.
Prototype
void RFCRAddCRC(char* buff, int offset, int order);
Parameters
buff Buffer containing the Command Frame to calculate the CRC.
offset The position in the buffer to insert the CRC (and the size of the data to
CRC), usually 14 for Command Frame.
RFCRCheckCRC()
Prototype
int RFCRCheckCRC(char* buff, short len, unsigned short* calcCRC);
Parameters
buff Buffer containing the data and CRC, with the CRC being the last 2
bytes of the buffer data.
len Length of the data including the CRC.
calcCRC Pointer to store the calculated CRC.
Return Values
=1 CRC is valid
RFCRReceiveACKFrame()
Receives an ACK frame from the Contactless RFCR module. The contents of the
ACK frame specify whether the reader accepted the command. Depending upon
the command, the ACK frame may provide additional information.
Prototype
int RFCRReceiveACKFrame(char* buff);
Parameters
buff Pointer to store the ACK frame. Must have space for 16 bytes.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRReceiveDataFrame()
Receives a data frame from the Contactless RFCR module. The Size of the data
frame may vary.
Prototype
int RFCRReceiveDataFrame(char* buff, int maxlen);
Parameters
buff Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
maxlen Maximum size of buff.
Return Values
>0 Success with the number of bytes read.
<0 Error
RFCRSetPollMode()
Prototype
int RFCRSetPollMode(int mode);
Parameters
mode • 00h Auto Poll
• 01h Poll on Demand
Return Values
=0 Success
<0 Error
RFCRGetTransactionResult()
Prototype
int RFCRGetTransactionResult(char* buff, int max);
Parameters
buff Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
max Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRActivateTransaction()
Prototype
int RFCRActivateTransaction(char* data, int length);
Parameters
data Pointer to the data field in command packet. The format and contents
of the data field are given in Contactless Software Programmers Guide
(P/N 26807).
length Length of the data field in command packet.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRActivateMxItransaction()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRActivateMxItransaction(char* cmdData,int cmdLen,char* rspData,int
rspMax);
Parameters
cmdData Pointer to the data field in command packet. The format and contents
of the data field are given in Contactless Software Programmers Guide
(P/N 26807).
cmdLen Length of the data field in command packet.
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRDebitWrite()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRDebitWrite(char* cmdData, int cmdLen, char* rspData,
int rspMax);
Parameters
cmdData Pointer to the data field in command packet. The format and contents
of the data field are given in Contactless Software Programmers Guide
(P/N 26807).
cmdLen Length of the data field in command packet.
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRCancelTransaction()
Cancels the polling of any approaching card after the Activate Transaction
command or Update Balance command is sent to the reader.
Prototype
int RFCRCancelTransaction(void);
Return Values
=0 Success
RFCRGetFullTrackData()
Retrieves full track data from the RFCR. If a card is read, this call carries out the
transaction and returns the card data to the terminal.
Prototype
int RFCRGetFullTrackData(char* data, int length);
Parameters
data Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
length Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRUpdateBalance()
Prototype
int RFCRUpdateBalance (unsigned char status);
Parameters
status Status of the Update Balance command.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRSetEMVParameters()
Sets or changes the values of the specified data objects in the reader. Used to set
parameters for Auto Poll as well as Poll on Demand mode.
Prototype
int RFCRSetEMVParameters(char* data, int dataLen);
Parameters
data Pointer to the data field in command packet. The format and contents
of the data field are given in Contactless Software Programmers Guide
(P/N 26807).
dataLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRGetEMVParameters()
Retrieves the values of the specified data objects in the reader from nonvolatile
memory.
Prototype
int RFCRGetEMVParameters(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRSetBurstMode()
Enables RFCR Burst mode to send a data packet from the RFCR to the terminal
on each successful card read. The terminal does not have to send any command
or data to RFCR.
Prototype
int RFCRSetBurstMode(int burstMode);
Parameters
burstMode • 00h – Disable Burst mode.
Return Values
=0 Success
<0 Error
RFCRSetPassThroughMode()
Enables RFCR Pass Through mode to stop the RFCR polling for cards it
recognizes. Until Pass Through mode is disabled, only Pass Through commands
will allow the terminal to communicate directly with PICC.
Prototype
int RFCRSetPassThroughMode(int mode);
Parameters
mode • 00h – Disable Pass Through mode
Return Values
=0 Success
<0 Error
RFCRPollForToken()
Starts polling for Type A or Type B PICC until a PICC is detected or timeout
occurs. Once Pass Through mode starts, the RFCR stops polling for supported
cards and remains dormant until this command is sent. If a PICC is detected
within the specified time, the RFCR activates it and responds with card data.
Prototype
int RFCRPollForToken(int sec, int msec, char* rspData, int rspMax);
Parameters
sec Timeout in seconds.
msec Timeout in milliseconds.
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRIsoApduExchange()
Sends, via the RFCR, application-level APDUs to a PICC that supports the
14443-4 protocol. The PICC response is returned by the RFCR to the terminal.
Prototype
int RFCRIsoApduExchange(char* cmdData, int cmdLen, char* rspData,
int rspMax);
Parameters
cmdData Pointer to the data field in command packet. The format and contents
of the data field are given in Contactless Software Programmers Guide
(P/N 26807).
cmdLen Length of the data field in the command packet.
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRPcdSingleExchange()
Sends, via the RFCR, raw data to a ISO 14443 PICC that does not support the
ISO 14443-4 protocol (such as Mifare). The PICC response is returned by RFCR
to the terminal.
Prototype
int RFCRPcdSingleExchange(char* cmdData, int cmdLen, char* rspData,
int rspMax);
Parameters
cmdData Pointer to the data field in command packet. The format and contents
of the data field are given in Contactless Software Programmers Guide
(P/N 26807).
cmdLen Length of the data field in command packet.
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetPcdPiccParam()
Retrieves the PCD and PICC related parameters from the RFCR.
Prototype
int RFCRGetPcdPiccParam(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRMifareAuthenticateBlock()
Authenticates the Mifare card sector containing the specified block of data.
Prototype
int RFCRMifareAuthenticateBlock(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in command packet. The format and contents
of the data field are given in Contactless Software Programmers Guide
(P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRMifareReadBlocks()
Reads data from one or more blocks on the Mifare card and returns the data to
the terminal. The terminal can instruct the RFCR to read up to 15 blocks.
Prototype
int RFCRMifareReadBlocks(char* cmdData, int cmdLen, char* rspData,
int rspMax);
Parameters
cmdData Pointer to the data field in command packet. The format and contents
of the data field are given in Contactless Software Programmers Guide
(P/N 26807).
cmdLen Length of the data field in command packet.
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRMifareWriteBlocks()
Writes data to one or more blocks on the Mifare card. The terminal can instruct the
RFCR to write up to 15 blocks of data.
Prototype
int RFCRMifareWriteBlocks(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in command packet. The format and contents
of the data field are given in Contactless Software Programmers Guide
(P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRMifarePurseCommand()
Enacts debit, credit, and backup operations on value blocks on a Mifare card.
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRMifarePurseCommand(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in command packet. The format and contents
of the data field are given in Contactless Software Programmers Guide
(P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRHighLevelHaltCommand()
Sends a HALT command to the card, used for any Type A or Type B card. This
command can only be used in pass through mode.
Prototype
int FCRHighLevelHaltCommand(char halt);
Parameters
halt • 01h Send HALT for Type A card
• 02h Send HALT for Type B card
Return Values
=0 Success
<0 Error
RFCRSetCAPublicKey()
Sends the data related to a CA Public Key to the RFCR for storing it in a secure
environment (Crypto Chip Memory).
Prototype
int RFCRSetCAPublicKey(char* data, int dataLen);
Parameters
data Pointer to the data field in command packet. The format and contents
of the data field are given in Contactless Software Programmers Guide
(P/N 26807).
dataLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRDeleteCAPublicKey()
Deletes a previously set CA Public Key from secure storage in Crypto Chip
Memory.
Prototype
int RFCRDeleteCAPublicKey(char* data, int dataLen);
Parameters
data Pointer to the data field in command packet. The format and contents
of the data field are given in Contactless Software Programmers Guide
(P/N 26807).
dataLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRDeleteAllCAPublicKeys()
Prototype
int RFCRDeleteAllCAPublicKeys(void);
Return Values
=0 Success
<0 Error
RFCRSetRTCTime()
Prototype
int RFCRSetRTCTime(int hour, int min);
Parameters
hour Hour value.
min Minute value.
Return Values
=0 Success
<0 Error
RFCRGetRTCTime()
Prototype
int RFCRGetRTCTime(void);
Return Values
hhmm On success returns the current time in hhmm format
<0 Error
RFCRSetRTCDate()
Prototype
int RFCRSetRTCDate(int year, int month, int day);
Parameters
year Year value.
month Month value.
day Day value.
Return Values
=0 Success
<0 Error
RFCRGetRTCDate()
Prototype
int RFCRGetRTCDate(void);
Return Values
yyyymmdd On success, returns the current date in yyyymmdd format
<0 Error
RFCRSetBaudRate()
Sets the baud rate. If the RFCR supports the specified baud rate, it returns an
ACK response and then switches to the specified baud rate.
Prototype
int RFCRSetBaudRate(int baud);
Parameters
baud Baud rate.
Return Values
=0 Success
<0 Error
RFCRSetRTCSource()
Sets the source for RTC/LCD/Buzzer/LED on the RFCR. Configure the reader to
use an internal or external source or both an internal and external source, except
for RTC.
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRSetRTCSource(int mode);
Parameters
mode The definition of the mode is given in Contactless Software
Programmers Guide (P/N 26807).
Return Values
=0 Success
<0 Error
RFCRGetRTCSource()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetRTCSource(void);
Return Values
=0 Success, definition of return is given in Contactless Software
Programmers Guide (P/N 26807).
<0 Error
RFCRGetType()
Prototype
int RFCRGetType(void);
Return Values
1 Gen1
2 Gen2
3 Gen3
99 Unknown type
RFCRLedControl()
Prototype
int RFCRLedControl(int led, int mode);
Parameters
led • 0 – LED 0
• 1 – LED 1
• 2 – LED 2
• 1 – LED On
Return Values
=0 Success
<0 Error
RFCRBuzzerControl()
Enables the RFCR buzzer only when the RFCR is in Pass Through mode.
Prototype
int RFCRBuzzerControl(int mode, int beeps);
Parameters
mode • 1 – N short beeps
• Duration (for 2)
Return Values
=0 Success
<0 Error
RFCRGetConfigurableAID()
Reads the configurable AID parameters. The application must send an AID TLV
as the first TLV in the command. The reader then returns all tags associated with
that AID.
Prototype
int RFCRGetConfigurableAID(char* cmdData, int cmdLen, char* rspData,
int rspMax);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetAllAIDs()
Read all AIDs in the RFCR to verify the configured AIDs in the reader.
Prototype
int RFCRGetAllAIDs(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetConfigurableGroup()
Reads the configurable Group EMV parameters. The application must send a
Group tag as the only TLV in the command. The reader then returns all tags
associated with this configurable Group.
Prototype
int RFCRGetConfigurableGroup(char* cmdData, int cmdLen, char* rspData,
int rspMax);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetAllGroups()
Reads all groups in the RFCR to verify all configured groups in the reader.
Prototype
int RFCRGetAllGroups(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRWriteDataCommand()
Stores a ticket on the card. When a valid Write data command is sent to the
RFCR, it attempts to carry out payment at the exit transaction.
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRWriteDataCommand(char* cmdData, int cmdLen, char* rspData,
int rspMax);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are given in the Contactless Software
Programmers Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRSetConfigurableAID()
Creates or selects an AID for configuration or deletion. There are seven TLVs that
can be included in this command; some are mandatory.
Prototype
int RFCRSetConfigurableAID(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in command packet.
Return Values
=0 Success
<0 Error
RFCRSetConfigurableGroup()
Prototype
int RFCRSetConfigurableGroup(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRSDeleteConfigurableAID()
Deletes or disables a configurable AID. The AID TLV of the AID to remove must
be included. Include no other TLVs.
Prototype
int RFCRSDeleteConfigurableAID(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in command packet.
Return Values
=0 Success
<0 Error
RFCRDeleteConfigurableGroup()
Deletes a configurable group. The group can then no longer be used to load the
parameters for a transaction.
Prototype
int RFCRDeleteConfigurableGroup(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRGetBuild()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetBuild(char* verString, int verMax);
Parameters
verString Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
verMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetAllVariables()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetAllVariables(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetProductType()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetProductType(char* proId, int proMax);
Parameters
proId Pointer to store the ACK frame. The number of bytes returned may
vary, but buff should be able to accept the maximum possible size of
the data frame.
proMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetProcessorType()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetProcessorType(char* proId, int proMax);
Parameters
proId Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
proMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetMainFwVersion()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetMainFwVersion(char* fwId, int fwMax);
Parameters
fwId Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
fwMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetFwSubsystemSuite()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetFwSubsystemSuite(char* fwId, int fwMax);
Parameters
fwId Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
fwMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetSerialProtocolSuite()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetSerialProtocolSuite(char* serPro, int serMax);
Parameters
serPro Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
serMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetPayPassVersion()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetPayPassVersion(char* payPas, int payMax);
Parameters
payPas Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
payMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetAntiCollisionResolution()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetAntiCollisionResolution(char* acrVer, int arcMax);
Parameters
acrVer Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
arcMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetCardApplicationSuite()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetCardApplicationSuite(char* appSuite, int appMax);
Parameters
appSuite Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
appMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetUserExperienceSuite()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetCardApplicationSuite(char* usrExp, int usrMax);
Parameters
usrExp Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
usrMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetSystemInformationSuite()
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetSystemInformationSuite(char* sysInfo, int sysMax);
Parameters
sysInfo Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
sysMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetCAPublicKey()
Prototype
int RFCRGetCAPublicKey(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetSerialNumber()
Reads the 14-digit serial number from the RFCR stored in its non-volatile memory.
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetSerialNumber(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but the buff must be able to accept the maximum possible size
of the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRSetSerialNumber()
Stores the 14-digit serial number in the RFCR non-volatile memory. If a serial
number is already set in the reader, this command fails with command-not-
allowed error status.
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRSetSerialNumber(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRFlushTrackData()
Flushes any track data previously read from a card but not yet transferred to the
terminal. The RFCR clears all pending card data.
Prototype
int RFCRFlushTrackData(void);
Return Values
=0 Success
<0 Error
RFCRSetRfErrorReporting()
Enables or disables RF error reporting for the Get Full Track Data command. If
there is any RF error code, it is reported to the terminal through the ACK frame for
the Get Full Track Data command.
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRSetRfErrorReporting(int mode, char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
mode • 0 – Disable RF Error Reporting
• 1 – Enable RF Error Reporting
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetUSBBootLoaderVersion()
Retrieves the ViVOpay USB Boot Loader version from the RFCR.
NOTE
This command is not supported in Gen3 architecture.
Prototype
int RFCRGetUSBBootLoaderVersion(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRStoreLCDMessage()
Stores the LCD message in non-volatile memory of the reader (only English
messages are supported).
Prototype
int RFCRStoreLCDMessage(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRGetLCDMessage()
Sends messages stored in the RFCR EEPROM to the terminal (English only).
Prototype
int RFCRGetLCDMessage(int msgId, char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
msgId Message ID or FF (request all saved messages).
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetAdditionalAIDParams()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRGetAdditionalAIDParams(char* cmdData, int cmdLen, char* rspData,
int rspMax);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetRevocationParam()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRGetRevocationParam(char* cmdData, int cmdLen, char* rspData,
int rspMax);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetAllAdditionalAIDParams()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRGetAllAdditionalAIDParams(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetAllRevocationParams()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRGetAllRevocationParams(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetAllExceptionParams()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRGetAllExceptionParams(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetAdditionalReaderParams()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRGetAdditionalReaderParams(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but the buff must be able to accept the maximum possible size
of the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetVFIVersion()
Retrieves the software release version or the list of software components and
version numbers.
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRGetVFIVersion(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetTypeApprovalVersions()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRGetTypeApprovalVersions(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRSetExistAdditionalAIDParams()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRSetExistAdditionalAIDParams(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRSetNewAdditionalAIDParams()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRSetNewAdditionalAIDParams(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRDeleteAdditionalAIDParams()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRDeleteAdditionalAIDParams(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRSetExistRevocationParam()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRSetExistRevocationParam(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRSetNewRevocationParam()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRSetNewRevocationParam(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRDeleteRevocationParam()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRDeleteRevocationParam(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRSetNewExceptionParam()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRSetNewExceptionParam(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRDeleteExceptionParam()
Deletes an Exception PAN from the Exception PANs list stored in the RFCR.
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRDeleteExceptionParam(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRSetAdditionalReaderParam()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRSetAdditionalReaderParam(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRRestoreDefaultConfig()
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRRestoreDefaultConfig(char* cmdData, int cmdLen);
Parameters
cmdData Pointer to the data field in the command packet. The format and
contents of the data field are in the Contactless Software Programmers
Guide (P/N 26807).
cmdLen Length of the data field in the command packet.
Return Values
=0 Success
<0 Error
RFCRGetFwFullVersion()
Returns a string containing version information for each software module for
individual card types.
NOTE
This command is not supported in ViVOpay Gen1 and Gen2 architecture.
Prototype
int RFCRGetFwFullVersion(char* rspData, int rspMax);
Parameters
rspData Pointer to store the ACK frame. The number of bytes returned may
vary, but buff must be able to accept the maximum possible size of
the data frame.
rspMax Maximum size of buff.
Return Values
>0 Success with the number of bytes read
<0 Error
RFCRGetBaudRate()
Prototype
int RFCRGetBaudRate(void);
Return Values
>0 Success, readers baud rate: 9600, 19200, 38400, 57600, 115200
<0 Error
RFCRChangeBaudRate()
Prototype
int RFCRChangeBaudRate(int iBaud);
Parameters
iBaud Baud rate: 9600, 19200, 38400, 57600, 115200
Return Values
>0 Success and the device handle is returned.
<0 Error
RFCR Return Along with the generic error returns in errno.h, specific RFCR error returns are
Values listed below (most are from the RFCRUpdateFW() call).
Error Value
No File -401
Bad File -402
Enter ISP Error -403
Autobaud Error -404
Frequency Error -405
Erase Error -406
Receive Timeout -407
File Read Error -408
Big Record Error -409
Burn Error -410
Cleanup Error -411
Invalid Data Frame -420
Invalid Card Payload -422
Buffer Too Small -430
RFCR Protocol The following table describes compatibility with contactless protocol APIs
Compatibility implemented in different contactless modules based on ViVOpay (GEN1, GEN2)
Table and Verifone (GEN3) architecture.
Table 11 Protocol Compatibility
RFCR Function Call ALL GEN1 GEN2 GEN3
RFCRlibVersion() X
RFCRInit() X
RFCRClose() X
RFCRGetVersion() X
RFCRPing() X
RFCRReset() X
RFCRSetAntenna() X
RFCRSetIndicator() X
RFCRGetCardPayload() X
RFCRParseCardPayload() X
RFCRUpdateFW() X
RFCRPurge() X
RFCRInputPending() X
RFCRRawWrite() X
RFCRRawRead() X
RFCRAddCRC() X
RFCRCheckCRC() X
RFCRReceiveACKFrame() X
RFCRReceiveDataFrame() X
PCI 4 Support
NOTE
See Appendix F for details about the VX 520 and UX300 Sysmode Application.
Device For application development, connect the UX100 or UX110 PINpad to the UX300
Configuration through the main USB port, located on the terminal base (Figure 15).
for Development For UX300 console access, connect through the serial port to a PC.
TYPE A
USB PORT
USB PORT
UX300 UX100
Anti-Removal The UX300 card reader and UX100 and UX110 PINpads have two anti-removal
Switches (ASRs) switches. When the ASRs are triggered and the device is not installed, PIN entry
is rejected and applications will not start automatically at device boot-up. When all
four ASRs are pressed (UX300 and connected UX1XX PINPad), Sysmode
provides an opportunity to reset the ASR state. When ASR trigger status displays
before the Sysmode login prompt, press <OK> to reset the ASRs.
You will have to enter your ASR password. If you don’t have your ASR password,
reset the password to the default:
1 Press the Sysmode button on the terminal.
2 Log in to Sysmode as supervisor.
3 Select Security > Password Mgr > Expire > Switch Passwords.
4 Restart Sysmode and reset the ARS using the following predefined default
passwords:
• 4275386
• 2615948
5 Enter a new password at the prompt.
errno
No. Function Status Explanation
errno Table code
1 OK 0
2 Bad parameter EINVAL
3 Code Error EPERM
4 Keyboard Key disabled EACCES
5 Key not present ENODATA Key missing for
authentication,
PIN, and so on.
6 Key verification NOK EFAULT Key type incorrect.
7 Other key issue ENOTBLK
8 Function parameter missing EINVAL
9 Key bad MAC check ETXTBSY
10 Bad data format, or PIN format ENOEXEC
11 Challenging error EXDEV
12 Required key missing EBADF
13 Key press timeout ETIME
14 PIN timeout ETIME
15 No PIN mode for PIN session error; Invalid EBADRQC
request code for PIN delete
16 Error code for the COR key in PIN mode EINVAL
17 PIN length definition error EINVAL
18 Invalid key press for PIN EINVAL
19 Unit is busy EBUSY
20 Keyboard initialization failure EIO
21 Keyboard parameter error EIO
22 General error EPERM
23 Unknown error EIO
Power As detailed in Chapter 6, Standby and Suspend power management modes are
Management available on all V/OS devices. Shutdown mode is also available on the UX300.
The Power Management Service provides an API to control power management.
Power management is disabled by default; applications must control it. Refer to
Power Management for functions to force the system into standby or suspend
mode.
Use the APM service to allow the application to stop the system from entering
Suspend mode during critical operations such as PIN entry or host transactions.
Use the powermngt_declare_state() function to declare the current state of
application. Application must change the state to IDLE once it is no longer busy.
For example:
ret = powermngt_declare_state(getpid(), BUSY_FULL);
ret = powermngt_declare_state(getpid(), BUSY_BACKGROUND);
ret = powermngt_declare_state(getpid(), IDLE);
This section contains information specific to the UX100 PINpad with display, and
UX110 PINpad without display.
For these terminals, this information supersedes that in the main body of this
document. Topics include:
• Firmware Overview
• Sysmode
• Password Management
• Terminal Updates
• Display Functions
• Buzzer Functions
• PIN Entry Functions
• Info Functions
• Security Functions
• Manufacturer Functions
• Performing a Card Reader Reset
• Multi Drop Bus
• Remote Printer
Firmware The UX 100 firmware is made of device drivers. Each device driver calls a device
Overview task to process time-consuming commands and allow simultaneous device
command processing. Quick commands are directly processed by the device
driver without using tasks. For example, the secure device uses secure tasks to
process RSA computations, but it answers directly to a version information
request. The following are the device drivers:
• The Main task waits for incoming command requests and dispatches them to
the destination device or returns an error if the destination device is cannot be
accessed. The Main task also handles the buzzer, cell coin, and temperature
sensor.
• The Keyboard task handles the UX PINpad.
• The Display task handles the LCD display.
• The Security tasks run as separate tasks in parallel time-consuming
processes such as RSA computations, PIN entry, and so on.
DISPLAY
STOP KEY
CORR KEY
OK KEY
ARROW KEYS
UX 110 Connect the UX110 to a UX300 to access Sysmode using the ncurses library.
Connections are either USB, standard serial or Ethernet. See also, VX 520 and
UX300 Sysmode Application.
To configure the UX300, you must first create a sys4 user configuration file. File
content depends on the desired connection, as described in the following
sections. Create the file using a user config secins download file.
NOTE
The file must be created for the sys4 user, and signed with the OS signer. See
Secure Installer.
NOTE
Ensure that you are using the latest USB Serial gadget driver for Windows,
included in the WinSDK package.
6 Ensure that the assigned COM port in Windows Device Manager is assigned
dynamically.
7 Boot the UX300.
NOTE
This configuration is ignored when using a USB-to-Serial converter.
5 Connect to over the Serial port using PuTty or TTY other client.
NOTE
This configuration is ignored when using a USB-to-Serial converter.
NOTE
This configuration is ignored when using a USB-to-Serial converter.
You are prompted to set passwords when the device first boots. Use the keypad
and press OK to set the new password. Each password has an expiration set at
manufacture. Save the password in a secure location.
Security Policy File This file contains the user access definitions:
• level1 has access to the ARS menu and can change ASR passwords.
• level2 (usually the customer’s supervisor user) has level1 access, plus access
to the Expire Switch Password menu to reset ASR passwords to their default
value.
• maintenance only has access the Information menu, Diagnostic menu, and
Configuration/Status menu.
Reset Passwords Use the following procedure to reset the USER password.
Use the arrow keys to navigate through the Sysmode menus. Press OK after
making each selection.
1 Select Login > user.
2 Enter the current password for the selected user.
The switch password is reset. Use the arrow key to select No and cancel the
password reset.
NOTE
The terminal may reboot during installation. If the upload fails, reinstall the update
package on another terminal and connect the UX100 terminal that failed.
3 Log in as supervisor, and select Pinpad > Software and scroll to verify the
current version.
The last entry is the current build, which should correspond to the package
chosen in Step 1.
Display This section presents the APIs to drive the display using svc_ux100.
Functions
ux100_dispGetInfo()
Prototype
struct ux100DisplayInfoStruct ux100_dispGetInfo(void);
Return Values
0= ux100KeybdInfoStruct is filled.
Example
struct ux100DisplayInfoStruct {
Int currentBacklightMode, // curent backlight setting of the display
Int currentBklTime, // current backlight timer in ms
Int currentContrast, // current contrast of the display
Int MaxBacklight, // maximum backlight setting for the display
Int MaxContrast, // maximum contast setting for the display
Int MinBacklight, // minimum backlight setting for the display
Int MinContrast, // minumim contrast setting for the display
Int ScreenHeight, // Heigth of the screen in pixels
Int ScreenWidth, // Width of the screen in pixels
Int ScreenColorDepth //Depth of the screen color if any
}
ux100_dispSetContrast()
Prototype
int ux100_dispSetContrast(int level);
Parameters
level The level of contrast.
Return Values
0= Success.
ux100_dispSetBacklightMode()
Prototype
int ux100_dispSetBacklightMode(int mode, unsigned int time);
Parameters
mode Sets the backlight mode:
• 0 = OFF mode
• 1 = ON mode
• 2 = AUTOMATIC mode
Return Values
0= Success.
Buzzer This section presents the APIs for the buzzer interface using the PINpad service
Functions svc_ux100.
ux100_buzzerSetBeep()
Activates the buzzer for the specified time, at a specific frequency and volume.
NOTE
Do not call this function during the PIN entry.
Prototype
int ux100_buzzerSetBeep(unsigned int frequency, unsigned int time,
unsigned int volume);
Parameters
frequency Sets the buzzer frequency in Hz.
time Time in milliseconds that the buzzer is on.
volume Sets the buzzer volume. Valid values are 0–10.
0 = no buzzer.
Note: This parameter is not used on the UX100.
Return Values
0= Success.
ux100_buzzerGetInfo()
Prototype
struct ux100BuzzerInfoStruct ux100_buzzerGetInfo(void);
Return Values
0= The ux100BuzzerInfoStruct is filled.
Example
struct ux100BuzzerInfoStruct {
unsigned int currentFrequency, // current frequency of the buzzer
unsigned int currentTime, // current time (duration) of the buzzer
unsigned int currentVolume, // current volume of the buzzer
}
ux100_buzzerSetKeyboardBeep()
NOTE
Do not call this function during the PIN entry.
Prototype
int ux100_buzzerSetKeyboardBeep(unsigned int frequency, unsigned int time,
unsigned int volume);
Parameters
frequency Sets the buzzer frequency in Hz.
time Time in milliseconds that the buzzer is on.
volume Sets the buzzer volume. Valid values are 0–10.
0 = no buzzer.
Note: This parameter is not used on the UX100.
Return Values
0= Success.
ux100_buzzerGetKeyboardBeepInfo()
Returns the defined frequency, volume, and duration settings for the beep on a
key press.
Prototype
struct ux100BuzzerInfoStruct ux100_buzzerGetKeyboardBeepInfo(void);
Parameters
frequency Sets the buzzer frequency in Hz.
time Time in milliseconds that the buzzer is on.
volume Sets the buzzer volume. Valid values are 0–10.
0 = no buzzer.
Note: This parameter is not used on the UX100.
Return Values
0= The ux100BuzzerInfoStruct is filled, as shown in the following example.
Example
struct ux100BuzzerInfoStruct {
unsigned int currentFrequency, current frequency in Hertz.
unsigned int currentTime, Time in milliseconds. 0 means no sound
unsigned int currentVolume, Volume. Range from 0 to 10.
}
PIN Entry This section presents the PIN management APIs that interface with the PINpad
Functions service svc_ux100.
NOTE
It is recommended to use the ADK tools to set up PIN entry.
errno Values
Table 12 lists the errno values returned in the PIN management APIs:
Table 12 PIN Entry errno Descriptions
Code Description
EINVAL PIN error.
ETIME Timeout.
ENODATA PIN encryption key error
EIO PIN length error
EPERM Key press was ignored. See ux100_pinDelete().
ux100_pinStartPinEntry()
Starts the PIN entry process and enables PIN entry mode. This function checks
that the minimum and the maximum PIN length(4 and 12, respectively) for the PIN
entry is PCI compliant. It also sets the timeout for PIN entry. The maximum
timeout allowed is 5 minutes. Timeout settings longer that 5 minutes are forced to
meet this maximum. You can have only one open PIN session. An error returns if
the PINpad is already in PIN entry mode. The PINpad must be in Field mode to
allow PIN entry.
Prototype
int ux100_pinstartpinentry(unsigned char pinLenMin,
unsigned char pinLenMax, int timeout);
Parameters
pinLenMin Sets the minimum number of digits allowed for a PIN entry.
pinLenMax Sets the maximum number of digits allowed for a PIN entry.
timeout PIN entry session timeout in milliseconds.
Return Values
0= Success.
ux100_pinGetNbCurrDigitEntered()
Prototype
int ux100_pinGetNbCurrDigitEntered(void);
Return Values
0= Returns the number of the PIN digits entered.
ux100_pinDelete()
Deletes the last PIN digits entered or all in the buffer. PIN digit deletion is handled
by the GUI. Until the PINpad receives this call, key presses are ignored. As soon
as the CORRECTION key is pressed, the PINpad no longer expects to receive
any ux100_keybdGetKey() until it receives ux100_pinDelete(). If the PINpad
receives a ux100_keybdGetKey() during this time, errno is immediately set to
EBADRQC, and the key pressed is discarded from the PIN buffer.
Prototype
int ux100_pinDelete(int nbDigit);
Parameters
nbDigit Sets the PIN digits to delete:
• 0 = delete all entered PIN digits
• 1 = delete the last digit entered
Return Values
0= Success.
ux100_pinAbort()
Stops the current PIN entry process. When this call is sent, the PED erases the
PIN buffer and resets the keyboard to non PIN entry mode. If a PIN is stopped, by
the time the PINpad handles the request, it is possible that a false key is in the
key’s FIFO. To avoid this, call ux100_keybdFlush().
Prototype
int ux100_pinAbort(void);
Return Values
0= Success.
ux100_pinSendEncPinBlockToVault()
Sends the PIN to the vault. On a VAL key press, this function has an approximate
30-second timeout to get the PIN block. It always returns the VAL key value, but
also generates the PIN block only when the PIN length is within the PIN digit
length limit. The VAL and COR keys are used for PIN bypass. When one of these
keys is pressed and the PIN buffer is empty, the firmware returns a PIN bypass
code.
Prototype
int ux100_pinSendEncPinBlockToVault(struct ux100PinBlockStruct
pinBlockSt);
Parameters
struct ux100PinBlockStruct
{ void* data; // Pin block data.
int data_count; // Number of bytes in data.
};
Return Values
0= Success.
ux100_pinEntrymode()
Prototype
int ux100_pinEntrymode(void);
Return Values
0= The PINpad is in non PIN mode.
Info Functions This section presents the functions to drive the display using svc_ux100.
ux100_getVersion()
Prototype
struct version int ux100_getVersion(void);
Return Values
0= The version structure is filled, as shown in the following example.
XML Structure
struct version {
int major;
int minor;
int maint;
char build[16];
};
ux100_infoGetDeviceList()
Prototype
int ux100_infoGetDeviceList(void);
Return Values
0= n = The bit field value, as shown in the following example.
Example
typedef enum
{
UX100_MASK_NONE = 0,
UX100_MASK_MAIN = 1 << 0, /**<Main secure target ID */
UX100_MASK_KYBD = 1 << 1, /**< keyboard functions in the target*/
UX100_MASK_SEC = 1 << 2, /**< Security functions present in the target */
UX100_MASK_DISP = 1 << 3, /**< display functions in the target*/
UX100_MASK_SWITCH = 1 << 4, /**< switch functions in the target*/
UX100_MASK_ALL = 0xFFFFFFFF,
} UX100_DEVICE_ID;
ux100_infoGetSecureVersion()
Prototype
struct ux100SecureVersionStruct ux100_infoGetSecureVersion(void);
Return Values
0= The ux100SecureVersionStruct is filled, as shown in the following example.
XML Structure
struct ux100SecureVersionStruct
{
char id_code[50]; /** Software package name */
char family[10]; /** PCI or equivalent certification ID */
char version[12]; /** version */
};
ux100_infoGetPartNumber()
Prototype
struct ux100PartNumberStruct ux100_infoGetPartNumber(void);
Return Values
0= The ux100PartNumberStruct is filled, as shown in the following example.
XML Structure
struct ux100PartNumberStruct
{
char part_number[32+1]; // ux100 part number
};
ux100_infoGetSerialNumber()
Prototype
struct ux100SNStruct ux100_infoGetSerialNumber(void);
Return Values
0= The ux100SNStruct is filled, as shown in the following example.
XML Structure
struct ux100SerialNumberStruct
{
char serial_number[11+1]; // ux100 serial number
};
ux100_infoGetHardwareVersion()
Prototype
struct ux100HardVerStruct ux100_infoGetHardwareVersion(void);
Return Values
0= The ux10HardVerStruct is filled, as shown in the following example.
XML Structure
struct ux10HardVerStruct
{
char hardware_version[15+1]; // ux100 hardware version.
};
ux100_infoGetPCIHardwareVersion()
Prototype
struct ux100PCIHardVerStruct ux100_infoGetPCIHardwareVersion(void);
Return Values
0= The ux10PCIHardVerStruct is filled, as shown in the following example.
XML Structure
struct ux10PCIHardVerStruct
{
char pci_hardware_version[4+1]; // ux100 PCI hardware version.
};
ux100_infoGetModelNumber()
Prototype
struct ux100ModelNumberStruct ux100_infoGetModelNumber(void);
Return Values
0= The ux100ModelNumberStruct is filled, as shown in the following example.
XML Structure
struct ux100ModelNumberStruct
{
char model_number[12+1]; // ux100 model number
};
ux100_infoGetCountryName()
Prototype
struct ux100CountryNameStruct ux100_infoGetCountryName(void);
Return Values
0= The ux100CountryNameStruct is filled, as show in the following example.
XML Structure
struct ux100CountryNameStruct
{
char country_name [12+1]; //ux100 Country name
};
ux100_infoGetPairingStatus()
Returns the pairing status between the PINpad and the terminal.
Prototype
int ux100_infoGetPairingStatus(void);
Return Values
0= n = The status of the pairing:
• 0 = The pairing is done and status is OK.
• 1 = The pairing failed due to missing keys in the PINpad.
• 2 = The pairing failed due to missing keys in the terminal.
• 3 = The pairing failed due to bad certificate in the PINpad.
• 4 = The pairing failed due to bad certificate in the terminal.
ux100_infoGetRemSwStatus()
Prototype
int ux100_infoGetRemSwStatus(void);
Return Values
0= n = The status of the ARS:
• 0 = The state of the ARS is armed.
• 1 = The state of the ARS is triggered.
ux100_infoGetTamperStatus()
Prototype
int ux100_infoGetTamperStatus(void);
Return Values
0= n = The tamper status:
• 0 = The status of the PINpad is OK.
• 1 = The PINpad has been tampered with.
ux100_infoGetCoinChargingStatus()
Prototype
int ux100_infoGetCoinChargingStatus(void);
Return Values
0= n = The status of the coin battery:
• 1 = The charge status of the coin battery is good.
• 0 = The charge status of the coin battery is bad.
ux100_infoGetSensorTemperature()
Prototype
int ux100_infoGetSensorTemperature(void);
Return Values
0= n = The temperature of the sensor from -40°C to +125°C. The accuracy of the
measure is 1 °C.
ux100_infoGetLogEvents()
Prototype
struct ux100LogEventsStruct ux100_infoGetLogEvents(void);
Return Values
0= The ux100LogEventsStruct contains the log, as shown in the following
example.
The application must free output structure data member when non-NULL. The
function stores each event record in following format:
[DD-MM-YYYY HH:MM] EVT:<event name> STATUS:xxh DATA:<event data>LF
where,
• <event name> – The human readable event identifier.
• xxh – The event status code in hex format (zero, if not applicable).
• <event data> – Additional event information (can be empty).
• LF – A line feed (0x0A).
Example
struct ux100LogEventEventsStruct
{
void* data; // Log data in txt format.
int data_count; // Size of the data (in bytes).
};
ux100_infoSetIdCard()
Prototype
int ux100_infoSetIdCard(struct uxIdCard idcard);
Parameters
Structure with the following format:
ux100IdCardStruct
{
unsigned long int device_mode; device mode
char part_number[32 + 1]; part number, max 33 bytes null-terminated string
char serial_number [11 + 1]; serial number, max 12 bytes null-terminated
string
char hardware_version[15 + 1]; hardware version, max 16 bytes null-
terminated string
char pci_hardware_version[4 + 1]; PCI hardware version, max 5 bytes null-
terminated string
char model_number[12 + 1]; model number, max 13 bytes null-terminated
string
char country_name [12 + 1]; country name, max 13 bytes null-terminated
string
char permanent_terminal_id[10 + 1]; permanent terminal ID, max 11 bytes
null-terminated string
};
Return Values
0= Success.
ux100_infoGetConnectionStatus()
Prototype
int ux100_infoGetConnectionStatus(unsigned int timeout);
Parameters
timeout Time to wait for the PINpad to be ready.
0 = wait forever.
Return Values
0= Success. The PINpad is connected.
ux100_infoGetDeviceMode()
Prototype
int ux100_infoGetDeviceMode(void);
Return Values
0= Success. n = the device mode:
• 0 = This PINpad is in manufacture mode.
• 1 = The PINpad is in production mode.
• 8 = The PINpad is in development mode.
ux100_infoGetOperationalMode()
Prototype
int ux100_infoGetOperationalMode(void);
Return Values
0= Success. n = PINpad operational mode:
• 0 = Field mode
• 1 = Production mode #1
• 2 = Production mode #2
• 3 = Restricted mode
• 4 = Controller Personalization mode
ux100_infoGetPermanentTerminalID()
Prototype
struct ux100PermanentTerminalIDStruct
ux100_infoGetPermanentTerminalID(void);
Return Values
0= The ux100PermanentTerminalIDStruct is filled, as shown in the following
example.
XML Structure
struct ux100PermanentTerminalIDStruct
{
char permanent_terminal_id[10 + 1]; /**< ux100 Permanent Terminal ID */
};
ux100_infoGetUnitType()
Prototype
int ux100_infoGetUnitType(void);
Return Values
0= Unknown PINpad model type.
ux100_infoResetLogHeader()
NOTE
All stored events are lost.
Prototype
int ux100_infoResetLogHeader(void);
Return Values
0= Success. The log header was deleted.
ux100_infoSetLogEvent()
Prototype
int ux100_infoSetLogEvent(char* event, int size);
Parameters
event Data to store in the PINpad event log.
size Size of data to store.
Return Values
0= Success. The new event is stored in the PINpad event log.
ux100_infoGetAtmelSerialNumber()
Prototype
struct ux100AtmelSerialNumber ux100_infoGetAtmelSerialNumber(void);
Return Values
0= the ux100AtmelSerialNumber structure contains the Atmel S/N, as shown in
the following example
XML Structure
struct ux100AtmelSerialNumber
{
char atmel_sn [UX100_ATMEL_SERIAL_NUMBER_MAX_LEN + 1]; // ux100 Atmel SN
};
ux100_infoSetRTC()
Sets the PINpad RTC value from a given timestamp. The timestamp must be
converted to an ASCII string in YYYY-MM-DD HH:MM:SS format.
Prototype
int ux100_infoSetRTC(char* s);
Parameters
s Timestamp string to send to the PINpad RTC.
Return Values
0= Success.
ux100_infoGetRTC()
Prototype
struct ux100DateTime ux100_infoGetRTC(void);
Return Values
0= Success. The ux100DateTime structure contains the actual RTC value, as
shown in the following example.
XML Structure
struct ux100DateTime
{
char rtc [UX100_DATE_TIME_MAX_LEN + 1]; // ux100 RTC value
};
ux100_infoGetHeaterMode()
Prototype
struct ux100_infoGetHeaterMode(void);
ux100_infoGetHeaterStatus()
UX100 only: Retrieves the heater hardware status. Heater ON/OFF is controlled
in hardware only. For UX110: Always returns 0 (not supported).
Prototype
struct ux100_infoGetHeaterStatus(void);
Return Values
1= (heater on) Indicates that the LCD is being heated by the heater hardware.
ux100_infoGetBootVersion()
Prototype
struct ux100BootVersion ux100_infoGetBootVersion(void);
Return Values
0= ux10BootVersion structure is filled.
XML Structure
struct ux100BootVersion
ux100_infoGetDiagCounter()
Prototype
struct ux100DiagCounter ux100_infoGetDiagCounter(int index);
Parameters
index Index of the diagnostic counter to retrieve.
Return Values
0= The ux100DiagCounter structure is filled.
XML Structure
struct ux100DiagCounter
{
char text[17]; // Max of 16 chars + 1 null
unsigned int flags;
int value;
int index;
};
ux100_infoSetDiagCounter()
Prototype
struct ux100DiagCounter infoSetDiagCounter(int index, int value);
Parameters
index Index of the diagnostic counter to retrieve.
value New value of the diagnostic counter in index.
Return Values
0= The ux100DiagCounter structure is filled.
XML Structure
struct ux100DiagCounter
{
char text[17]; // Max of 16 chars + 1 null
unsigned int flags;
int value;
int index;
};
ux100_secGenerateRandom()
Prototype
Struct ux100ByteBuffer ux100_secGenerateRandom(int size);
Parameters
size Indicates the size in bytes of the random number.
Return Values
0= Success. The number is returned in the ux100ByteBuffer structure, as shown in
the following example.
XML Structure
struct ux100ByteBuffer
{
void* data;
int data_count;
};
ux100_secSetSecureDate()
Prototype
int ux100_secSetSecureDate(unsigned int date);
Parameters
date BDC coded date (yyyymmdd).
Return Values
0= Success.
ux100_secLoadCertificate()
Prototype
int ux100_secLoadCertificate(int type,
struct ux100ByteBuffer certificateSt);
Parameters
type Type of certificate.
Return Values
0= Success. The certificate type is in struct ux100ByteBuffer, as shown in the
following example.
XML Structure
struct ux100ByteBuffer
{
void* data; // pointer on the data of the certificate
int data_count; // size in byte of the data
};
ux100_secLoadPublicKey()
Prototype
int ux100_secLoadPublicKey(in type, struct ux100ByteBuffer publicKeySt);
Parameters
type Type of public key into struct ux100ByteBuffer, as shown in the following
example.
Return Values
0= Success. The certificate type is in struct ux100ByteBuffer, as shown in the
following example.
XML Structure
struct ux100ByteBuffer
{
void* data; // pointer on the data of the public key
int data_count; // size in byte of the data
};
ux100_secReadPublicKey()
Prototype
struct ux100ByteBuffer ux100_secReadPublicKey(int type);
Parameters
type Type of public key.
Return Values
0= Success. The public key is in struct ux100ByteBuffer, as shown in the following
example.
XML Structure
struct ux100ByteBuffer
{
void* data; // pointer on the data of the public key
int data_count; // size in byte of the data
};
ux100_secReadCertificate()
Prototype
struct ux100ByteBuffer ux100_secReadCertificate(int type);
Parameters
type Type of certificate.
Return Values
0= Success. The certificate is in struct ux100ByteBuffer, as shown in the following
example.
XML Structure
struct ux100ByteBuffer
{
void* data; // pointer on the data of the certificate
int data_count; // size in byte of the data
};
ux100_secGetKeyList()
Prototype
struct ux100KeyList ux100_secGetKeyList(void);
Return Values
0= Success. The keys are in struct ux100KeyList, as shown in the following
example
XML Structure
struct ux100KeyList
{
void* data; // pointer on the keys data. Structure to be defined.
int data_count; // size in byte of the data
};
ux100_secGetCurrSECIRQ()
Prototype
int ux100_secGetCurrSECIRQ(void);
Return Values
0= Success. SECIRQ value meanings are coded (for example, 0xAABBxxDD):
• AA ORed values:
• 0x01: MESH: Problem with the grid mesh
• 0x02: SWITCH: Problem with the switch
• BB ORed values:
• 0x08: VBACKUPSML: Low voltage in VBACKUP pin.
• 0x10: VBACKUPSMH: High voltage in VBACKUP pin.
• DD value:
• 0x04: CRC: Bad CRC in user key registers.
ux100_secGetSavedSECIRQ()
Reads the value of the security register on the last SECIRQ or when any attack
lost keys.
Prototype
int ux100_secGetSavedSECIRQ(void);
Return Values
0= Success. SECIRQ value meanings are coded (for example, 0xAABBxxDD):
• AA ORed values:
• 0x01: MESH: Problem with the grid mesh
• 0x02: SWITCH: Problem with the switch
• BB ORed values:
• 0x08: VBACKUPSML: Low voltage in VBACKUP pin.
• 0x10: VBACKUPSMH: High voltage in VBACKUP pin.
• DD value:
• 0x04: CRC: Bad CRC in user key registers.
ux100_secGetCurrentUKSR()
Prototype
int ux100_secGetCurrentUKSR(void);
Parameters
exponent The public key exponent.
size The key size in bytes.
forceRenewal Forces mutual authentication regardless of the key’s existence.
Return Values
0= Success. UKSR value meanings are coded (for example, 0xAABBCCDD):
• AA ORed values:
• 0x01: MESH – Problem with the grid mesh.
• 0x02: SWITCH – Problem with the switch.
• 0x04: TAMPER – Tamper attack on the chip (for example, a shield attack).
• BB ORed values:
• 0x01: CK32LFM – 32KHz, low frequency detected.
• 0x02: TSL – Low temperature detected.
• 0x04: TSH – High temperature detected.
• 0x08: VBACKUPSML – Low voltage in VBACKUP pin.
• 0x10: VBACKUPSMH – High voltage in VBACKUP pin.
• CC value:
• Test and JTAG pins.
• DD value:
• 0x01 – NCLEAR (usually set to 1) No key erase since the last load a User
Key register.
• 0x02 – SOFT: User key register erased by software.
• 0x04 – CRC: User key register erased by software.
• 0x08 – VBACKUPRST: User key register erased to a reset on VBACKUP
pin.
ux100_secGetSavedUKSR()
Reads the value of the security register the last time a UKSR arrived or any attack
that lost the keys.
Prototype
int ux100_secGetSavedUKSR(void);
Return Values
0= Success. UKSR value meanings are coded (for example, 0xAABBCCDD):
• AA ORed values:
• 0x01: MESH – Problem with the grid mesh.
• 0x02: SWITCH – Problem with the switch.
• 0x04: TAMPER – Tamper attack on the chip (for example, a shield attack).
• BB ORed values:
• 0x01: CK32LFM – 32KHz, low frequency detected.
• 0x02: TSL – Low temperature detected.
• 0x04: TSH – High temperature detected.
• 0x08: VBACKUPSML – Low voltage in VBACKUP pin.
• 0x10: VBACKUPSMH – High voltage in VBACKUP pin.
• CC value:
• Test and JTAG pins.
• DD value:
• 0x01 – NCLEAR (usually set to 1) No key erase since the last load a User
Key register.
• 0x02 – SOFT: User key register erased by software.
• 0x04 – CRC: User key register erased by software.
• 0x08 – VBACKUPRST: User key register erased to a reset on VBACKUP
pin.
ux100_secTamperNumEntHandl()
Prototype
int ux100_secTamperNumEntHandl(int function);
Parameters
function Function type:
• 0x00 – Deactivate numeric entry in tamper mode.
• 0x01 – Activate numeric entry in tamper mode.
• 0x02 – Get status of numeric entry in tamper mode.
Return Values
-1= An error occurred. Check the errno value.
Manufacturer This section presents the APIs that drive user tests using svc_ux100.
Functions
ux100_mfgRemovalSwitchReset()
Prototype
int ux100_mfgRemovalSwitchReset(void);
Return Values
0= Success.
ux100_mfgClearTamper()
Prototype
int ux100_mfgClearTamper(void);
Return Values
0= Success.
Performing a The UX300 card reader and UX100 and UX110 PINpads are updated using a
Card Reader USB thumb drive with a FAT partition. If you need to update the card reader, ask
Reset your Verifone representative for the Updating a UX300/UX100 Device over USB
Manual.
Multi Drop Bus This section presents information on the UX Multi Drop Bus (MDB) service for
vending machines, including XML commands and structures, #defines, and APIs.
NOTE
Reference the svc_mdb.h header file to supplement the information in this
chapter.
MDB Functions This section contains the MDB APIs, XML structs, and return format for the MDB
service.
mdb_setupDevices()
C Prototype
int mdb_setupDevices(void);
Parameters
optFeatures Optional feature bits (can be ORed):
• MDB_OPTFEAT_FTL – The supported file transport layer
• MDB_OPTFEAT_32BIT – 32-bit monetary format
• MDB_OPTFEAT_MULTICUR – Multi currency/multi lingual
• MDB_OPTFEAT_DATAENTRY – Data entry.
• MDB_OPTFEAT_NEGVEND – Negative vend.
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<setupDevices/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<setupDevices>
<return>int</return>
</setupDevices>
</mdb>
</svc_rtn>
mdb_closeDevices()
Releases all MDB device resources in V/OS (in standby MCU and UART).
C Prototype
int mdb_closeDevices(void);
Return Values
0= Success
XML Command
<svc_cmd>
<mdb>
<closeDevices/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<closeDevices>
<return>int</return>
</closeDevices>
</mdb>
</svc_rtn>
mdb_receive()
Receives the next available MDB command from the MDB buffer.
C Prototype
struct MdbCommand * mdb_receive(void);
Return Values
Returns the mdb_command struct when data is available. Returns NULL if the
receive buffer is empty.
XML Command
<svc_cmd>
<mdb>
<receive/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<receive>
<return type="list">
<item type="container">
<cmd type="list">
<item>unsigned char</item>
<!-- ... const list <item> count of [36] -->
</cmd>
<len>unsigned int</len>
</item>
</return>
</receive>
</mdb>
</svc_rtn>
mdb_peek()
Peeks at the next available MDB command from the MDB buffer without
advancing the mdb buffer pointer to the next available command.
C Prototype
struct MdbCommand * mdb_peek(void);
Return Values
Returns the mdb_command struct when data is available, Returns NULL if the
receive buffer is empty.
XML Command
<svc_cmd>
<mdb>
<peek/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<peek>
<return type="list">
<item type="container">
<cmd type="list">
<item>unsigned char</item>
<!-- ... const list <item> count of [36] -->
</cmd>
<len>unsigned int</len>
</item>
</return>
</peek>
</mdb>
</svc_rtn>
mdb_advance_buffer_tail()
Advances the mdb_buffer pointer to the next available command. Call this
function to skip to the next available command, for example, after calling
mdb_peek which does not advance the buffer pointer.
C Prototype
void mdb_advance_buffer_tail(void);
XML Command
<svc_cmd>
<mdb>
<advance_buffer_tail/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<advance_buffer_tail>
<return/>
</advance_buffer_tail>
</mdb>
</svc_rtn>
mdb_getVersion()
C Prototype
struct version mdb_getVersion(void)’
Return Values
The version of the struct as defined in svcmgrSvcDef.h.
XML Command
<svc_cmd>
<mdb>
<getVersion/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<getVersion>
<return type="container">
<major>int</major>
<minor>int</minor>
<maint>int</maint>
<build type="string">string [max len 16]</build>
</return>
</getVersion>
</mdb>
</svc_rtn>
mdb_getConfig()
Obtains the current MDB configuration from the standby MCU. The configuration
is permanently stored in the standby MCU and does not need to be set after a
power fail.
C Prototype
struct MdbConfig * mdb_getConfig(void);
Return Values
0= Success
XML Command
<svc_cmd>
<mdb>
<getConfig/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<getConfig>
<return type="list">
<item type="container">
<MdbOn>int</MdbOn>
<AutoACK>int</AutoACK>
<AutoSetup>int</AutoSetup>
<AutoReset>int</AutoReset>
</item>
</return>
</getConfig>
</mdb>
</svc_rtn>
mdb_setConfig()
Sets the new MDB configuration in the standby MCU. The configuration is
permanently stored in the standby MCU and does not need to be set after a power
fail.
C Prototype
int mdb_setConfig(struct MdbConfig config /*0*/);
Return Values
0= Polling is active.
1= Polling is inactive.
XML Command
<svc_cmd>
<mdb>
<setConfig>
<config type="container">
<MdbOn>int [default:0]</MdbOn>
<AutoACK>int [default:0]</AutoACK>
<AutoSetup>int [default:0]</AutoSetup>
<AutoReset>int [default:0]</AutoReset>
</config>
</setConfig>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<setConfig>
<return>int</return>
</setConfig>
</mdb>
</svc_rtn>
mdb_setBusTimings()
Sets the timing parameters (in milliseconds) for the MDB link.
C Prototype
int mdb_setBusTimings(int block_time /*0*/, int interbyte_time /*0*/);
Parameters
block_time The maximum time allowed between a command and the first
byte of the response message.
interbyte_time The maximum time allowed betwenn two consecutive bytes
within one command or reply message.
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<setBusTimings>
<block_time>int [default:0]</block_time>
<interbyte_time>int [default:0]</interbyte_time>
</setBusTimings>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<setBusTimings>
<return>int</return>
</setBusTimings>
</mdb>
</svc_rtn>
mdb_setMdbLinkState()
Enables or disables the MDB link from the application’s point of view. All incoming
MDB requests are discarded.
C Prototype
int mdb_setMdbLinkState(int disabled /*0*/);
Parameters
disabled Sets the MDB link:
• 1 – Disable the MDB link.
• 0 – Enable the MDB link.
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<setMdbLinkState>
<disabled>int [default:0]</disabled>
</setMdbLinkState>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<setMdbLinkState>
<return>int</return>
</setMdbLinkState>
</mdb>
</svc_rtn>
mdb_getTimeSinceLastPoll()
Returns the time elapsed since the last poll from VMC. This can help detect if the
VMC is operational. In battery operated systems, the VMC powers off after the
specified idle time.
C Prototype
int mdb_getTimeSinceLastPoll(void);
Return Values
>=0 Success (centisec),
XML Command
<svc_cmd>
<mdb>
<getTimeSinceLastPoll/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<getTimeSinceLastPoll>
<return>int</return>
</getTimeSinceLastPoll>
</mdb>
</svc_rtn>
mdb_checkPolling()
C Prototype
int mdb_checkPolling(int waittime /*0*/);
Return Values
0= Polling is active
1= Polling is inactive
XML Command
<svc_cmd>
<mdb>
<checkPolling>
<waittime>int [default:0]</waittime>
</checkPolling>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<checkPolling>
<return>int</return>
</checkPolling>
</mdb>
</svc_rtn>
mdb_setCardReaderAddress()
C Prototype
int mdb_setCardReaderAddress(int address /*MDB_ADR_CARD_READER*/)’;
Parameters
address This parameter is set to MDB_ADR_CARD_READER or
MDB_ADR_CASHLESS_2.
Return Values
0= Polling is active.
1= Polling is inactive.
XML Command
<svc_cmd>
<mdb>
<setCardReaderAddress>
<address>int [default:MDB_ADR_CARD_READER]</address>
</setCardReaderAddress>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<setCardReaderAddress>
<return>int</return>
</setCardReaderAddress>
</mdb>
</svc_rtn>
mdb_getCardReaderAddress()
C Prototype
int mdb_getCardReaderAddress(void);
Parameters
address Either MDB_ADR_CARD_READER or MDB_ADR_CASHLESS_-2.
Return Values
0= Either MDB_ADR_CARD_READER or MDB_ADR_CASHLESS_2.
XML Command
<svc_cmd>
<mdb>
<getCardReaderAddress/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<getCardReaderAddress>
<return>int</return>
</getCardReaderAddress>
</mdb>
</svc_rtn>
mdb_sendJustReset()
Sends the JUST RESET MDB command to indicate that the device was reset and
returned to the inactive state. If V/OS is in sleep mode and the AutoReset feature
is enabled in MCU firmware (see mdb_setConfig()), the MCU automatically
responds with a JUST RESET command for the first poll command immediately
after a WAKEUP command is received from the VMC.
C Prototype
int mdb_sendJustReset(void);
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendJustReset/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendJustReset>
<return>int</return>
</sendJustReset>
</mdb>
</svc_rtn>
mdb_send()
C Prototype
int mdb_send(unsigned char * data /*NULL*/, unsigned int length /*0*/,
unsigned int timeout /*0*/);
Parameters
data The character string send.
length Length of the character string.
timeout The time to wait in milliseconds for a response.
Return Values
0= Success
XML Command
<svc_cmd>
<mdb>
<send>
<data type="list">
<item>unsigned char</item>
</data>
<length>unsigned int [default:0]</length>
<timeout>unsigned int [default:0]</timeout>
</send>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<send>
<return>int</return>
</send>
</mdb>
</svc_rtn>
mdb_flush()
C Prototype
int mdb_flush(void);
Return Values
0= Success; no other value returns. errno is always set to 0.
XML Command
<svc_cmd>
<mdb>
<flush/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<flush>
<return>int</return>
</flush>
</mdb>
</svc_rtn>
mdb_cmdType()
C Prototype
char mdb_cmdType(unsigned char * cmd /*NULL*/, unsigned int cmdLen /*0*/);
Parameters
cmd Pointer to command.
cmdLen Length of the command.
Return Values
0= Success
XML Command
<svc_cmd>
<mdb>
<cmdType>
<cmd type="list">
<item>unsigned char</item>
</cmd>
<cmdLen>unsigned int [default:0]</cmdLen>
</cmdType>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<cmdType>
<return>char</return>
</cmdType>
</mdb>
</svc_rtn>
mdb_displayText()
C Prototype
int mdb_displayText(char * text /*NULL*/, unsigned char time /*0*/);
Parameters
text Display text as a 0-terminated ASCII-string. Maximum length supported is
32 bytes.
time Maximum time in seconds that the text displays.
Return Values
0= Success
XML Command
<svc_cmd>
<mdb>
<displayText>
<text type="string">string [default:NULL]</text>
<time>unsigned char [default:0]</time>
</displayText>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<displayText>
<return>int</return>
</displayText>
</mdb>
</svc_rtn>
mdb_clearDisplay()
C Prototype
int mdb_clearDisplay(void);
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<clearDisplay/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<clearDisplay>
<return>int</return>
</clearDisplay>
</mdb>
</svc_rtn>
mdb_sendReaderConfigData()
Sends the Reader Config Data MDB command in response to the SETUP
Configuration Data MDB command received from the VMC.
C Prototype
int mdb_sendReaderConfigData(unsigned char readerLevel /*0*/, unsigned
char * countryCode /*NULL*/, unsigned char scaleFactor /*0*/, unsigned
char decimalPlaces /*0*/, unsigned char maxResponseTime /*0*/, unsigned
char miscOptions /*0*/, int battery /*0*/);
Parameters
readerLevel The MDB reader level.
countryCode The country/currency code (2 bytes packed BCD).
scaleFactor The scale factor.
decimalPlaces The number of decimal places.
maxResponseTime The application maximum response time (in seconds).
miscOptions These are miscellaneous options (can be ORed):
• MDB_CONF_OPTIONS_REFUND – The reader can restore
funds to the payment media.
• MDB_CONF_OPTIONS_MULTIVEND – The reader is multivend
capable.
• MDB_CONF_OPTIONS_DISPLAY – The reader has its own
display.
• MDB_CONF_OPTIONS_VENDCASHSALE – The reader
supports the VEND/CASH SALE subcommand.
battery Note: A battery flag indicates that the system can work in battery
mode and will switch off after each session.
Battery mode is enabled when the VMC indicates an 8x feature
level. This causes the readerLevel parameter to change to the
battery operated level.
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendReaderConfigData>
<readerLevel>unsigned char [default:0]</readerLevel>
<countryCode type="list">
<item>unsigned char</item>
</countryCode>
<scaleFactor>unsigned char [default:0]</scaleFactor>
<decimalPlaces>unsigned char [default:0]</decimalPlaces>
<maxResponseTime>unsigned char [default:0]</maxResponseTime>
<miscOptions>unsigned char [default:0]</miscOptions>
<battery>int [default:0]</battery>
</sendReaderConfigData>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendReaderConfigData>
<return>int</return>
</sendReaderConfigData>
</mdb>
</svc_rtn>
mdb_sendPeripheralId()
C Prototype
int mdb_sendPeripheralId(unsigned char readerLevel /*0*/,
unsigned char * manufCode /*NULL*/, unsigned char modelNumber /*NULL*/,
unsigned char softwareVersion /*NULL*/,
unsigned char serialNumber /*NULL*/, unsigned int optFeatures /*0*/);
Parameters
readerLevel The MDB reader level.
manufCode The manufacturer code (3 bytes ASCII).
modelNumber The model number (12 bytes ASCII).
softwareVersion The software version (2 bytes; BCD coded).
serialNumber The factory assigned serial number.
optFeatures These are optional feature bits (used at reader Level 3; can be
ORed):
• MDB_OPTFEAT_FTL – The file transport layer supported.
• MDB_OPTFEAT_32BIT – The 32-bit monetary format.
• MDB_OPTFEAT_MULTICUR – Multi currency/multi lingual
• MDB_OPTFEAT_DATAENTRY– The data entry.
• MDB_ OPTFEAT_NEGVEND – The negative vend.
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendPeripheralId>
<readerLevel>unsigned char [default:0]</readerLevel>
<manufCode type="list">
<item>unsigned char</item>
</manufCode>
<modelNumber type="list">
<item>unsigned char</item>
</modelNumber>
<softwareVersion type="list">
<item>unsigned char</item>
</softwareVersion>
<serialNumber type="list">
<item>unsigned char</item>
</serialNumber>
<optFeatures>unsigned int [default:0]</optFeatures>
</sendPeripheralId>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendPeripheralId>
<return>int</return>
</sendPeripheralId>
</mdb>
</svc_rtn>
mdb_setOptionalFeatures()
C Prototype
int mdb_setOptionalFeatures(unsigned int optFeatures /*0*/);
Parameters
optFeatures Optional feature bits (can be ORed):
• MDB_OPTFEAT_FTL – The supported file transport layer
• MDB_OPTFEAT_32BIT – 32-bit monetary format
• MDB_OPTFEAT_MULTICUR – Multi currency/multi lingual
• MDB_OPTFEAT_DATAENTRY – Data entry.
• MDB_OPTFEAT_NEGVEND – Negative vend.
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<setOptionalFeatures>
<optFeatures>unsigned int [default:0]</optFeatures>
</setOptionalFeatures>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<setOptionalFeatures>
<return>int</return>
</setOptionalFeatures>
</mdb>
</svc_rtn>
mdb_sendDateTime()
Sends the current system time through the Diagnostics Response Date/Time
MDB command to the VMC (only to the Level 3 reader).
C Prototype
int mdb_sendDateTime(void);
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendDateTime/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendDateTime>
<return>int</return>
</sendDateTime>
</mdb>
</svc_rtn>
mdb_sendDateTimeRequest()
Sends the Time/date MDB command request to the VMC. This retrieves the
current date/time from the VMC.
C Prototype
int mdb_sendDateTimeRequest(void);
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendDateTimeRequest/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendDateTimeRequest>
<return>int</return>
</sendDateTimeRequest>
</mdb>
</svc_rtn>
mdb_sendDravs()
C Prototype
int mdb_sendDravs(unsigned char ucFeatures /*0*/);
Return Values
Data can be any length less than or equal to MDB_WRITE_CMD_SIZE-1.
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendDravs>
<ucFeatures>unsigned char [default:0]</ucFeatures>
</sendDravs>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendDravs>
<return>int</return>
</sendDravs>
</mdb>
</svc_rtn>
mdb_sendMalfunctionError()
C Prototype
int mdb_sendMalfunctionError(unsigned char error /*0*/);
Parameters
error The error code.
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendMalfunctionError>
<error>unsigned char [default:0]</error>
</sendMalfunctionError>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendMalfunctionError>
<return>int</return>
</sendMalfunctionError>
</mdb>
</svc_rtn>
mdb_sendDiagnosticResponse()
C Prototype
int mdb_sendDiagnosticResponse(unsigned char * customData /*NULL*/,
int customData_len /*0*/);
Return Values
Data can be any length less than or equal to MDB_WRITE_CMD_SIZE-1.
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendDiagnosticResponse>
<customData type="list">
<item>unsigned char</item>
</customData>
<customData_len>int [default:0]</customData_len>
</sendDiagnosticResponse>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendDiagnosticResponse>
<return>int</return>
</sendDiagnosticResponse>
</mdb>
</svc_rtn>
mdb_sendSendDataEntryRequestResp()
C Prototype
int mdb_sendSendDataEntryRequestResp(unsigned char ucDataEntryLength
/*0*/, unsigned char bRepeatedReq, unsigned string pcText /*NULL*/,
unsigned char ucTime /*0*/);
Parameters
ucDataEntryLength The length of the expected data entry.
bRepeatedReq A flag indicating a repeated request.
pcText This is optional display text; NULL can be passed.
ucTime The diplay time. This field is only used if pcText is not NULL
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendSendDataEntryRequestResp>
<ucDataEntryLength>
unsigned char [default:0]
</ucDataEntryLength>
<bRepeatedReq>unsigned char [default:0]</bRepeatedReq>
<pcText type="string">string [default:NULL]</pcText>
<ucTime>unsigned char [default:0]</ucTime>
</sendSendDataEntryRequestResp>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendSendDataEntryRequestResp>
<return>int</return>
</sendSendDataEntryRequestResp>
</mdb>
</svc_rtn>
mdb_sendDataEntryCancel()
C Prototype
int mdb_sendDataEntryCancel(void);
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendDataEntryCancel/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendDataEntryCancel>
<return>int</return>
</sendDataEntryCancel>
</mdb>
</svc_rtn>
mdb_sendFTLRetryDeny()
C Prototype
int mdb_sendFTLRetryDeny(unsigned char ucDestination /*0*/,
unsigned char ucWaittime /*0*/, unsigned char bWithAck /*0*/);
Parameters
ucDestination The address of the VMC.
ucWaittime A time delay for the sender to wait before trying to re-send the data
file.
bWithAck Set to ‘1’.
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendFTLRetryDeny>
<ucDestination>unsigned char [default:0]</ucDestination>
<ucWaittime>unsigned char [default:0]</ucWaittime>
<bWithAck>unsigned char [default:0]</bWithAck>
</sendFTLRetryDeny>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendFTLRetryDeny>
<return>int</return>
</sendFTLRetryDeny>
</mdb>
</svc_rtn>
mdb_sendFTLSendBlock()
C Prototype
int mdb_sendFTLSendBlock(unsigned char ucDestination /*0*/, unsigned char
ucBlockNum /*0*/, unsigned char ucDataLen /*0*/,
unsigned char pucData /*NULL*/, unsigned char bWithAck /*0*/);
Parameters
ucDestination The address of the VMC.
ucBlockNum The block number.
ucDataLen The length of the data.
pucData Pointer to the data.
bWithAck Set to ‘1’.
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendFTLSendBlock>
<ucDestination>unsigned char [default:0]</ucDestination>
<ucBlockNum>unsigned char [default:0]</ucBlockNum>
<ucDataLen>unsigned char [default:0]</ucDataLen>
<pucData type="list">
<item>unsigned char</item>
</pucData>
<bWithAck>unsigned char [default:0]</bWithAck>
</sendFTLSendBlock>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendFTLSendBlock>
<return>int</return>
</sendFTLSendBlock>
</mdb>
</svc_rtn>
mdb_sendFTLOkToSend()
C Prototype
int mdb_sendFTLOkToSend(unsigned char ucDestination /*0*/);
Parameters
ucDestination Address of the VMC.
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendFTLOkToSend>
<ucDestination>unsigned char [default:0]</ucDestination>
</sendFTLOkToSend>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendFTLOkToSend>
<return>int</return>
</sendFTLOkToSend>
</mdb>
</svc_rtn>
mdb_sendFTLRequestToSend()
C Prototype
int mdb_sendFTLRequestToSend(unsigned char ucDestination /*0*/, unsigned
char ucFileID /*0*/, unsigned char ucMaxLength /*0*/,
unsigned char bLastSession /*0*/);
Parameters
ucDestination The address of the VMC.
ucFileID The ID of the file.
ucMaxLength The maximum file length.
bLastSession The control byte.
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendFTLRequestToSend>
<ucDestination>unsigned char [default:0]</ucDestination>
<ucFileID>unsigned char [default:0]</ucFileID>
<ucMaxLength>unsigned char [default:0]</ucMaxLength>
<bLastSession>unsigned char [default:0]</bLastSession>
</sendFTLRequestToSend>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendFTLRequestToSend>
<return>int</return>
</sendFTLRequestToSend>
</mdb>
</svc_rtn>
mdb_FTLReceiveFile()
C Prototype
int mdb_FTLReceiveFile(unsigned char ucSourceAddress /*0*/,
unsigned char ucFileID /*0*/, char * pcFileName /*NULL*/,
unsigned char ucMaxBlocks /*0*/, unsigned char ucControlByte /*0*/,
unsigned int uiTimeout /*0*/);
Parameters
ucSourceAddress Address of the source.
ucFileID ID of the file.
pcFileName Name of the file.
ucMaxBlocks The maximum number of blocks, as received from the request
command.
ucControlByte The request command control byte.
uiTimeout The maximum timeout between data blocks (in 100ths of a
second; maximum valid value = 10000).
Return Values
0= Success
XML Command
<svc_cmd>
<mdb>
<FTLReceiveFile>
<ucSourceAddress>unsigned char [default:0]</ucSourceAddress>
<ucFileID>unsigned char [default:0]</ucFileID>
<pcFileName type="string">string [default:NULL]</pcFileName>
<ucMaxBlocks>unsigned char [default:0]</ucMaxBlocks>
<ucControlByte>unsigned char [default:0]</ucControlByte>
<uiTimeout>unsigned int [default:0]</uiTimeout>
</FTLReceiveFile>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<FTLReceiveFile>
<return>int</return>
</FTLReceiveFile>
</mdb>
</svc_rtn>
mdb_FTLReceiveFileExt()
C Prototype
int mdb_FTLReceiveFileExt(unsigned char ucSourceAddress /*0*/,
unsigned char ucFileID /*0*/, char * pcFileName /*NULL*/,
unsigned char ucMaxBlocks /*0*/, unsigned char ucControlByte /*0*/,
unsigned int uiTimeout /*0*/, unsigned char ucRecData /*NULL*/,
unsigned int uiRecDataLen /*NULL*/);
Parameters
ucSourceAddress Address of the source.
ucFileID ID of the file.
pcFileName Name of the file. If NULL, data is stored in ucRecData.
ucMaxBlocks The maximum number of blocks, as received from the
request command.
ucControlByte The request command control byte.
uiTimeout The maximum timeout between data blocks (in 100ths of a
second; maximum valid value = 10000).
ucRecData Pointer to file destination.
uiRecDataLen The size of ucRecData.
Return Values
0= Success
XML Command
<svc_cmd>
<mdb>
<FTLReceiveFileExt>
<ucSourceAddress>unsigned char [default:0]</ucSourceAddress>
<ucFileID>unsigned char [default:0]</ucFileID>
<pcFileName type="string">string [default:NULL]</pcFileName>
<ucMaxBlocks>unsigned char [default:0]</ucMaxBlocks>
<ucControlByte>unsigned char [default:0]</ucControlByte>
<uiTimeout>unsigned int [default:0]</uiTimeout>
<ucRecData type="list">
<item>unsigned char</item>
</ucRecData>
<uiRecDataLen type="list">
<item>unsigned int</item>
</uiRecDataLen>
</FTLReceiveFileExt>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<FTLReceiveFileExt>
<return>int</return>
</FTLReceiveFileExt>
</mdb>
</svc_rtn>
mdb_FTLRespondToReceiveRequest()
C Prototype
int mdb_FTLRespondToReceiveRequest(unsigned char ucDestination /*0*/,
unsigned char ucFileID /*0*/, char * pcFileName /*NULL*/,
unsigned int uiAddDataHeaderLen /*0*/,
unsigned char pucAddDataHeader /*0*/,
unsigned int uiAddDataTrailerLen /*0*/,
unsigned char pucAddDataTrailer /*0*/, unsigned char ucMaxBlocks /*0*/,
unsigned char ucControlByte /*0*/);
Parameters
ucDestination VMC address.
ucFileID ID of the file.
pcFileName Name of the file. If NULL, data is stored in ucRecData.
uiAddDataHeaderLen Additional data header length (can be 0).
pucAddDataHeader Additional data header (can be NULL).
uiAddDataTrailerLen Additional data trailer length (can be 0).
pucAddDataTrailer Additional data trailer (can be NULL).
ucMaxBlocks The maximum number of blocks.
ucControlByte The request command control byte.
Return Values
0= Success
XML Command
<svc_cmd>
<mdb>
<FTLRespondToReceiveRequest>
<ucDestination>unsigned char [default:0]</ucDestination>
<ucFileID>unsigned char [default:0]</ucFileID>
<pcFileName type="string">string [default:NULL]</pcFileName>
<uiAddDataHeaderLen>
unsigned int [default:0]
</uiAddDataHeaderLen>
<pucAddDataHeader type="list">
<item>unsigned char</item>
</pucAddDataHeader>
<uiAddDataTrailerLen>
unsigned int [default:0]
</uiAddDataTrailerLen>
<pucAddDataTrailer type="list">
<item>unsigned char</item>
</pucAddDataTrailer>
<ucMaxBlocks>unsigned char [default:0]</ucMaxBlocks>
<ucControlByte>unsigned char [default:0]</ucControlByte>
</FTLRespondToReceiveRequest>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<FTLRespondToReceiveRequest>
<return>int</return>
</FTLRespondToReceiveRequest>
</mdb>
</svc_rtn>
mdb_FTLSendFile()
C Prototype
int mdb_FTLSendFile(unsigned char ucDestination /*0*/, unsigned char
ucFileID /*0*/, char * pcFileName /*NULL*/,
unsigned int uiAddDataHeaderLen /*0*/,
unsigned char pucAddDataHeader /*0*/,
unsigned int uiAddDataTrailerLen /*0*/,
unsigned char pucAddDataTrailer /*0*/, unsigned char ucMaxBlocks /*0*/,
unsigned char ucControlByte /*0*/);
Parameters
ucDestination Address of the file destination.
ucFileID ID of the file.
pcFileName Name of the file.
uiAddDataHeaderLen Additional data header length (can be 0).
pucAddDataHeader Additional data header (can be NULL),
uiAddDataTrailerLen Additional data trailer length (can be 0).
pucAddDataTrailer Additional data trailer (can be NULL).
Return Values
0= Success
XML Command
<svc_cmd>
<mdb>
<FTLSendFile>
<ucDestination>unsigned char [default:0]</ucDestination>
<ucFileID>unsigned char [default:0]</ucFileID>
<pcFileName type="string">string [default:NULL]</pcFileName>
<uiAddDataHeaderLen>
unsigned int [default:0]
</uiAddDataHeaderLen>
<pucAddDataHeader type="list">
<item>unsigned char</item>
</pucAddDataHeader>
<uiAddDataTrailerLen>
unsigned int [default:0]
</uiAddDataTrailerLen>
<pucAddDataTrailer type="list">
<item>unsigned char</item>
</pucAddDataTrailer>
</FTLSendFile>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<FTLSendFile>
<return>int</return>
</FTLSendFile>
</mdb>
</svc_rtn>
mdb_sendBeginSession()
Sends the Begin Session MDB command to inform the VMC about the card
amount, and prompts the user to make selection. This command only sends the
card amount. There is no guarantee that this amount is available to debit from the
card. The EXPANSION Request ID MDB command from the VMC. Configuration
data is obtained from the VMC.
C Prototype
int mdb_sendBeginSession(unsigned char readerLevel /*0*/,
unsigned int amount /*0*/, unsigned char * paymentMediaId /*NULL*/,
unsigned char paymentType /*0*/, unsigned char * paymentData /*NULL*/,
unsigned char * userLanguage /*NULL*/,
unsigned char * currencyCode /*NULL*/, unsigned char cardOptions /*0*/);
Parameters
Return Values
0= Success
XML Command
<svc_cmd>
<mdb>
<sendBeginSession>
<readerLevel>unsigned char [default:0]</readerLevel>
<amount>unsigned int [default:0]</amount>
<paymentMediaId type="list">
<item>unsigned char</item>
</paymentMediaId>
<paymentType>unsigned char [default:0]</paymentType>
<paymentData type="list">
<item>unsigned char</item>
</paymentData>
<userLanguage type="list">
<item>unsigned char</item>
</userLanguage>
<currencyCode type="list">
<item>unsigned char</item>
</currencyCode>
<cardOptions>unsigned char [default:0]</cardOptions>
</sendBeginSession>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendBeginSession>
<return>int</return>
</sendBeginSession>
</mdb>
</svc_rtn>
mdb_sendSessionCancelRequest()
Sends the Session Cancel Request MDB command to the VMC. This cancels the
session before the user makes a selection.
C Prototype
int mdb_sendSessionCancelRequest(void);
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendSessionCancelRequest/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendSessionCancelRequest>
<return>int</return>
</sendSessionCancelRequest>
</mdb>
</svc_rtn>
mdb_sendVendApproved()
Sends the Vend Approved MDB command in response to the VEND Vend
Request MDB command from the VMC. This informs the VMC that the vend
amount was deducted from the user’s payment media. The VMC can dispense
the product. Do not send this command if it is unsure if sufficient funds are
available.
C Prototype
int mdb_sendVendApproved(unsigned char readerLevel /*0*/,
unsigned int amount /*0*/);
Parameters
readerLevel the MDB reader level.
amount The amount deducted (scaled).
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendVendApproved>
<readerLevel>unsigned char [default:0]</readerLevel>
<amount>unsigned int [default:0]</amount>
</sendVendApproved>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendVendApproved>
<return>int</return>
</sendVendApproved>
</mdb>
</svc_rtn>
mdb_sendVendDenied()
Sends the Vend Denied MDB command in response to the VEND Vend Request
MDB command from the VMC. This denies approval of the patrons selection and
prohibits the VMC to dispense any product.
C Prototype
int mdb_sendVendDenied(void);
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendVendDenied/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendVendDenied>
<return>int</return>
</sendVendDenied>
</mdb>
</svc_rtn>
mdb_sendEndSession()
Sends the End Session MDB command to indicate that the payment media was
removed, the device has finished the vending process and has returned to the
Enabled state. The End Session command is issued in response to the VEND
Session Complete MDB command from the VMC.
C Prototype
int mdb_sendEndSession(void);
Return Values
0= Success
XML Command
<svc_cmd>
<mdb>
<sendEndSession/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendEndSession>
<return>int</return>
</sendEndSession>
</mdb>
</svc_rtn>
mdb_sendOutOfSequence()
Sends the Out of Sequence MDB command to reject forbidden commands. Use
this command if the device cannot execute the received command.
C Prototype
int mdb_sendOutOfSequence(unsigned char readerLevel /*0*/,
unsigned char state /*0*/);
Parameters
readerLevel The MDB reader level.
state The state of the MDB state machine (used only for reader Level 2 or
3; cannot be ORed).
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendOutOfSequence>
<readerLevel>unsigned char [default:0]</readerLevel>
<state>unsigned char [default:0]</state>
</sendOutOfSequence>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendOutOfSequence>
<return>int</return>
</sendOutOfSequence>
</mdb>
</svc_rtn>
mdb_sendCancelled()
Sends the Cancelled MDB command in response to the READER Cancel MDB
command from the VMC.
C Prototype
int mdb_sendCancelled(void);
Return Values
0= Success
XML Command
<svc_cmd>
<mdb>
<sendCancelled/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendCancelled>
<return>int</return>
</sendCancelled>
</mdb>
</svc_rtn>
mdb_sendRevalueApproved()
NOTE
This call is only supported on Level 2 and 3 readers.
C Prototype
int mdb_sendRevalueApproved(void);
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendRevalueApproved/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendRevalueApproved>
<return>int</return>
</sendRevalueApproved>
</mdb>
</svc_rtn>
mdb_sendRevalueDenied()
NOTE
This call is only supported on Level 2 and 3 readers.
Sends the Revalue Denied MDB command in response to the REVALUE Revalue
Request MDB command from the VMC to deny the revalue request.
C Prototype
int mdb_sendRevalueDenied(void);
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendRevalueDenied/>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendRevalueDenied>
<return>int</return>
</sendRevalueDenied>
</mdb>
</svc_rtn>
mdb_sendRevalueLimitAmount()
Sends the Revalue Limit Amount MDB command in response to the REVALUE
Revalue Limit Requested MDB command from the VMC. The revalue limit is the
amount the reader will accept.
C Prototype
int mdb_sendRevalueLimitAmount(unsigned char readerLevel /*0*/,
unsigned int amount /*0*/);
Parameters
readerLevel The MDB reader level.
Revalue This is the card limit value (scaled).
Return Values
0= Success.
XML Command
<svc_cmd>
<mdb>
<sendRevalueLimitAmount>
<readerLevel>unsigned char [default:0]</readerLevel>
<amount>unsigned int [default:0]</amount>
</sendRevalueLimitAmount>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<sendRevalueLimitAmount>
<return>int</return>
</sendRevalueLimitAmount>
</mdb>
</svc_rtn>
mdb_setDisplayData()
C Prototype
int mdb_setDisplayData(unsigned char width /*0*/,
unsigned char height /*0*/, unsigned char dispInfo /*0*/);
Parameters
width The number of characters per row (default 16).
height The number of rows on the display (default 2).
dispInfo The display type.
Return Values
0= Polling is active.
1= Polling is inactive.
XML Command
<svc_cmd>
<mdb>
<setDisplayData>
<width>unsigned char [default:0]</width>
<height>unsigned char [default:0]</height>
<dispInfo>unsigned char [default:0]</dispInfo>
</setDisplayData>
</mdb>
</svc_cmd>
Return XML
<svc_rtn>
<mdb>
<setDisplayData>
<return>int</return>
</setDisplayData>
</mdb>
</svc_rtn>
MDB Data Structure The following are the MDB data structures:
Index
• MdbCommand–MDB command structure
• MdbConfig–MDB configuration structure
MdbCommand Peeks at the next available MDB command from MDB buffer without advancing
Structure the mdb_buffer pointer to the next available command.
C Prototype
struct MdbCommand mdb_peek (void);
Return Values
Returns the mdb_command struct when data is available. Returns NULL if the
receive buffer is empty.
0= Success
Data Fields
unsigned char cmd [MDB_CMD_SIZE]
Struct Reference
unsigned char MdbCommand::cmd[MDB_CMD_SIZE]
MdbConfig Obtains the current MDB configuration from the Standby MCU. The configuration
Structure is permanently stored in the Standby MCU, and does not need to be set after a
power fail.
C Prototype
struct MdbConfig mdb_getConfig (void);
Return Values
0= Success
Data Fields
int MdbOn
This value is 1 if MDB mode is on, or 0 if MDB mode is off (must be 1 for this
service to work).
int AutoACK
This value is 1 for MCU to Auto ACK all MDB commands from the VMC, or 0 for
no auto-ACKing.
int AutoSetup
NOTE
Not currently implemented.
This value is 1 for MCU to send MDB device setup response automatically.
int AutoReset
This value is 1 for the MCU to automatically respond to the MDB Host RESET
command when V/OS is in sleep mode, or 0 if not in sleep mode.
Struct Reference
int MdbConfig::AutoACK
This value is 1 for MCU to Auto ACK all MDB commands from the VMC, or 0 for
no auto-ACKing.
int MdbConfig::AutoSetup
NOTE
Not currently implemented.
This value is 1 for MCU to send MDB device setup response automatically.
int MdbConfig::AutoReset
This value is 1 for the MCU to automatically respond to the MDB Host RESET
command when V/OS is in sleep mode, or 0 if not in sleep mode.
#define MDB_STATE_REVALUE 6
#define MDB_STATE_NEGATIVE_VEND 7
#define MDB_CARDOPT_DISPLAY 0x00
#define MDB_CARDOPT_NO_DISPLAY 0x01
#define MDB_CARDOPT_NO_REFUND 0x00
#define MDB_CARDOPT_REFUND 0x02
#define MDB_CARDOPT_NO_REVALUE 0x00
#define MDB_CARDOPT_REVALUE 0x04
<PPPPROTO_LIST>
<PPPPROTO name_id="ppp0" user="username" password="password" auth="pap"
next_media="modem_uxpstn"/>
</PPPPROTO_LIST>
<MODISDNLINK_LIST>
<MODISDNLINK name_id=" modem_uxpstn" … other parameters … />
</MODISDNLINK_LIST>
</SETTINGS>
<PPPPROTO_LIST>
<PPPPROTO name_id="ppp0" user="username" password="password" auth="pap"
next_media="modem_uxisdn"/>
</PPPPROTO_LIST>
<MODISDNLINK_LIST>
<MODISDNLINK name_id=" modem_uxisdn" … other parameters … />
</MODISDNLINK_LIST>
</SETTINGS>
NOTE
Use ppp0 as the PPP interface name.
2 Use the OPTION tag Convoy the PPP over serial port parameters.
Example
char p_option[NET_OPTION_MAX];
where,
• local_ip = terminal IP address
• remote_ip = server IP address
• com_port = serial port name (for exmple, /dev/ttyAMA1)
NOTE
Even if you configure the desired TTY serial interface for the printer in the API,
always use /dev/ttyAMA2 for the Remote Printer.
<PPPPROTO_LIST>
<PPPPROTO name_id="ppp0" user="username" password="password" auth="pap"
next_media="serial_port"/>
</PPPPROTO_LIST>
<OPTION_LIST>
<OPTION name_id="ppp0" option=" asyncmap 0 noauth noipdefault crtscts
local_ip:remote_ip com_port speed" />
</OPTION_LIST>
</SETTINGS>
Remote Printer This section contains the UX remote printer service, including XML commands
and structures, #defines, and APIs. The UX terminal supports two printer models:
• CUSTOMS TG 2460, TG 2460H
• ARTEMA unattended serial printer
Both printers exchange data over a serial connection. Printer type is automatically
detected on connection.
NOTE
Reference the svcmgrSvcDef.h header file to supplement the information in this
section.
Remote Printer This section presents the remote printer APIs and XML structures. See #defines
Functions for valid parameter values.
NOTE
Even if you configure the desired TTY serial interface for the printer in the API,
always use /dev/ttyAMA2 for the Remote Printer.
remoteprinter_getVersion()
C Prototype
struct version remoteprinter_getVersion (void);
Parameters
optFeatures Optional feature bits (can be ORed):
• MDB_OPTFEAT_FTL – The supported file transport layer
• MDB_OPTFEAT_32BIT – 32-bit monetary format
• MDB_OPTFEAT_MULTICUR – Multi currency/multi lingual
• MDB_OPTFEAT_DATAENTRY – Data entry.
• MDB_OPTFEAT_NEGVEND – Negative vend.
Return Values
Returns the version struct as defined in svcmgrSvcDef.h.
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<getVersion/>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<getVersion>
<return type="container">
<major>int</major>
<minor>int</minor>
<maint>int</maint>
<build type="string">string [max len 16]</build>
</return>
</getVersion>
</remoteprinter>
</svc_rtn>
remoteprinter_Open()
Opens the remote printer service. Call remoteprinter_TurnOn() after using this
command to enable printing.
C Prototype
int remoteprinter_Open (char comDev);
Parameters
comDev The COM flag string.
Return Values
0= Success, and the COM device handle.
XML Command
<svc_cmd>
<remoteprinter>
<Open>
<comDev type="string">string [default:NULL]</comDev>
</Open>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<Open>
<return>int</return>
</Open>
</remoteprinter>
</svc_rtn>
remoteprinter_TurnOn()
C Prototype
int remoteprinter_TurnOn(void);
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<TurnOn/>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<TurnOn>
<return>int</return>
</TurnOn>
</remoteprinter>
</svc_rtn>
remoteprinter_TurnOff()
C Prototype
int remoteprinter_TurnOff (void);
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<TurnOff/>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<TurnOff>
<return>int</return>
</TurnOff>
</remoteprinter>
</svc_rtn>
remoteprinter_Flush()
C Prototype
int remoteprinter_Flush(void);
Parameters
optFeatures Optional feature bits (can be ORed):
• MDB_OPTFEAT_FTL – The supported file transport layer
• MDB_OPTFEAT_32BIT – 32-bit monetary format
• MDB_OPTFEAT_MULTICUR – Multi currency/multi lingual
• MDB_OPTFEAT_DATAENTRY – Data entry.
• MDB_OPTFEAT_NEGVEND – Negative vend.
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<Flush/>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<Flush>
<return>int</return>
</Flush>
</remoteprinter>
</svc_rtn>
remoteprinter_GetStatus()
C Prototype
struct rmpBinData remoteprinter_GetStatus(int statusType /*0*/);
Parameters
statusType Remoter printer status.
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<GetStatus>
<statusType>int [default:0]</statusType>
</GetStatus>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<GetStatus>
<return type="container">
<data type="binary">base64binary string</data>
</return>
</GetStatus>
</remoteprinter>
</svc_rtn>
remoteprinter_PrintBarCode()
C Prototype
int remoteprinter_PrintBarCode(int barcodeType /*0*/,
struct rmpBinData binData /*0*/);
Parameters
barcodeType The barcode system type to print.
binData The barcode data, including the barcode check-digit bit.
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<PrintBarCode>
<barcodeType>int [default:0]</barcodeType>
<binData type="container">
<data type="binary">
base64binary string [default:NULL]
</data>
</binData>
</PrintBarCode>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<PrintBarCode>
<return>int</return>
</PrintBarCode>
</remoteprinter>
</svc_rtn>
remoteprinter_UpdateFirmware()
C Prototype
int remoteprinter_UpdateFirmware(char * pFileName /*NULL*/);
Parameters
pFileName Firmware file name to download to the remote printer.
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<UpdateFirmware>
<pFileName type="string">string [default:NULL]</pFileName>
</UpdateFirmware>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<UpdateFirmware>
<return>int</return>
</UpdateFirmware>
</remoteprinter>
</svc_rtn>
remoteprinter_DownloadLogo()
C Prototype
int remoteprinter_DownloadLogo(int sectorId /*0*/,
char * logoFileName /*NULL*/);
Parameters
sectorId Display sector location for the logo file download.
logoFileName Logo file name to download to the remoter printer.
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<DownloadLogo>
<sectorId>int [default:0]</sectorId>
<logoFileName type="string">
string [default:NULL]
</logoFileName>
</DownloadLogo>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<DownloadLogo>
<return>int</return>
</DownloadLogo>
</remoteprinter>
</svc_rtn>
remoteprinter_DownloadFont()
C Prototype
int remoteprinter_DownloadFont(int fontId /*0*/,
char * fontFileName /*NULL*/);
Parameters
fontId The font sector location for the font file download.
fontFileName The font file name to download to the remote printer.
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<DownloadFont>
<fontId>int [default:0]</fontId>
<fontFileName type="string">
string [default:NULL]
</fontFileName>
</DownloadFont>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<DownloadFont>
<return>int</return>
</DownloadFont>
</remoteprinter>
</svc_rtn>
remoteprinter_PrintLogo()
C Prototype
int remoteprinter_PrintLogo(int logoId /*0*/,
struct rmpBinData binData /*0*/);
Parameters
logoId The logo file to print.
binData Additional data.
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<PrintLogo>
<logoId>int [default:0]</logoId>
<binData type="container">
<data type="binary">
base64binary string [default:NULL]
</data>
</binData>
</PrintLogo>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<PrintLogo>
<return>int</return>
</PrintLogo>
</remoteprinter>
</svc_rtn>
remoteprinter_PrintBitImage()
C Prototype
int remoteprinter_PrintBitImage(int modeId /*0*/,
struct rmpBinData binData /*0*/);
Parameters
modeId The print mode.
binData BitImage binary data for printing a one-line graphic.
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<PrintBitImage>
<modeId>int [default:0]</modeId>
<binData type="container">
<data type="binary">
base64binary string [default:NULL]
</data>
</binData>
</PrintBitImage>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<PrintBitImage>
<return>int</return>
</PrintBitImage>
</remoteprinter>
</svc_rtn>
remoteprinter_Command()
C Prototype
struct rmpBinData remoteprinter_Command(int cmdID /*0*/,
struct rmpBinData binData /*0*/);
Parameters
cmdID The command to execute.
binData The command data to send to the remoter printer.
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<Command>
<cmdID>int [default:0]</cmdID>
<binData type="container">
<data type="binary">
base64binary string [default:NULL]
</data>
</binData>
</Command>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<Command>
<return type="container">
<data type="binary">base64binary string</data>
</return>
</Command>
</remoteprinter>
</svc_rtn>
remoteprinter_Detect()
C Prototype
int remoteprinter_Detect(void);
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<Detect/>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<Detect>
<return>int</return>
</Detect>
</remoteprinter>
</svc_rtn>
remoteprinter_GetLibVersion()
C Prototype
struct rmpBinData remoteprinter_GetLibVersion(void);
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<GetLibVersion/>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<GetLibVersion>
<return type="container">
<data type="binary">base64binary string</data>
</return>
</GetLibVersion>
</remoteprinter>
</svc_rtn>
remoteprinter_SetDensity()
C Prototype
int remoteprinter_SetDensity(int level /*0*/);
Parameters
level Print density level, where /*0*/ is:
• M1470/Artema: [-10..10] • TG2460: [0, 8]
• Default is 0. • Default is 4.
• -10 brightest • 0 brightest
• +10 darkest • 8 darkest.
• TG2460H: [48 , 56]
• Default is 4.
• 48 brightest
• 56 darkest.
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<SetDensity>
<level>int [default:0]</level>
</SetDensity>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<SetDensity>
<return>int</return>
</SetDensity>
</remoteprinter>
</svc_rtn>
remoteprinter_SetCharacterSize()
Sets the remote printer character print size width and height.
C Prototype
int remoteprinter_SetCharacterSize(int width /*0*/, int height /*0*/);
Parameters
width Character print width.
height Character print height.
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<SetCharacterSize>
<width>int [default:0]</width>
<height>int [default:0]</height>
</SetCharacterSize>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<SetCharacterSize>
<return>int</return>
</SetCharacterSize>
</remoteprinter>
</svc_rtn>
remoteprinter_Cut()
NOTE
TG2460/TG2460H printers do not support this command.
C Prototype
int remoteprinter_Cut(int cutType /*0*/);
Parameters
cutType Sets the cut type: valid values are PARTIAL or FULL.
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<Cut>
<cutType>int [default:0]</cutType>
</Cut>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<Cut>
<return>int</return>
</Cut>
</remoteprinter>
</svc_rtn>
remoteprinter_Close()
C Prototype
int remoteprinter_Close(void);
Parameters
optFeatures Optional feature bits (can be ORed):
• MDB_OPTFEAT_FTL – The supported file transport layer
• MDB_OPTFEAT_32BIT – 32-bit monetary format
• MDB_OPTFEAT_MULTICUR – Multi currency/multi lingual
• MDB_OPTFEAT_DATAENTRY – Data entry.
• MDB_OPTFEAT_NEGVEND – Negative vend.
Return Values
0= Success.
XML Command
<svc_cmd>
<remoteprinter>
<Close/>
</remoteprinter>
</svc_cmd>
Return XML
<svc_rtn>
<remoteprinter>
<Close>
<return>int</return>
</Close>
</remoteprinter>
</svc_rtn>
Printer Status ID
#define SVC_ID_RMPRNT_PRINTER_STAT 1
#define SVC_ID_RMPRNT_OFFLINE_STAT 2
#define SVC_ID_RMPRNT_ERROR_STAT 3
#define SVC_ID_RMPRNT_SENSOR_STAT 4
#define SVC_ID_RMPRNT_PAPER_STAT 17
#define SVC_ID_RMPRNT_FULL_STAT 20
#define SVC_ID_RMPRNT_PRNTER_ID 21
Raw commands. With this command ID the application will pass through the total
number of commands, including command, parameters, and data. The command
IDs are printer-specific. The application only needs to pass through variable
command parameter(s) as necessary.
TG2460 printer-specific commands:
• rmpCommand pDataIn
• rmpCommand pDataOut
Generic TG Printer(TGP) commands:#define SVC_TGP_HORIZONTAL_TAB 1
Sets the horizontal tab. NULL NULL
#define SVC_TGP_LINE_FEED 2
#define SVC_TGP_MIN_LINE_SPACE 10
#define SVC_TGP_SET_WHITE_BLACK 28
#define SVC_TG2460_SET_COUNTER 46
Sets the absolute vertical print position in page mode. 2 Bytes: nL nH NULL.
#define SVC_TG2460H_POWER_LED_BAR 50
Queries the font info. 1 Byte: n 8 Bytes: Font info: see MCS printer spec
#define SVC_MCSP_GET_LOGO_CRC 57
#define SVC_MCSP_RECEIPT 64
Sets the power off timeout in seconds, valid value[10–60], default 20: 1 Byte: n
NULL.
#define SVC_MCSP_GET_POWEROFF_TIMEOUT 67
Queries the power off timeout NULL 2 Bytes: Power off timer value.
#define SVC_MCSP_GET_SENSOR_INFO 68
Data Fields
void data
Binary data.
int data_count
Binary data.
int rmpBinData::data_count
Data Fields
char id
char rmpCmdParams::id
Data Fields
int len
int rmpDataReturn::len
Graphical User The UX300 GUI is covered in the ADK DirectGUI component. The GUI is similar
Interface (GUI) to VX 520, but has a different keyboard layout. Access key definitions (key
mapping) in HTML files may need modification to match the UX keyboard. The
GUI also discusses PIN handling using the UX100 PIN Entry Functions.
Documentation and sample code is in the ADK in the DOC releases package. The
use of keyboard and display on the remote PIN entry device is fully transparent.
CAUTION The buildall update package erases every installed system-signed package.
You must reinstall the application developer console package and any
system-signed packages required for applications.
You can manually reboot the machine using a power-cycle or from the menu.
The terminal update initiates on power up.
NOTE
The terminal may reboot during installation.
The last entry is the current build, which should correspond to the package
chosen in Step 1.
I/O Module The UX300 I/O module is not customer serviceable. Do not remove the I/O
module.
CAUTION Removing the UX300 I/O module triggers a hardware tamper. All
cryptographic keys are erased, including keys required for the secure USB
link. The numeric keys are disabled, and the terminal must be returned to
Verifone for repair.
Performing a The UX300 terminal and UX100 PINpad are updated using a USB thumb drive
Card Reader with a FAT partition. If you need to update the card reader, ask your Verifone
Reset representative for the Updating a UX300/UX100 Device over USB Manual.
Sysmode • When Sysmode launches, the orange LED lights solid to indicate that system
Features mode is executing.
• If launching Sysmode manually (by continually pressing the sysmode button),
the update begins automatically when the USB flash memory device is
connected. All packages in the V/OS-auto-update USB package directory (see
Secure Installer). The yellow LED blinks during installation. The green LED
blinks three times for a successful installation. The red LED blinks three times
if the installation failed.
This section presents Sysmode for the UX300 and VX 520 terminals.
• Press the Sysmode button on the back panel on the UX300 (Figure 17).
SYSMODE BUTTON
You are prompted to set passwords when the device first boots. Use the keypad
and press OK to set the new password. Each password has an expiration set at
manufacture. Save the password in a secure location.
Security Policy File This file contains the following definitions for level1 and level2 user access:
• level1 has access to the ARS menu and can change ASR passwords
• level2 (usually the customer’s supervisor user) has level1 access, plus access
to the Expire Switch Password menu to reset ASR passwords to their default
value
• Maintenance (customer’s operator for on-site maintenance to check device
status) only has access to the Information and Diagnostic menus
Change Passwords Use the following procedure to reset the USER password.
Use the arrow keys to navigate through the Sysmode menus. Press OK after
making each selection.
1 Select Login > user.
2 Enter the current password for the selected user.
Sysmode Menus Sysmode menus are configuration specific. For example, when an UX300 is
connected to a UX100 PINpad, an UX100 Sysmode menu displays; or if you have
VX 520 with GPRS, a GPRS modem menu is available. Depending on your
configuration, the following menus are available when the Sysmode application is
running:
Information
• Basic info: Display general information on the unit (S/N, P/N, revision, model,
and so on), and low-level software (Linux kernel, U-Boot, SBI, and so on)
• Ports/Options (UX300): Display COM ports states
• Software: List of installed software
• FW Version: Display the firmware version.
892 TPKQ PROGRAMMER’S MANUAL
VX 520 AND UX300 S YSMODE A PPLICATION
Sysmode Menus
Administration
• Touch Panel: Run UX200 touch panel calibration
• Config: Edit the user or system config file
• Communication: Configure the ECR, USB, Network, and VHQ Estate
Manager
• Date/Time: Configure the system date and time
• Network: Configure and display information on network interfaces
• File Manager: Browse system files
• Power Settings
• Display: Configure UX200 display
• Audio: Set UX200 volume
• Remove/Uninstall: Remove selected or all user bundles.
NOTE
This feature cannot remove OS/system bundles.
Update
• USB Memory: Browse the USB device and install selected software
• Serial: Install update over the serial link (only with the Mx800Downloader
application on COM1 only)
• Netloader: Install applications over Ethernet (only with the Mx800Downloader
application)
• MMS: Initiate a session with the MagIC Management system to update S/W
configuration remotely
Transfer
• Serial/USB: Install bundle using serial link (using the Mx800Downloader
application)
TPKQ PROGRAMMER’S MANUAL 893
VX 520 AND UX300 S YSMODE A PPLICATION
Sysmode Menus
Security
• Key loading
• Load Bank/VRK keys using serial link (COM1 only). Access is restricted
with two key loader passwords
• Perso Pinpad: Create key pair and build certificate using a smartcard for
mutual authentication V/OS PINpad
• Tamper status: Display security status
• Key list: Display loaded secure keys/scripts (RKL, VSS, DUKPT, and MS), and
also displays status on P-Series authentication
• Password Mgr: Change user and key load passwords or expired password
• Verishield tree: List all installed Verifshield keys
• Security policy: List the security policy file name
• VRP status:
• Service switch: Display ARS information
• Removal Switch: (ARS management) Display information about removal
switch status and reset removal switch status
Diagnostic
• Battery: Display battery status and voltage
• Display: Perform display diagnostics, which attempts to display a bitmap
• Touch Panel: Perform touch panel diagnostics of touch and signature
response
• Keyboard: Display the matrix with the keys. Press a key to increase the
counter number for that key value. There is no button to return to a previous
menu. If no keys are pressed in 5 seconds, the diagnostic test automatically
exits
• Card
• Smart Card: Perform smart card device diagnostics
• Magstripe: Perform magnetic stripe device diagnostics
• Contactless: Perform Contactless device diagnostics
• Communications
• Ethernet: Perform Ethernet connection diagnostics (ping test)
• Serial: Perform serial loop-back diagnostics. For this test to work correctly,
the loop-back cable shown in Figure 18 is required.
NOTE
Insert the loop-back cable into serial port 1 (COM1) with NO console enabled.
• Security:
• Status: Display security status (tamper)
• Key list: Display the PINpad key list
• Unlock: Detamper the PINpad using the “UNLOCK” smartcard
• Reset: Remove PINpad keys using the “RESET” smartcard
• Perso: Generate key pair and certificate using the “AUTH_PP”
smartcard. This is required for mutual authentication V/OS PINpad
• Diagnostic: Perform diagnostics for all PINpad devices separately
NOTE
There is no restriction on the bundle type that can be removed on this screen.
Ensure you have selected the proper bundle.
Special Features • (VX 520) When Sysmode launches, the keyboard buzzer is disabled
• (UX300) When Sysmode launches, the orange LED is on steady to indicate
that system mode is executing
• (UX300) If Sysmode is launched manually, an automatic update from a USB
flash memory drive starts. All packages in the /VOS-auto-update USB
package directory install. An automatic update is indicated with a blinking
yellow LED during installation. On successful installation, the green LED
blinks three times; on failure the red LED blinks three times.
NET Services This section presents the VX terminal-specific NET Services used to configure
IPv4 Ethernet and Wi-Fi devices. For more information, see Chapter 21, NET
Service Ethernet and Wi-Fi Configuration.
NOTE
NET Service supports both IPv4 and IPv6, however, in V/OS only IPv4 is
currently supported. Parameters related to IPv6 will be ignored.
NET Service uses an XML file to store the parameters. To configure IPv4 Ethernet
and Wi-Fi communications device (terminal specific) and support various
protocols (IP, PPP, SSL, and so on). It provides calls to:
1 Write Ethernet Parameters to netconf.xml.
NOTE
com_name refers to the communication device (modem, serial port, GPRS, and
so on) used to connect the PPP. Possible values are shown in Table 13.
NOTE
"ppp1" must be used as interface name when connecting PPP over GPRS.
"ppp0" is reserved for modems and serial ports.
Modem and GPRS The PPP layer requires a modem or GPRS device connection. To store modem
Parameters and GPRS parameters in netconf.xml.
1 Use net_interfaceModemExtSet() and the netModemInfo structure to write
V/OS PSTN modem parameters to the netconf.xml file:
int net_interfaceModemExtSet( char *iface, struct netModemInfo mdnInfo );
where,
• iface is NET_MONDEM_PSTN for a V/OS standard modem.
• struct netModemInfo is the general structure used to Convoy the
modem parameters.
<SETTINGS>
<MODLINK_LIST>
<MODLINK name_id="modem_uart" number="0123456789" dial_type="1" mode="2"
max_retries="1" max_line_rate="12" connect_timeout="30"
error_correction="1" compression="1"/>
</MODLINK_LIST>
<!-other tags -- >
</SETTINGS>
where,
• iface is NET_MONDEM_PSTN for a V/OS standard modem.
where,
• struct netModemInfo is the general structure used to Convoy the
modem parameters.
<MODLINK_LIST>
<MODLINK name_id="modem_pstn" number="0123456789" dial_type="1" mode="2"
max_retries="1" max_line_rate="12" connect_timeout="30"
error_correction="1" compression="1"/>
</MODLINK_LIST>
<!-other tags -- >
</SETTINGS>
where,
where,
• struct netModemInfo is the general structure used to Convoy the
modem parameters.
<MODISDNLINK_LIST>
<MODISDNLINK name_id="modem_isdn" isdn_prot="10" number="959"
x25_packet_size="0" facilities="" nui="" x25_number="" user_data=""
max_retries="2" connect_timeout="30" country_code="FD"/>
</MODISDNLINK_LIST>
</SETTINGS>
where,
• struct netGprsInfo is the general structure used to Convoy the
GPRS parameters.
<GPRS_LIST>
</SETTINGS>
<PPPPROTO_LIST>
<PPPPROTO name_id="ppp0" user="username" password="password" auth="pap"
next_media="modem_uart"/>
</PPPPROTO_LIST>
<MODLINK_LIST>
<MODLINK name_id=" modem_uart" … other parameters … />
</MODLINK_LIST>
</SETTINGS>
c Use the net_interfaceUp( "ppp0", NET_IP_V4 ) command to
connect the modem and bring the PPP interface up.
• Use the net_interfaceDown( "ppp0" ) command to disconnect
the PPP interface and hang up.
NOTE
Use ppp1 as the PPP interface name for the GPRS interface.
<PPPPROTO_LIST>
<PPPPROTO name_id="ppp1" user="username" password="password" auth="pap"
next_media="gprs_layer"/>
</PPPPROTO_LIST>
<GPRS_LIST>
<GPRS name_id="gprs_layer" … other parameters … />
</GPRS_LIST>
</SETTINGS>
c Use the net_interfaceUp( "ppp1", NET_IP_V4 ) command to
connect to the modem and then bring the PPP interface.
d Use the net_interfaceDown( "ppp1" ) command to disconnect the
PPP interface and hang up.
NOTE
Use ppp0 as the PPP interface name.
b Use the OPTION tag Convoy the PPP over serial port parameters.
Example:
char p_option[NET_OPTION_MAX];
where,
• local_ip = terminal IP address
• remote_ip = server IP address
• com_port = serial port name (for exmple, /dev/ttyAMA1)
• speed = communication speed (for exmple, 19200)
c Use the net_optionSet( "ppp0", p_option ) command to write
the PPP over serial parameters to netconf.xml.
The result netconf.xml is:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<SETTINGS>
<PPPPROTO_LIST>
<PPPPROTO name_id="ppp0" user="username" password="password" auth="pap"
next_media="serial_port"/>
</PPPPROTO_LIST>
<OPTION_LIST>
<OPTION name_id="ppp0" option=" asyncmap 0 noauth noipdefault crtscts
local_ip:remote_ip com_port speed" />
</OPTION_LIST>
</SETTINGS>
d Use the net_interfaceUp( "ppp0", NET_IP_V4 ) command to
connect to the modem and then bring the PPP interface.
e Use the net_interfaceDown( "ppp0" ) command to disconnect the
PPP interface and hang up.
Management NET Service establishes communication sessions for applications. The following
Communication are supported session types:
Sessions for
Applications • TCP/IP (or SSL) over Ethernet
• TCP/IP (or SSL) over WIFI
• TCP/IP (or SSL) over PPP over Modem (PSTN, ISDN)
• TCP/IP (or SSL) over PPP over Serial Port
• TCP/IP (or SSL) over PPP over GPRS
• Modem direct calls
The application uses a configuration file (XML format) to perform communication
sessions through the NET Service. The configuration file uses communication
tags to describe the session type such as SSL over PPP over modem. It also
stores the corresponding parameters such as SSL certificates, PPP user name
and password, the phone number, and so on. Figure 19 shows how NET Services
facilitate application communications.
This function takes as parameter the configuration file in XML format, and
returns 0 on success or -1 on error.
2 Use net_sessionConnect() to start the communication session.
int handle = net_sessionConnect( int sessionType );
You can define more than one communication session (for example, SSL over
Wi-Fi and SSL over Ethernet) in the same XML configuration file. The
sessionType parameter selects which session to use first.
where,
• handle = the value returned by net_sessionConnect()
• data = the data to send to the peer. The structure definition is:
struct netDataTransfer
{
void *data;/**< array of bytes to transfer */
int data_count; /**< number of bytes to transfer */
};
where,
• handle = the value returned by net_sessionConnect()
• count = the number of bytes to read
• timeout = the number of seconds to wait for data
NOTE
On success (errno=0), the application must free the data in the
netDataTransfer structure.
where,
• handle = the value returned by net_sessionConnect()
This call releases the context. All handles are no longer valid.
<TAG1_LIST>
<TAG1 name_id="tag1 name" param1a="value" …param1n="value"
next_media="tag2 name"/>
</TAG1_LIST>
<TAG2_LIST>
<TAG2 name_id="tag2 name" param2a="value" …param2n="value" />
</TAG2_LIST>
</SETTINGS>
Every NET Service XML communication file begins with a SESSION tag. This is
mandatory. Each SESSION tag entry is uniquely identified by the name_id
parameter within the entire XML file (here session name). The next_media
parameters (tag1 name) links the SESSION tag to another tag in the XML file
(TAG1).
TAG1 indicates what the purpose of this session (for example, TCP/IP, SSL,
modem, and so on). TAG1 parameters (param1a … param1n) Convoy data for
TAG1 (for example, the IP address for a TCP/IP session or SSL certificates for
SSL).
TAG1 is uniquely identified by its name_id (tag1 name) within the entire XML
file. next_media refers to another tag (TAG2) in the XML file may be required to
fully work. For example, if TAG1 is TCP/IP, TAG2 can store parameters for
Ethernet, Wi-Fi, or PPP. Some tags such as SESSION require a next_media
parameter, and some don’t such as Ethernet, Wi-Fi.
Every NET Service communication file follows this structure.
• Protocols tags define SSL and TCP/IP layers in the configuration file.
TAG Name Description
SOCKPROTO TCP/IP socket parameters.
SSL SSL parameters.
• Modem tags define tags for modems and the GPRS layer. Modem tags can
link to a PPP layer or be used directly by a SESSION entry.
TAG Name Description
MODLINK PSTN modem parameters.
MODISDNLINK ISDN modem parameters.
GPRS GPRS parameters.
NOTE
A tag is defined by a list of attributes and their values. Not all attributes are
required. Mandatory attributes are written in bold in the following tables.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identification name of the media.
protocol char[8] tcp Socket type (for example, one
possible value is TCP).
remote_ip char[128] IP:PORT or DNS:PORT Server address and port number.
next_media char[32] Next media name Identifies the physical layer used
by this protocol such as Wi-Fi,
ETHERNET, or PPP.
Tag name: SSL
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies the SSL layer.
remote_ip char[128] IP:PORT or DNS:PORT Socket protocol.
server_profile char[128] Full path + file name Identifies the place where the
server CA is stored.
client_profile char[128] Full path + file name Identifies the place where the
client certificate and the client
private key are stored.
session_ttl int 0… Indicates in seconds how long
to keep the Resume Session
before performing a complete
handshake.
next_media char[32] Next media name Identifies the linked media.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies the name of the media.
usedhcp int 0, 1 1=DHCP is used
0 = DHCP not used
local_ip char[16] ip range Identifies the network adapter IP
address.
netmask char[16] ip range Network mask.
broadcast char[16] ip range Broadcast.
gateway uint8[16] ip range Gateway IP address.
Activate int 0,1 Indicates if this interface must be
activated.
Dhcpid char[16] The client id string for DHCP.
Clienthostname char[128] The client hostname string for
DHCP.
Speed char[16] (0, Auto), (1,100F), Defines the link speed as 10F,
(2, 10F), (3,100H), 100F, 10T, 100T, or AUTO (default
is AUTO).
(4,10H)
dns1 char[16] ip range Domain Name Server number 1.
dns2 char[16] ip range Domain Name Server number 2.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies the name of the media.
usedhcp int 0, 1 1=DHCP is used
0 = DHCP not used
local_ip char[16] ip range Identifies the network adapter IP address
netmask char[16] ip range Network mask.
broadcast char[16] ip range Broadcast.
gateway uint8[16] ip range Gateway IP address.
activate int 0,1 Indicates if this interface must be activated.
suppliconf char[16] Wi-Fi configuration security file location
(standard format).
dns1 char[16] ip range Domain Name Server number 1.
dns2 char[16] ip range Domain Name Server number 2.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies name of the media.
user char[32] User name for PPP.
password char[32] Password for PPP.
auth char[32] auto, chap, pap Authentication mode for PPP.
pppOption char[16] RFU.
next_media char[16] ip range Indicates the media used to connect the
PPP layer
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies the name of the
media.
number char[32] The phone number to
dial.
dial_type char 1=Tone, Identifies the dial tone
2=Pulse type.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies the name of
the media.
number char[32] The phone number to
dial
isdn_prot char (3, HDLC_SYNC_TO_ASYNC), ISDN transmission
(4, HDLC_TRANSPARENT), protocols.
(10, X75),
(20, X31_B_CHL),
(21, X31_D_CHL)
x25_packet_size char[5] 64 - 2048 Identifies the mode
as asynchronous or
synchronous.
facilities char[20] starting with 'G' Access to X.25
Closed User Group.
nui char[20] a-z, A-Z, 0-9 NUI (Network User
Identification) and
password with call
setup.
x25_number char[20] X.25 call number,
(X.25 B channel
only).
user_data char[20] User data starting
with D (without
protocol ID, data
length max. 16 char).
P with protocol ID,
data length max. 12
characters.
max_retries char 0… The maximum
number of dial
retries.
connect_timeout char Identifies the whether
the modem is waiting
for an answer. If
expired, there are no
more retries.
country_code char Identifies the country
code.
Attribute Accepted
Type Description
Name Values
name_id char[32] media name Identifies the name of the media.
APN char[32] GPRS access point name.
operator_id char Operator LAI number.
reg_mode char[5] 1 = AUTO Network registration mode.
2 = MANUAL
3 = AUTO_MANUAL
number char[32] Phone number for GSM data calls
(RFU).
bearer char[32] GSM Data modulation (RFU).
Attribute Accepted
Type Description
Name Values
name_id char[32] Media name of Identifies the name of the media.
another tag in
the XML file for
which this
option applies
option char[256] List of options.
NET Service This section provides XML example files for NET Service communication
Communication File structures.
Examples
TCP/IP Over Ethernet
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<SETTINGS>
<SESSION_LIST>
<SESSION name_id="eth-session" priority="1" timeout="10000" retry = "3"
next_media="tcp-layer" />
</SESSION_LIST>
<SOCKPROTO_LIST>
<SOCKPROTO name_id="tcp-layer" protocol="tcp"
remote_ip="www.verifone.com:80" next_media="eth-layer" />
</SOCKPROTO_LIST>
<ETHLINK_LIST>
<ETHLINK name_id="eth-layer" interface="eth0" usedhcp="1"/>
</ETHLINK_LIST>
</SETTINGS>
<SESSION_LIST>
<SESSION name_id="wifi-session" priority="1" next_media="tcp-layer"
timeout="10000" retry = "3"/>
</SESSION_LIST>
<SOCKPROTO_LIST>
SOCKPROTO name_id="tcp-layer" protocol="tcp"
remote_ip="www.google.com:80" next_media="wifi-iface" />
</SOCKPROTO_LIST>
<WIFI_LIST>
<WIFI name_id="wifi-iface" interface="eth0" usedhcp="yes" suppliconf="/
mnt/flash/etc/config/svcnet/wificfg.conf"/>
</WIFI_LIST>
</SETTINGS>
SSL is the tag for an SSL entry used with the following attributes:
• remote_ip: defines the server IP address to connect to.
• server_profile: specifies the path that contains the server CA root.
• client_profile: specifies the path that contains the client CA root and the
Private key.
NOTE • For server_profile, the server CA root name must be CA_Key.pem. For
example:
/tmp/CA_Key.pem
• For client_profile, the client CA root name must be CC_Key.pem and the
Private Key name is CP_Key.pem. For example:
/tmp/CA_Key.pem
/tmp/CP_Key.pem
• client_profile must be provided only when SSL mutual authentication is
required.
where,
• profile = client_profile
• password = the passphrase that protects the private key in plain text
• gshared is 1 if the passphrase is shared within the group, or 0 if it is private to
the application
Overriding the Default PCI - Cipher List
In some cases the application may need to use its own cipher list to connect to a
specific server. The application uses the net_sessionCipherList() API to indicate
to the NET Service layer which cipher suite applies for a specific profile. This API
can be called at any time.
o int net_sessionCipherList(char *profile, char *cipher, int gshared);
where,
• profile = server_profile
• cipher = the cipher suite used for a given server profile.
• gshared = 1 if the cipher suite is shared within the group, or 0 if it is private to
the application.
Default PCI - Cipher List
An SSL/PCI configuration file restricts the SSL ciphers to only those that are PCI
compatible. It allows defining the cipher suite used for SSL sessions if the
application is not providing one. The file is located at
/mnt/flash/etc/config/svcnet/cipher_pci.xml
This file is loaded only when the application is not providing its own cipher suite.
916 V/OS PROGRAMMERS MANUAL
V/OS ON THE VX TERMINAL
NET Services
where,
• pciciphersuite = the PCI cipher suite string.
• cipher_id="1" This is reserved for future use, and is always 1.
NOTE • If the cipher_pci.xml file is not present and the application does not provide
one, the default OpenSSL cipher list applies.
• Applications cannot change the PCI cipher suite.
<SESSION_LIST>
<SESSION name_id="ppp-session" next_media="tcp-layer" priority="1"
timeout="3000" retry="1" />
</SESSION_LIST>
<SOCKPROTO_LIST>
<SOCKPROTO name_id=" tcp-layer " next_media="ppp-modem" protocol="TCP"
remote_ip="www.verifone.com:80" />
</SOCKPROTO_LIST>
<PPPPROTO_LIST>
<PPPPROTO name_id=" ppp-modem" user="magic" password="isdn" auth="pap"
pppOption="" next_media="modem_isdn"/>
</PPPPROTO_LIST>
<MODLINK_LIST>
<MODLINK name_id="modem_isdn" number="0820903002" dial_type="1" mode="2"
max_retries="1" max_line_rate="12" connect_timeout="30"
error_correction="1" compression="1"/>
</MODLINK_LIST>
<OPTION_LIST>
<OPTION name_id=" ppp-modem" option="asyncmap 0 noauth noipdefault
usepeerdns lcp-echo-interval 3 lcp-echo-failure 2"/>
<OPTION name_id="modem_uart" option="file /tmp/usrcmdfile_pstn1.txt"/>
</OPTION_LIST>
</SETTINGS>
Creating a Applications may need to create an XML communication file. This section
Communication File describes how to do that using the NET Service API.
Dynamically
Each communication type (TCP/IP, SSL, Wi-Fi) has a corresponding descriptor
structure defined in svc_net.h. This structure writes data in the XML
communication file or reads from it. NET Service associates each communication
family (Socket, SSL, Wi-Fi) with a fixed communication type value, COM Type,
which are also defined in svc_net.h. Descriptors and COM types create and
modify the XML files.
Table 14 lists all NET Service communication descriptors and corresponding COM
types.
Table 14 NET Service COM Types
Name Tag COM Type Description
sessionDescriptor SESSION NETCOM_SESSION Parameters for SESSION tags.
socketDescriptor SOCKPROTO NETCOM_SOCKPROTO Parameters for socket tags.
sslDescriptor SSL NETCOM_SSL Parameters for SSL tags.
ethernetDescriptor ETHLINK NETCOM_ETHLINK Parameters for Ethernet tags.
wifiDescriptor WIFI NETCOM_WIFI Parameters for Wi-Fi tags.
pppDescriptor PPPPROTO NETCOM_PPPPROTO Parameters for PPP tags.
modemDescriptor MODLINK NETCOM_MODLINK Parameters for PSTN modem tags.
modemIsdnDescriptor MODISDNLINK NETCOM_MODISDNLINK Parameters for ISDN modem tags.
gprsDescriptor GPRS NETCOM_GPRS Parameters for GPRS tags.
gprsDescriptor OPTION NETCOM_OPTION Parameters for Option tags.
If the path /tmp/com_file.xml does not exist, it is created at the end of the
process.
3 Fill the socket descriptor parameters:
strncpy( sckDesc.name, "socket", strlen("socket") );
/** value for name_id*/
strncpy( sckDesc.protocol, "tcp", strlen("tcp") );
strncpy( sckDesc.remote_ip, "www.verifone.com:80",
strlen("www.verifone.com:80") );
strncpy( sckDesc. nextMedia, "eth-layer", strlen("eth-layer") );
/* value for next_media */
The data is stored in the context, but is not saved in the destination file until
the next step.
6 Save the file.
int ret = net_sessionSave( "/tmp/com_file.xml" );
You can use a different filename. The existing file is not modified.
The result /tmp/com_file.xml is:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<SETTINGS>
<SOCKPROTO_LIST>
SOCKPROTO name_id="socket" protocol="tcp" remote_ip="www.verifone.com:80"
next_media="eth-layer" />
</SOCKPROTO_LIST>
</SETTINGS>
NOTE
/tmp/com_file.xml must be an existing file.
NOTE
If errno is 0 (success), the caller must free the netDataTransfer structure.
NET Service API • See NET Service API for API descriptions.
• See NET Service Constants for information on constants.
• See NET Service Structures for information on structures.
Sysmode The following are menus are available when the sysmode application is running:
Application
Information
• Basic info: Displays general information on the unit (S/N, P/N, revision, model,
and so on), and low-level software (Linux kernel, U-Boot, SBI, and so on)
• Ports/Options: Displays COM ports states
• Software: Lists installed software
• Memory: Displays flash memory and RAM usage
• Logs: Displays the tamper and installation logs
• Counters: Displays the internal counters (PIN entries, SC insertions, and so
on)
Administration
• Date/Time: Configure the system date and time
• Network: Configure and display information on network interfaces
• MMS: Configure the remote MMS server
• Remove: Remove selected or all user bundles.
NOTE
This feature cannot remove OS/system bundles.
Update
• USB Memory: Browse the USB device and install selected software
• Serial: Install update over the serial link (only with the Mx800Downloader
application on COM1 only)
• Netloader: Install applications over Ethernet (only with the Mx800Downloader
application)
• MMS: Initiate a session with the MagIC Management system to update S/W
configuration remotely
Security
• Key loading
• Load Bank/VRK keys using serial link (COM1 only). Access is restricted
with two key loader passwords.
• Perso Pinpad: Create key pair and build certificate using a smartcard for
mutual authentication V/OS-PINpad
• Tamper status: Display security status
• Key list: Display loaded secure keys/scripts (RKL, VSS, DUKPT, and MS), and
also displays status on P-Series authentication
• Password Mgr: Change user and key load passwords or expired password
• Verishield tree: List all installed Verifshield keys
• Removal Switch: (ARS management) Displays information about removal
switch status and reset removal switch status
Diagnostic
• Display: Performs the display diagnostic test - attempting to display the bitmap
on it.
• (VX 520) Keyboard: Displays the matrix with the keys. Pressing a key
increases the counter number for that key value. There is no button to return
to previous menu. If no keys are pressed in 5 seconds, the diagnostic test
automatically exits.
• Card
• Smart Card: Test performs the smart card device diagnostics
• Magstripe: Test performs the magnetic stripe device diagnostics
• Contactless: Test performs the Contactless device diagnostics (if
connected)
• Communications
• Ethernet: Ethernet connection diagnostics (ping test)
• Serial: Serial loop-back diagnostics. For this test to work correctly, the
loop-back cable shown in Figure 21 is required.
NOTE
Insert the loop-back cable into serial port 1 (COM1) with NO console enabled.
VX 520 Special This section describes OS variants for the VX 520 terminal, including:
Features
NOTE
When the Sysmode Application launches, the keyboard buzzer is disabled.
Color LCD You must make the following changes to the CIB and LCD driver files to support
the VX 520 terminal:
• Change the resolution entry to 320*240(landscape)
• The ATM keys are replaced with a 4-way navigation key
GPRS Radio The VX 525 3G terminal has the following criteria for the GPRS radio, SIM, and
UART:
• GPRS_Type = GPRS_INTERFACE_TYPE_USB_HOST "2"
• GPRS_ControllerID = GPRS_CONTROLLER_ID_PHS8P "3"
• GPRS_ControllerID = GPRS_CONTROLLER_ID_PHS8P_NOGPS
• DUAL_SIM = DUAL_SIM_WITH_DETECT "1", or
• DUAL_SIM = DUAL_SIM_NO_DETECT "2"
• UART_1_type 0x30 UART_1_INTERFACE_NONE
VX 675 Special This section describes OS variants for the VX 675 terminal, including:
Features • Comm Engine
• Network Control Panel
• Drivers
• Battery
• PMIC
• Keypad
• Color LCD
• Terminal Types
Comm Engine The Comm Engine uses the HWCIB.ini file to determine supported
communications devices in the terminal. Ensure that the following changes are
made to the HWCIB.ini:
• Add the following section to define GPRS, GSM-PPP, and GSM dial support:
[GPRS-88-GPRS]
commtech= GPRS
devdrvname = GPCTBGS2
drvtype = PPP
signal = 1
devname =
startmode =
shared =
[GPRS-88-PPPGSM]
commtech = PPP/GSM
devdrvname = GSCTBGS2
drvtype = PPP
signal = 1
devname =
startmode =
shared =
[GPRS-88-GSM]
commtech= GSM
devdrvname = GSCTBGS2
drvtype = DIAL
devname =
shared =
Network Control The Network Control Panel (NCP) identifies the user interface such as display and
Panel keyboard layout that are available in terminal using the CIB information in APIs.
The following are VX 675 terminal specific criteria:
• The battery icon is “Five-value battery icon.” A numeric value does not display
in get_battery_value(), and the REMAININGCHARGE parameter only returns
0%–75%.
• The NCP supports the VX 675 keypad with 5-way navigation keys that
navigate NCP menu
• The VX 675 has no alpha key, but has a phone type character input.
• The NCP relies on SVC_INFO_KEYBRD_TYPE() to determine the terminal
keypad. Return values are:
SVC_INFO_DEV_TYPE(INFO_PRES_TOUCH)
Prototype
SVC_INFO_DEV_TYPE( INFO_PRES_TOUCH );
Return Values
The return value is 0.
SVC_INFO_PRNTR()
Prototype
SVC_INFO_PRNTR(<output parameter/printer ID>);
Parameters
output parameter Success.
printer ID Printer ID is
Return Values
Battery The following are the battery state APIs required by DDI GPRS library to perform
power management routines:
SVC_INFO_BAT_REQ()
Use this call when a battery is required by the terminal to operate the GPRS radio
and for SIM protection. Use the powermngt_get_sufficient_battery() call to
determine battery charge state.
NOTE When the terminal is running on battery, not all the devices can run at the same
time (for example, printer, CTLS, GPRS, and so on). This is managed by the
application choosing which devices should run, and which should be off.
Prototype
SVC_INFO_BAT_REQ(char * one_char);
Parameters
Need definitions
char
one_char
Return Values
? 0 The battery is required by the terminal to operate the GPRS radio only.
• kmod-vf210x_video/bcm5892_bl.c
• kmod-vf210x_radio/radio_hw.c
• kmod-vf210x_led/led.c (if required)
• u-boot/drivers/misc/vf210x_led.c (if required)
The VX 675 uses the V/OS Power Management Functions, but has the following
enhancements:
• Client applications can report busy/idle status
• Client applications can create timers to wake up the system
Keypad The VX 675 terminal does not support a touch screen, but has a phone style
keypad layout. There is a 5-way navigation key with a confirm button. Table 16
compares the VX 675 keymap to the V/OS standard keymap.
Table 16 VX 675 Keymap
V/OS Standard
VX 525 Key Code
Key Code
F1 ('z') Nav. Up ('Z')
F2 ('{') Nav. Down ('[')
F3 ('|') Nav. Left ('\')
F4 ('}') Nav. Right (']')
Alpha (0x0F) Select/Confirm ('^')
Color LCD You must make the following changes to the CIB and LCD driver files to support
the VX 675 terminal:
• Change the resolution entry from 240*320(portrait) to 320*240(landscape)
• Modify kmod-vf210x_video/bcm5892_lcd.c how?
• Dial-up modem
• Ethernet
You must make the following changes to support your base configuration:
• Modem library: Modify this library to include the USB modem.
• Bluetooth connectivity is based on the btDevice Struct Reference.
VX 820 Touch VX 820 touch capture technology supports Stylus Priority, which means that if a
Panel finger and the stylus are placed on the panel, the position input comes from the
stylus and the finger is ignored. Stylus Priority mode is enabled by default.
Touch Panel VX
Specifications
X-axis values 0 … 1023
Y-axis values 0 … 1023
Z-axis values 0…1
Sample Rate is always 200
Raw capture resolution (x,y) 1023 x 1024
Display Dimensions (x,y) 2.10 x 2.80
Display resolution (x,y) 240 x 320
Capture resolution (x,y) dpi: 488 x 366
Signature Capture Rate pps 200
Non-signature Capture Rate pps 200
VX Terminal Signature Capture is implemented as a widget. The widget supports the definition
Signature of a signing region as well as the ability to track stylus movement. Note that the
Capture strokes returned by the Signature Capture widget are scaled to 320x234 (72dpi).
Functions Use the following calls to read and process the raw data for higher resolution
images.
NOTE
During signature capture with a stylus connected, the unit switches to stylus-only
mode.
#include "svc.h"
#include "sig.h"
typedef struct {
long x : 12; // X co-ordinate 0…1880 of touched point
long y : 12; // Y co-ordinate 0…1360 of touched point
long z : 8; // Z co-ordinate/pressure 0…63 of touched point
} __attribute__((packed)) xyz_t;
This is a representation of the x,y,z value of a single touched point packed into
32-bits – x,y, and z are signed quantities.
Also defines PENUP, which has the value:
{.x = -1, .y = -1, .z = -1}
SigCapCount()
Prototype
int SigCapCount(void);
SigCapGet()
Copies up to maxPoints of data from the kernel buffer to the user buffer. Returns
the number of points actually copied, which is less than maxPoints if fewer
points are available.
Use SigCapCount() to retrieve the number of points captured. Ensure that the
buffer is large enough to hold the number of points captured. For example, if
SigCapCount returns 1000, then the buffer must be (xyz_t)*1000 bytes.
Prototype
int SigCapGet(void *data, int maxPoints);
SigCapBoxApply()
Applies a signature box to the data in the results of SigCapGet(). Data outside
the box is replaced by PENUP. The data is also compressed to remove adjacent
duplicate points and adjacent PENUPs. The function returns the new number of
unique points.
The application supplies the signature box to the function call.
The box coordinates are in screen format, that is:
• x = 0...479 and y = 0...271 for Mx915 terminals
• x = 0...799, y = 0...479 for Mx925 terminals
Signature data is in touch panel coordinates 0…1880 and 0…1360 for best
resolution. It is not necessary to call this function before calling SigCap2Tiff().
Prototype
int SigCapBoxApply(xyz_t *Sig, int count, SigCapBox_t *box);
vf_sig_cature_options()
Sets the rendering options (signature thickness bits) according to the union
pointed to by the argument. It controls only how the signature looks on the screen.
Note that a separate method in the TIFF function calls control thickening of
signature lines in the TIFF file.
To retrieve the call and the union definitions:
#include vf_sig_capture.h
Prototype
void vf_sig_cature_options(union renderOptions *ro);
union renderOptions
{
struct
int xminus1yminus1 : 1;
int xyminus1 : 1;
int xplus1yminus1 : 1;
int xminus1y : 1;
int xy : 1;
int xplus1y : 1;
int xminus1yplus1 : 1;
int xyplus1 : 1;
int xplus1yplus1 : 1;
} __attribute__((packed));
int options;
};
union structure represents a bit map of pixels to plot in addition to the original
pixel when a line is rendered using Bresenham’s algorithm. The options are
specified as either a bit field or an absolute value from 0 ... 511. This is how the
bits are mapped to pixels:
A null pointer causes a local static copy of union to be cleared; otherwise the
union pointed to is copied into the local static copy. A cleared union is the
power-up default and means that only the original point x,y is plotted with no
thickening. This also provides runtime-savings as there is no scanning of
individual bits when the union is clear.
To plot point (x,y) as well as (x+1,y) and (x,y+1) to get a thicker line use:
vf_sig_capture_render_options(&(union renderOptions){.options = 0x0b0});
VX Terminal VX terminals have a thermal printer. To access the printer, link to the libvfiltp.so
Thermal Printer shared library. The application uses the printer.h header file to access the library.
enum printer_e_inverse_color
{
PRINT_WHITE = 0,
PRINT_BLACK = 0xFF,
};
typedef struct
{
int OutOfPaper;
int JobsInFifo;
int CurrentJob;
} PrintStatus;
Printer_PrintText()
Create a monochrome bitmap of text and send data to the FIFO. This call is non-
blocking.
Prototype
int Printer_PrintText(const char *buf, int length);
Parameters
IN const char *buf NULL terminated text string.
Return Values
Job ID Successful write to printer FIFO.
PRINTER_OUT_OF_PAPER No paper.
Printer_PrintLine()
Create a monochrome bitmap of pixel lines and write a file to the FIFO. This call is
non-blocking.
Prototype
int Printer_PrintLine(int line_num , int inverse);
Parameters
IN int line_num Number of pixel lines.
Return Values
Job ID Successful write to printer FIFO.
PRINTER_OUT_OF_PAPER No paper.
Printer_PrintBitMap()
Prototype
int Printer_PrintBitMap(const char *buf , int Length);
Parameters
IN const char *buf Bitmap data
Return Values
Job ID Successful write to printer FIFO.
PRINTER_OUT_OF_PAPER No paper.
Printer_SetFont()
Choose an available ttf font file. The default printer font file is Vera.ttf.
Prototype
int PrinterSetFont(char * FontName);
Parameters
IN char *font_name Font filename; or a NULL terminated text string.
Return Values
PRINTER_OK Success
Printer_SetFontSize()
Set available ttf font size in mm. Default font size is 4mm.
Prototype
int Printer_SetFontSize(int size);
Parameters
int size Font size in millimeters.
Return Values
PRINTER_OK Success
Printer_GetStatus()
Prototype
int Printer_GetStatus(PrinterStatus *Status);
Parameters
IN const PrinterStatus *Status Pointer to the PrinterStatus structure.
Return Values
PRINTER_OK Success
PRINTER_ERROR Error
Printer_WaitReady()
Prototype
int Printer_WaitReady(unsigned int job_id, unsigned int timeout);
Parameters
IN unsigned int timeout Printer timeout in seconds. This is always a positive
number.
IN unsigned int job_id job_id to wait until complete. This is always a positive
number:
• == 0: Wait for all print jobs in the queue.
Return Values
PRINTER_OK Successful print.
PRINTER_OUT_OF_PAPER No paper.
Printer_WaitPaper()
Prototype
int Printer_WaitPaper(unsigned int timeout);
Parameters
int timeout Timeout until paper is loaded.
Return Values
PRINTER_OK Paper loaded.
PRINTER_OUT_OF_PAPER No paper.
Printer_CancelPrint()
Prototype
void Printer_CancelPrint(void);
Printer_OutOfPaperEvent()
Parameters
IN function pointer Callback
Return Values
PRINTER_OK Success
PAYware Vision
vpInit()
Prototype
int vpInit(vp_parm_t *pstVP);
typedef struct {
int iOptions;
char chSeperator;
void *fnUpData;
void *fnUpDisconnect;
int *fnDownReq;
void *fnDownFileStatus;
void *fnTimedOut;
} vp_parm_t;
Parameters
vp_parm_t
*pstVP
Return Values
vpParseFields()
Parses the input buffer into the field arrays. STX should not be in the input buffer.
Prototype
int vpParseFields(char *pchInBuf, vp_field_t *pszField, char *pszSep);
typedef struct {
key[];
value[];
} vp_field_t;
Parameters
*pchInBuf Input data stream to parse.
*pszField Pointer to array of vp_field_t to store parsed strings.
*pszSep Pointer to field separator a character string.
Return Values
Returns items in the array or error.
The first index usually returns the command in key with no value.
vpSendPacket()
Sends the packet to VP server after adding the wrappers. This call is used for both
Up and Down Channel messages.
Prototype
int vpSendPacket(int iFd, int iOptions, unsigned short ushMsgNum,
char *pchOutBuf, unsigned short ushLength);
Parameters
iFd Socket fd.
iOptions Bit-defined options:
• 0x0004 – Secure Socket
• 0x0002 – Wait for ACK
Return Values
Bytes sent or error.
The VP library waits for ACK and then retries, if required, before returning.
vpCreateXTRMCFGString()
Prototype
void vpCreateXTRMCFGString (char *pchOutBuf, char *pchEcho, int iOptions);
Parameters
*pchOutBuf Pointer to data buffer to store XTRMCFG message.
*pchEcho Pointer to data containing the Echo string. If null, the ECHOSTRING
field is not sent.
iOptions Bit-defined options, where only bit 2 is checked to determine if the
data is secure or not.
vpExit()
Closes the VP connections, frees memory, and exits the application. Applications
should call vpExit() to gracefully exit.
Prototype
int vpExit(int iFd);
Parameters
vpCloseUp()
Prototype
int vpCloseUp(int iFd);
Parameters
vpVersion()
Prototype
void vpVersion(char *pchVersion);
Parameters
*pchVersion
Return Values
VP Library version string.
vpCloseDown()
Prototype
Int vpCloseDown(void);
fnDownReq()
Called after a REQ packet is received on the Down Channel. The application can:
• Allow or disallow this command to proceed
• Perform the request and detail the result
If this callback function is not provided, all REQ commands are allowed to run.
The VP library sends an ACK prior to issuing this callback.
System mode may use call this to display download status.
Prototype
int fnDownReq(int iDownFd, int iFieldCount, vp_field_t *pszFields);
typedef struct
{
char key[MAX_KEY_SIZE];
char value[MAX_VALUE_SIZE];
} vp_field_t;
Parameters
iDownFd Socket fd of Down Channel.
iFieldCount Number of fields in the array.
*pszFields Pointer to array of the field structure.
Return Values
• >0 Allow
fnDownFileStatus()
Called after a file successfully received from the XFTPGET command on the
Down Channel is to be acted on. The application must handle the download file
and ApplyOnDate logic.
Prototype
void fnDownFileStatus(int iStatus, int iFieldCount,
vp_field_t *pszFields);
Parameters
iStatus Status of FTP operation:
• < 0 Error
• = 0 Done
• > 0 bytes or percentage of completion
fnUpData()
Called when response data is received on the Up Channel. The VP library sends
an ACK prior to issuing this callback.
Prototype
int fnUpData(unsigned short ushDataSize, unsigned short ushMsgNum,
char *pchData);
Parameters
ushDataSize Contains the size of data in *pchData.
ushMsgNum Contains the message number.
*pchData Contains the response data.
fnUpDisconnect()
Called when the Up Channel is disconnected. The VP library closes and cleans up
the socket connection.
Prototype
void fnUpDisconnect(void);
fnTimedOut()
Called when ACKs are not received within the timeout period for the Down
Channel Response message.
NOTE
For the Up Channel, the application is responsible for the protocol timeouts.
Prototype
void fnTimedOut(void);
This chapter describes the IPP support functions ported from the TXO platforms:
• ipp_getpin()
• ipp_read()
• ipp_abort()
• ipp_diag()
• ipp_mac()
• select_key_mgmnt()
• get_key_mgmnt()
• getKeyStatus()
These functions are the front end to the IPP functions. All limitations of IPP
emulation listed in the Chapter 16 apply to this set of functions.
There are several differences between the Omni 7xxx functions and the V/OS
terminal functions due to the underlying architecture:
• PIN exhaustion protection implemented differently (see ippWrite(), page 245).
• In V/OS terminals, a token must be available when starting the PIN
session. If no token is available, ipp_getpin() returns -2.
• In the Omni 7xxx, a token must be available when returning the
encrypted PIN block. ipp_read() returns -5 until one is available.
• In V/OS terminals, some parameter checking is done initially. For example,
ipp_getpin() returns -3 for invalid minimum PIN length, invalid maximum
PIN length, invalid master key number, or invalid working key string. In the
Omni 7xxx, those errors are reported by ipp_read().
• In V/OS terminals, the ipp_read() return value does not go through all the
intermediate states that the Omni 7xxx’s does. For example, the values -3, -4,
and -5 are never returned by ipp_read() on the V/OS terminal.
• There is no IPP trap mechanism on V/OS terminals.
• Interac mode support functions are not implemented on V/OS terminals.
Interac support is through the Security Script.
All legacy IPP functions are defined in ippleg.h.
Applications must link with the libvfileg.so and libvfisec.so libraries
using -lvfileg and -lvfisec.
Applications must call ippOpen() before using any legacy IPP functions.
ipp_getpin()
Pass the appropriate parameters to define PIN entry. Before issuing this
command, setSecurePINDisplayParameters() must be used to register the
PIN feedback callback function. See SetSecurePINDisplayParameters(),
page 246.
Once ipp_getpin() executes touch panel data is no longer accessible to the
application and is routed directly to the internal software. As each digit of the PIN
is entered, an event echoes to the application through the callback function. Illegal
keys are ignored. Pressing [CLEAR] aborts the session
Encryption of the PIN is performed internally by the system hardware immediately
after the PIN is entered and [ENTER] pressed. Raw PIN data is never available to
the application. After issuing this command, use ipp_read() to collect the
encrypted PIN information.
Prototype
result = ipp_getpin(key_type, disp_line, min_pin_len, max_pin_len,
zero_pin_ok, max_time, pan, working_key, master_key);
Parameters
working_key
1DES Mode 16 characters; null terminated for Master Key
Session, ignored for DUKP.
master_key 1 character: (0...9) for Master Key Session, (0...2) for DUKPT to
select DUKPT engine.
Return Values
• =0 Success
ipp_read()
intresult;
unsigned int size;
char *buffer;
Parameters
buffer User-defined buffer in the application space to store the data.
size The number of bytes to read.
Return Values
• =0 IPP idle
NOTE
Some events occur so quickly that it may not be possible to see the status code.
Return values >0 indicate that the packet is interpreted as described below.
ipp_mac()
Perform a MAC calculation on the user data in Hex ASCII format to build Z66
MAC packets. A Z66 packet with a “6” flag indicates the last binary data packet;
Z66 with a “7” flag indicates a first or middle binary data packet.
Prototype
return = ipp_mac(master_key, working_key, second_key, message,
message_length, result);
int return;
unsigned int message_length;
char master_key, second_key, *working_key, *message, *result;
Parameters
master_key ASCII "0...9" selects master key number. Pass as null (0) to
indicate there is no master key.
working_key
1DES Mode 16 characters, null terminated
Return Values
• 1 Success
• -1 Master Key Pointer error
• -2 Second Key Pointer error
• -3 Message length too large
• -4 Wrong block Size
• -5 Communication error
The MAC value result is placed in the users buffer, formatted as:
ipp_abort()
Prototype
return = ipp_abort(void);
int return;
Return Values
• =0 Success
• -1 Abort failed
NOTE
0 returns if PIN collection is not running when this function is called.
ipp_diag()
Execute various IPP diagnostics. The application uses this function to check
information on the IPP firmware and perform 1DES test encryptions.
Prototype
return = ipp_diag(test_type, result, master_key);
int return, test_type, master_key;
char *result;
Parameters
test_type Type of test to perform:
0 ROM checksum test
result Pointer to a buffer big enough to hold the results: min 17 bytes
for tests 0–2, and 150 bytes for tests 3–4.
master_key Master Key slot number for performing test 3.
DUKPT engine for performing test 4.
Return Values
• =0 Success
• -1 Error
All strings are null terminated. For DUKPT and Master Session Encryption tests,
the usual prompts for necessary information are hard coded for the purpose of this
diagnostic. The values for this information are:
PIN 1234
NOTE
Keys loaded for Master Session and DUKPT must be 1DES compatible.
select_key_mgmnt()
Selects the Key Management method, and allows selection of Master Session
and DUKPT methods: either Single DES (1DES) or Triple DES (3DES). Also
Secure Messaging and Zero Key support.
Prototype
return = select_key_mgmnt(kmm, demf);
int return;
unsigned char kmm, demf;
Parameters
XXXXXX-- Reserved
Return Values
• =0 Success
get_key_mgmnt()
Prototype
return = get_key_mgmnt(kmm, demf);
int return;
char *kmm, *demf;
Parameters
XXXXXX-- Reserved
Return Values
• =0 Success
The returned values are in the users variables kmm and demf.
getKeyStatus()
Prototype
return = getKeyStatus(int *keyStatus, int length);
int return;
int *keyStatus;
int length;
Parameters
keyStatus Pointer to an array of integers
length Number of integers in the array
1 = Key loaded
0 = No key loaded
15–30 USR1–16 Bit fields define which key slots are loaded.
User Keys 0x001:Slot 0
0x002:Slot 1
0x004:Slot 2
0x008:Slot 3
0x010:Slot 4
0x020:Slot 5
0x040:Slot 6
0x080:Slot 7
0x100:Slot 8
0x200:Slot 9
1 = Key loaded
0 = No key loaded
PCI 4 Compliance
V/OS terminals support PCI compliance level 4 (PCI 4). This chapter discusses
the changes that impact the people who manufacture, deploy, and repair V/OS
PCI 4 devices; the changes that must be made at the application level; and the
changes that are recommended at the application level.
NOTE
MX9 series terminals are the first PCI 4-certified devices for Verifone. This
chapter focuses on PCI 4 support on MX9 terminals.
Identifying PCI 4 The hardware P/N can be displayed by accessing System Mode via
Compliance INFORMATION>BASIC SYSTEMS tab. On OS version 3014xxxx and later, MX9
Devices supports a new API to identify if hardware is PCI 4 compliant:
include <platforminfo_api.h>
unsigned int hardware_id = 0;
unsigned long size = 0;
if (platforminfo_get(PI_ADC0_HARDWARE_ID, &hardware_id, sizeof
hardware_id, &size) == PI_OK)
{
If (hardware_id & PI_ADC0_HARDARE_ID_PCI4)
printf(“This is a PCI 4 unit!\n”);
else
printf(“This is not a PCI 4 unit\n”);
}
Applications can use this API to adjust their behavior depending on the PCI level
supported by the hardware platform.
Sensitive PCI 4 imposes the following rules for sensitive password handling:
Passwords • Passwords must be a minimum of seven (7) characters.
• Passwords must be unique in the system.
Keyloading passwords and ARS clearing passwords (not used on MX) are all
sensitive passwords (System Mode entry passwords are not considered sensitive
passwords). The two keyloading passwords have a minimum of seven (7)
characters. No two passwords can be set to the same value.
This rule applies to both sensitive passwords and non-sensitive passwords. When
passwords are changed, the system compares the new password with all the
existing passwords and if the password already exists, the new password is
rejected. This forces the user to enter a different password.
CAUTION PCI 4 now prohibits deployment and repair to enter the default value and change
the password to the default value reversed, when injecting keys on the MX9
product line.
Application PCI-4 requires some changes that must be made to the V/OS that in turn require
Level Changes changes to the application.
24-Hour Reboot This requirement ensures that all memory in the device is re-initialized at least
once every 24 hours. This means that if an existing application is put on a PCI 4
V/OS device, that application will reboot approximately 24 hours from the time it is
powered up or from the time of the last reboot.
CAUTION The critical part of this rule is that the reboot may occur in the middle of a
transaction or some other critical task, hence, proper timing of reboot should be
considered.
For Example, a retailer that closes at 9:00 in the evening could set the reboot
time for 12:00 A.M., and the unit will safely reboot each day. Powering off the
unit when the store is closed will work too and helps conserve a little energy.
The 24-hour reboot time can also be set via an application downloaded
configuration parameter. The variable name is *24hrreboot and the value
NOTE The unit must be rebooted after setting the reboot time in order for it to take
effect. Be sure that the clock on the unit is set accurately for the location of the
device.
2 The application can monitor the time when the forced reboot will occur and it
can perform a preemptive reboot at a time that will have no customer impact.
The 24-hour reboot mechanism uses the Linux uptime count to determine
when to perform the forced reboot. The application can read the same value
and know when the reboot will occur and issue a controlled reboot during an
idle period where it is unlikely to be noticed.
To read the current system up time, the application can call the following:
#include <time.h>
Unsigned Packages’ The destination for unsigned packages had been moved to a new location to
New Destination achieve PCI 4 certification. The original destination for unsigned packages used to
be the user’s flash directory (i.e. /mnt/flash/userdata/usr<x>). For
example, usr1 would have a flash directory on /mnt/flash/userdata/usr1.
All users have a symbolic link named ‘flash’ in their home directory. The symbolic
link will point to the user’s specific flash directory.
Multi-Application PCI 4 allows only one application to have access to the MSR at any given time.
Access to Magnetic Prior to this, a legacy feature of MX8 would have allowed multiple applications to
Stripe Reader (MSR) open and read the data returned from the MSR. This lets multiple applications
Disabled access card data independently and then decide which application would process
the transaction depending on the card data. This behavior is now unacceptable
under PCI 4.
This means that on PCI 4 devices, only one application can open the MSR device
(via msrOpen() API) at a time. A second call to open the MSR will result in a
return value of EBUSY, which signals that the device is open and not available.
One suggestion is for the application to create a process that reads the MSR data
and then routes it to the appropriate application for further processing.
Hardening
Compiler and linker flags can be set to improve the robustness and integrity of the
application. Verifone recommends using the following options:
CFLAGS = -O2 -fstack-protector-all -D_FORTIFY_SOURCE=2 -fpie
-fPIE -Wl,-z,relro,-z,now -Wall -Wextra -Wformat=2 -Wswitch-
default -Wswitch-enum.
Security
CFLAGS
Functionality
Stack protector -fstack-protector-all
Fortify source -D_FORTIFY_SOURCE=2
User space ASLR -fpie -fPIE
GOT protection -z,relro,-z,now
Compile time warning -O2 -Wextra -Wformat=2 -Wswitch-default -Wswitch-enum -Wconversion
Random Numbers
Applications should use a PCI-approved Random Number Generator (RNG). This
means that applications needing random numbers directly should call either of the
following:
• The Vault Random Number Generator API generate_random()
• /dev/urandom or /dev/random where generate_random()is called to
get the random bytes.
OpenSSL
It is recommended that TLSv1.2 be used where possible. Applications that are
using OpenSSL for SSL/TLS directly or as part of SSH should:
• Call vfiSec_set_vault_rand_method() in libvfiVaultapi.so (see
vficrypt.h), to set the RNG used by OpenSSL to be the Vault Random
Number Generator.
• This impacts the calling application only (other applications will be unaffected
since each application gets a separate instance of a library it links against).
Documentation
Refer to Security Policy document, which contains security guidance for users and
application developers.
O vpInit( ) 948
os packages 57 vpParseFields( ) 950
osflash package 58 vpSendPacket( ) 951
osflash packages 68 vpVersion( ) 955
P PCD 648
p7s signature file 57 PEK (PIN Encryption Key) 252
package control file 63 PICC 645, 648
packages PIN encryption 251
app 58 ping 500
config 72 Power Management configuration 121
control file 63 Power Management functions 119
group field 70 powermngt_CritcalSectionEnter( ) 127
creating 81 powermngt_CritcalSectionExit( ) 128
default type 69 powermngt_get_config( ) 121
env file 65 powermngt_get_wakeupdevices( ) 134
flashconfig 73 powermngt_GetEvent( ) 131
grsec file 65 powermngt_GetInfo( ) 130
grsecurity 66 powermngt_getVersion( ) 120
grsecurity policy file 66 powermngt_set_config( ) 123
install 57, 62 powermngt_set_wakeupdevices( ) 135
library files 70 powermngt_SetWakeupTime( ) 126
lowlayers 69 powermngt_Shutdown( ) 125
os 57 powermngt_Standby( ) 133
osflash 68 powermngt_Susspend( ) 132
patch 75 Power Setting screen 118
service 71 production environment signer cards 82
signed 57 properties for Services 164
start file’start file 65 public key RSA computation 558
system app 58 R
types 57, 64 reboot 86
unsigned 74 remove file 76
user 69 commands 79
userflash 70 definition 79
vss 73 root file system (RFS) 57
packagesfile system (fs) 67 RTC functions
packet mode 597 setRTC( ) 570
Packet Mode functions S
endPktMode() 599 SCGI daemon manager 174
packetRX() 600 SCGI support library 175
startPktMode() 598 Secure Installer error codes 108
pairlist 159 Secure Installer functions 84
passwords 573 Secins_close_pkglist( ) 91
lifecycle 576 Secins_config_file_share_gid( ) 99
patch bundles 77 Secins_install_pkgs( ) 85
patch packages 75 Secins_read_pkglist_entry( ) 89
pathnames 59 Secins_reboot( ) 86
PAYware Vision 947 Secins_share_gid( ) 93
PAYware Vision functions Secins_start_app( ) 88
vpCloseDown( ) 956 Secins_start_user_apps( ) 87
vpCloseUp( ) 954 Secins_strerror( ) 92
vpCreateXTRMCFGString( ) 952 Secins_sys_app( ) 97
vpExit( ) 953 Secins_sysmode_share_gid( ) 98
net_wifiStart( ) 496
net_wifiStop( ) 497
wlan.conf 450
WPA Supplicant 450
X
XML parser 140
XML service 143
V/OS
Programmers Manual