nz.ac.waikato.modeljunit.examples.gsm
Class SimCardAdaptor

java.lang.Object
  extended by nz.ac.waikato.modeljunit.examples.gsm.SimCardAdaptor

public class SimCardAdaptor
extends java.lang.Object

This class connects the SimCard model to the GSM11Impl.

Author:
marku

Field Summary
protected  byte[] apdu
           
protected  byte[] response
           
protected  GSM11Impl sut
           
 
Constructor Summary
SimCardAdaptor()
           
 
Method Summary
 void Change_PIN(int old_Pin, int new_Pin, SimCard.Status_Word result)
           
protected  void checkStatus(SimCard.Status_Word expect, int position)
          Check that an expected and actual status agree.
 void Disabled_PIN(int Pin, SimCard.Status_Word result)
           
 void Enabled_PIN(int Pin, SimCard.Status_Word result)
           
protected  int getByte(byte[] buf, int pos)
           
protected  int getWord(byte[] buf, int pos)
           
protected  void initCmd(int cmdnum, int p1, int p2, int p3)
          Sets up the first few bytes of the APDU, ready to send to the SIM.
 void Read_Binary(SimCard.Status_Word result, java.lang.String read_data)
          This always reads from offset 0, and reads just 2 bytes.
 void reset()
           
 void Select_file(SimCard.F_Name file_name, SimCard.Status_Word result)
           
protected  void setChv(int pos, int chv)
          Packs a PIN number (given as an int) into 8 bytes.
protected  void setFileID(SimCard.F_Name file)
          Translate a model filename into a real filename.
protected  void setWord(int pos, int value)
           
 void Unblock_PIN(int Puk, int new_Pin, SimCard.Status_Word result)
           
 void Verify_PIN(int Pin, SimCard.Status_Word result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

apdu

protected byte[] apdu

response

protected byte[] response

sut

protected GSM11Impl sut
Constructor Detail

SimCardAdaptor

public SimCardAdaptor()
Method Detail

initCmd

protected void initCmd(int cmdnum,
                       int p1,
                       int p2,
                       int p3)
Sets up the first few bytes of the APDU, ready to send to the SIM.


setWord

protected void setWord(int pos,
                       int value)

setChv

protected void setChv(int pos,
                      int chv)
Packs a PIN number (given as an int) into 8 bytes.


setFileID

protected void setFileID(SimCard.F_Name file)
Translate a model filename into a real filename.


getWord

protected int getWord(byte[] buf,
                      int pos)

getByte

protected int getByte(byte[] buf,
                      int pos)

checkStatus

protected void checkStatus(SimCard.Status_Word expect,
                           int position)
Check that an expected and actual status agree.

Parameters:
expect - The expected status (from the model).
position - The position in response of the status word

reset

public void reset()

Verify_PIN

public void Verify_PIN(int Pin,
                       SimCard.Status_Word result)

Unblock_PIN

public void Unblock_PIN(int Puk,
                        int new_Pin,
                        SimCard.Status_Word result)

Enabled_PIN

public void Enabled_PIN(int Pin,
                        SimCard.Status_Word result)

Disabled_PIN

public void Disabled_PIN(int Pin,
                         SimCard.Status_Word result)

Change_PIN

public void Change_PIN(int old_Pin,
                       int new_Pin,
                       SimCard.Status_Word result)

Select_file

public void Select_file(SimCard.F_Name file_name,
                        SimCard.Status_Word result)

Read_Binary

public void Read_Binary(SimCard.Status_Word result,
                        java.lang.String read_data)
This always reads from offset 0, and reads just 2 bytes.



Copyright © 2009 ModelJUnit Project. All Rights Reserved.