flutter-nfc-manager icon indicating copy to clipboard operation
flutter-nfc-manager copied to clipboard

add setTimeout and getTimeout method to IsoDep

Open MasayukiSuda opened this issue 3 years ago • 2 comments

  • Added two methods to the IsoDep class.

    • One is setTimeout and the second is getTimeout.
    • It uses Android's IsoDep setTimeout and getTimeout respectively.
  • Changed the existing member variable timeout to initialTimeout.

Confirmation

NfcManager.instance.startSession(onDiscovered: (NfcTag tag) async {
      result.value = tag.data;
      var isoDep = IsoDep.from(tag);
      if (isoDep != null) {
        print("initialTimeout ${isoDep.initialTimeout}");
        var time = await isoDep.setTimeout(time: 60000000);
        print("setTimeout setTimeout $time}");
        var getTime = await isoDep.getTimeout();
        print("getTime $getTime}");
      }
      NfcManager.instance.stopSession();
    });

MasayukiSuda avatar Jun 28 '21 07:06 MasayukiSuda

@okadan Please review 🙇

MasayukiSuda avatar Jun 30 '21 04:06 MasayukiSuda

@okadan I'm in a hurry so can you review it if you like 🙇🙇🙇

MasayukiSuda avatar Jun 30 '21 10:06 MasayukiSuda

This would've helped me a lot too, hopefully the new API in v4.0.0 will mean this isn't required anymore.

PeteClubSeven avatar Nov 19 '23 14:11 PeteClubSeven