sendRequest method

Future<Iso15693Response> sendRequest({
  1. required int requestFlags,
  2. required int commandCode,
  3. Uint8List? data,
})

Sends any ISO 15693-3 request: the 8-bit request flag, an 8-bit command code, and the data the command takes, if it takes any.

This is here because customCommand cannot reach a command code outside 0xA0-0xDF, and outside that window sits every ISO 15693-3 security command -- authenticate 0x35, key update 0x36, challenge 0x39, read buffer 0x3A -- along with the fast reads 0x2D and 0x3D. Until this existed those commands could not be sent from iOS through this package at all, while Android reached the same tag with them through NfcV.transceive. Reach for a typed method when there is one; this is for the commands that have none.

requestFlags is the flag byte itself rather than a Iso15693RequestFlag set, because that is what CoreNFC takes here and the set cannot express bit 8, which each command defines for itself.

The whole frame -- flag, command code and data together -- has to fit in 256 bytes. requestFlags and commandCode are each one byte, so a value outside 0-255 throws PlatformException(code: 'invalidParameter'). Raw does not mean unbounded: this call declines to interpret the two bytes, not to check that they are bytes.

Implementation

Future<Iso15693Response> sendRequest({required int requestFlags, required int commandCode, Uint8List? data}) async =>
    _response(await iosApi.iso15693SendRequest(_handle, requestFlags, commandCode, data));