sendCommand method

Future<Iso7816ResponseApdu> sendCommand({
  1. required int instructionClass,
  2. required int instructionCode,
  3. required int p1Parameter,
  4. required int p2Parameter,
  5. required Uint8List data,
  6. required int expectedResponseLength,
})

Sends the APDU to the tag.

This uses NFCISO7816Tag#sendCommand API on iOS.

Implementation

Future<Iso7816ResponseApdu> sendCommand({
  required int instructionClass,
  required int instructionCode,
  required int p1Parameter,
  required int p2Parameter,
  required Uint8List data,
  required int expectedResponseLength,
}) async {
  return channel.invokeMethod('Iso7816#sendCommand', {
    'handle': _tag.handle,
    'instructionClass': instructionClass,
    'instructionCode': instructionCode,
    'p1Parameter': p1Parameter,
    'p2Parameter': p2Parameter,
    'data': data,
    'expectedResponseLength': expectedResponseLength,
  }).then((value) => $GetIso7816ResponseApdu(Map.from(value)));
}