Quantaq

Menu

LongUnderLine
Opiah Home Page
Home > Products > USIM Commander > User Guide


User Guide

Scripting is easy! Here are some example scripts, which may be a useful starting point:

Read data from a transparent file

// Select EF(LOCI) under the GSM directory

Select 3F00

Select 7F20

Select 6F78

// This file has READ policy of CHV1
VerifyCHV 1 "1234"

 

//Read all bytes in this file

ReadBinary

 

// Read from the 4th byte

ReadBinary 4

Read data from a linear fixed file

// Select EF(SMS) under the TELECOM directory

Select 3F00

Select 7F10

Select 6F3C

 

// This file has READ policy of CHV1
VerifyCHV 1 "1234"

 

// Read the 5th record
ReadRecord 5

 

// Read the next record
ReadRecord Next

// Read the current record
ReadRecord Current

Update the data in a transparent file 

// Select EF(LOCI) under the GSM directory

Select 3F00

Select 7F20

Select 6F78

 

// This file has READ policy of CHV1
VerifyCHV 1 "1234"

 

Set $offset = 3

 

// Update all 8 bytes in the EF

UpdateBinary 0102030405060708

// Update only the last 5 bytes

UpdateBinary $offset 0405060708

// Update only the first 3 bytes

UpdateBinary 010203

Update the data in a linear fixed file

// Select EF(ADN) under the TELECOM directory

Select 3F00

Select 7F10

Select 6F3A

 

// This file has READ policy of CHV1
VerifyCHV 1 "1234"

 

Set $data = 0000000000000000000000000000000000000000000000

 

UpdateRecord 5 FFFFFFFFFFFFFFFF0102030405060708090A0B0C0D0E0F

UpdateRecord Previous $data

Check for SIM Toolkit activity

// This normally causes a proactive status ('91 XX')

TerminalProfile

 

// Fetch the proactive command (might be a SET UP MENU)

Fetch

 

// ... and respond positively to it

TerminalResponse

 

// Select menu item 3 (assuming no more proactive commands)

Envelope_MenuSelection 3

 

// This may result in a SELECT ITEM proactive command

Fetch

 

// Select item 2 from the list (for example)

TerminalResponse_SelectItem 2

 

Select the USIM application (3G cards only)

// This allows SIM Commander to send 3G class commands
3GMode

// Uncomment this and modify PIN1 if required
//VerifyPIN 1 "5555"

// Select EF(DIR)
Select 2F00

// Read the first record
ReadRecord 1

// Here we locate the application AID by searching for the appropriate TLV tags
Set $data = $responseData

// Use the CropTLV command to get at the AID itself
CropTLV $data 61
CropTLV $data 4F

// Attempt to select the application (should be USIM)
Select $data

// Test to see if all ok...

// Go to EF_FPLMN and read the contents
Select 6F7B
ReadBinary

Pass

Using script variables

Set $apple = 010203

Set $pear = 04 05 06 07 08

Set $fruit = $apple $pear 09 0A 0B0C0D0E0F

 

Set $text1 = "Hello"

Set $text2 = ", World"

Set $allText = $text1 $text2

DisplayAsText $allText

// Create then send an ADMIN command
Set $ADMcommand = A0 20 00 10 08 01 02 03 04 05 06 07 08
Apdu $ADMcommand

 
 
Back to Contents
 

Home | Products | Services | Praise | Contact | Opiah Home

 

 

© 2001-2006 Quantaq Solutions. All Rights Reserved.