writeE2 method

Future<bool?> writeE2(
  1. NfcTag tag,
  2. int address,
  3. Uint8List payload
)

Implementation

Future<bool?> writeE2(NfcTag tag, int address, Uint8List payload) async {
  Uint8List? receive =
      await sendCommand(tag, Uint8List.fromList([0xA2, address] + payload));

  if (receive!.isEmpty) {
    return false;
  }

  if (hex.encode(receive).isEmpty) {
    if (Platform.isIOS) {
      NfcManager.instance
          .stopSession(errorMessage: 'Read Register error !!!');
    }
    return false;
  }

  return true;
}