none
Accessing NFC reader from desktop app on Windows 8 RRS feed

  • Question

  • Hi!

    I want to use low-level IOCTLs to access NFC proximity driver (i can't use Windows Store API because my code worked even before user logon from Windows service). So i create 2 threads and call CreateFile2 2 times for these threads:

    1. One with reader path (obtained from SetupDiGetDeviceInterfaceDetail) and "\Subs\DeviceDeparted"  postfix.

    2. Second with "\Subs\Windows.AAA" postfix

    All handles opened with FILE_FLAG_OVERLAPPED (don't know why but CreateFile2 without this flag not worked for NFC).

    Now i have 2 threads: DepartedThread and ReadThread. In both threads i have the following call:

    DeviceIoControl(Device, IOCTL_NFP_GET_NEXT_SUBSCRIBED_MESSAGE, 0, 0, Data, sizeof(Data), &Returned, &ov); Where "ov" is instance of OVERLAPPED structure with inited hEvent member (i set it to handle of manual event).

    Also i have 3 tablets with Windows 8:

    1. Lenovo ThinkPad Tablet with NFC reader from Broadcom.

    2. HP ElitePad 900 G1 with NFC reader from NXP (PN533)

    3. ASUS VivoTab Smart with NFC reader from NXP (PN544)

    I see that my test app worked ok on Lenovo and HP. But can't read anything from NFC tag on ASUS (ReadThread blocked on WaitForSingleObject after DeviceIoControl). Only departed event catched. From other side:

    1. I was able to enroll (write) NFC tag on this device (i open device with "\Pubs\Windows:WriteTag.AAA" postfix and send IOCTL_NFP_SET_PAYLOAD and IOCTL_NFP_GET_NEXT_TRANSMITTED_MESSAGE IOCTLs).

    2 Windows Store apps (NFC Kits, Chip Chip) worked good

    3. One my previous versions of my test app worked good on ASUS tablet. But only sometimes :). From other side sometimes it stop to work on Lenovo tablet. Current version worked good on Lenovo and HP but not on ASUS at all. I don't see much differences between these versions (in one case i use GetOverlappedResultEx call in other case i use WaitForSingleObject)

    Also i try to install to track API calls maded from Windows Store Apps (i use apimon IRP tracker and so on). But without success. Still can't find any differences between my code and Windows Store API.

    Can you help me a bit? May be you have some samples for Proximity IOCTLs.

    Thank you a lot.

    Monday, December 16, 2013 11:47 AM

All replies

  • Hi Dmitriy,

    I've recently started looking at reading NFC tags from a windows desktop application and there is not much out there!

    I too have an HP ElitePad 900 G1 and will also be using a HP EliteOne 800 (Which i believe has the PN544).

    I would really appreciate if you could please point me in the right direction to get started on this as I cant find much :\

    Thanks!

    Monday, February 17, 2014 9:40 PM
  • Hi!

    You can use raw IOCTLs (if you don't want to deal with WinRT API).

    For more information, see: http://msdn.microsoft.com/en-us/library/windows/hardware/hh439292(v=vs.85).aspx

    Especcially "Reference" section with description of required IOCTLs.

    Monday, February 24, 2014 12:03 PM