Refactor: rename APDU_GET_RESPONSE to COMMAND_GET_RESPONSE

This commit is contained in:
Henryk Plötz 2010-10-15 16:37:26 +02:00
parent 04af868a4c
commit 9e8b7b0a82
4 changed files with 8 additions and 5 deletions

View File

@ -9,7 +9,7 @@ DEBUG = True
_GENERIC_NAME = "Generic"
class Card:
DRIVER_NAME = [_GENERIC_NAME]
APDU_GET_RESPONSE = None
COMMAND_GET_RESPONSE = None
## Constants for check_sw()
PURPOSE_SUCCESS = 1 # Command executed successful
@ -153,7 +153,7 @@ class Card:
if self.check_sw(result.sw, self.PURPOSE_GET_RESPONSE):
## Need to call GetResponse
gr_apdu = C_APDU(self.APDU_GET_RESPONSE, le = result.sw2, cla=apdu.cla) # FIXME
gr_apdu = C_APDU(self.COMMAND_GET_RESPONSE, le = result.sw2, cla=apdu.cla) # FIXME
result = R_APDU(self._real_send(gr_apdu))
elif self.check_sw(result.sw, self.PURPOSE_RETRY) and apdu.Le == 0:
## Retry with correct Le

View File

@ -3,7 +3,8 @@ from iso_card import *
class GSM_Card(ISO_Card):
DRIVER_NAME = ["GSM"]
APDU_GET_RESPONSE = C_APDU("\xa0\xC0\x00\x00")
COMMAND_GET_RESPONSE = C_APDU("\xa0\xC0\x00\x00")
STATUS_MAP = {
Card.PURPOSE_GET_RESPONSE: ("9F??", )
}

View File

@ -5,7 +5,8 @@ from utils import C_APDU, R_APDU
class ISO_Card(Card):
DRIVER_NAME = ["ISO"]
APDU_GET_RESPONSE = C_APDU(ins=0xc0)
COMMAND_GET_RESPONSE = C_APDU(ins=0xc0)
APDU_VERIFY_PIN = C_APDU(ins=0x20)
## Map for check_sw()

View File

@ -4,7 +4,8 @@ from iso_7816_4_card import *
class Postcard_Card(ISO_7816_4_Card):
DRIVER_NAME = ["Postcard"]
CLA = 0xbc
APDU_GET_RESPONSE = C_APDU(cla=CLA,ins=0xc0)
COMMAND_GET_RESPONSE = C_APDU(cla=CLA,ins=0xc0)
APDU_SELECT_FILE = C_APDU(cla=CLA,ins=0xa4)
APDU_READ_BINARY = C_APDU(cla=CLA,ins=0xb0,le=0x80)