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 a command APDU assembled from its fields.

The four header fields are each one byte. expectedResponseLength is the Le field: 1-65536, or -1 for a command that expects no response data. Zero is not a way to say that, and anything else throws PlatformException(code: 'invalidParameter').

Implementation

Future<Iso7816ResponseApdu> sendCommand({
  required int instructionClass,
  required int instructionCode,
  required int p1Parameter,
  required int p2Parameter,
  required Uint8List data,
  required int expectedResponseLength,
}) async {
  final response = await iosApi.iso7816SendCommand(
    _handle,
    instructionClass,
    instructionCode,
    p1Parameter,
    p2Parameter,
    data,
    expectedResponseLength,
  );
  return _toApdu(response);
}