fixed extracting reference flags for select

This commit is contained in:
Frank Morgner
2013-07-09 07:34:05 +02:00
parent 8e5d044ab5
commit d6bf6a0b93
2 changed files with 5 additions and 4 deletions

View File

@@ -223,6 +223,7 @@ REF = {
"NUMBER_TO_LAST" : 0x05,
"NUMBER_FROM_LAST" : 0x06,
"NUMBER_CONTROL" : 0x07,
"REFERENCE_CONTROL" : 0x07,
"REFERENCE_CONTROL_RECORD" : 0x07,
"REFERENCE_CONTROL_SELECT" : 0x03,
}

View File

@@ -656,7 +656,7 @@ class MF(DF):
else:
index_current = self.content.index(df)
selected = self.select('dfname', data, p2 &
REF["REFERENCE_CONTROL"], index_current)
REF["REFERENCE_CONTROL_SELECT"], index_current)
else:
logging.debug("unknown selection method: p1 =%s" % p1)
selected = None
@@ -934,7 +934,7 @@ class MF(DF):
self.current = ef
ef.resetRecordPointer()
return ef, num_id, p2 & REF["REFERENCE_CONTROL"]
return ef, num_id, p2 & REF["REFERENCE_CONTROL_RECORD"]
def readRecordPlain(self, p1, p2, data):
"""
@@ -1049,7 +1049,7 @@ class MF(DF):
:returns: the status bytes as two byte long integer and the response
data as binary string.
"""
if p1 != 0 or (p2 & REF["REFERENCE_CONTROL"]) != 0:
if p1 != 0 or (p2 & REF["REFERENCE_CONTROL_RECORD"]) != 0:
raise SwError(SW["ERR_INCORRECTP1P2"])
ef, num_id, reference = self.recordHandlingDecode(p1, p2)
sw = ef.appendrecord(data)