Windows 8.1 : How to use Near-Field Proximity API without NFC hardware

Did you know that you don’t need any NFC-capable device to develop againt the Near-Field Proximity API ? You can install a sample driver (Near-Field Proximity Sample Driver (UMDF Version 1)) that will emulate the hardware layer for you with a TCP connection.

The bad news is you will need to accomplish a number of downloads, compiling, deploying, creating certificate, configuring, …and that will take hours (trust me !).

The good news is that I did that boring stuff just before you, so I will give you the driver binaries, tools, certificate and hints to accomplish that much quicker.

You will still need to:

Get the zip file and extract it

Import the driver certificate

Install the driver (.bat)

Add a firewall rule

(screenshots are in French, but very recognizable)

1. Download the zip

So instead of downloading the Windows Driver Kit, the driver samples, and the WDK redistribuable components, get each component in the right place, build and target appropriatly the virtual Proximity driver, get the binaries, create a test certificate, blabla…, you can just download the following zip. It contains everything you need to install the driver on a Windows 8.1 x64 machine.

Extract it anywhere on the disk of all the PC’s that will be using the Proximity API.

2. Import the certificate to your computer’s store

The zip contains a test signing certificate NetNfpCertExport that you will have to import to be able to use the driver.

Right-click on it and select “Install PFX”

Just follow the wizard to put the certificate in the Trusted Root Certification Authorities.

It means that the driver (here for Windows 8.1 x64) is not compatible with your machine. In that case, you will have to do the complete process I explained in the introduction. So, you will be able to build and get the binaries adapted to your target OS and hardware.

See what your driver enabled

Now you can see you are NFC-capable in the Devices charms, and in the device manager :

4. Add an exception to the firewall

Update the firewall on the PC’s which will have the driver installed.

Click Advanced Parameters and add a new rule for the incoming traffic:

Select Port:

Select TCP and enter the port used by the driver : 9299 (the driver will use a TCP connection on this port to simulate the NFC communication)

Testing with an NFC-enabled sample application

Using the first scenario, just click on Advertise. See the green information : Tap another device to connect to a peer : that’s what we’ll do with our NFC simulated driver.

The NetNfpControl application allows to control the sample driver.

Just launch NetNfpControl.exe <hostname or IPv6 address for the other peer you want to connect to> (in my case, it’s stephetablet7).

This will simulate a “Tap” action.

Magic : you will experience “Tap and Launch” resulting in a toast notification appearing on the PC you connected to, inviting you to start the same application.

According to MSDN : For connections triggered by a tap, if the peer application is not running in the foreground on the target computer, then proximity invites the user to activate the app on the target machine. If the peer app is not installed on the target computer, then proximity invites the user on the target computer to install the app from the Windows Store. For more details on activating apps with a tap gesture, see "Activating apps using Proximity" in Supporting proximity and tapping.

It’s not the subject of this article, but of course other use cases are available (see below). I will certainly go deeper into some of them in a future article.

Hello yacine, can you check the Windows version you are executing ? The binaries provided here are for Win 8.1 x64. You can get the binaries for other versions, but you have to do all the get source file and compile work in first place, with the appropriate target platform selected in Visual Studio before building (check my 1st chapter).

Shubham Dawra

24 Jun 2014 8:33 PM

You just saved mine 500 GB Bandwidth for downloading WDK and time for compiling :)

it's working perfectly on windows 8.1 64 bit

Thanks

Joyeeta

3 Sep 2014 11:13 PM

After successful installation, I am getting the following error when trying the following command:

NetNfpControl.exe S1-10589322

It shows:

Attempting Connect: 'S1-10589322' . . .

BeginProximity() failed: 0x80072af9

I have completed the total installation process for both PC's. Both PC has Windows8.1 Professional OS of 64 bit.

I've created a VM with Hyper-V with Windows 8.1 Professional 64 bits, and I've installed on the driver you gave to us.

Everything worked fine, I've also created the firewall rules, and I've installed also the proximity sample application.

Then, on my main operating system (Windows 8.1 64 bits) and my VM (Windows 8.1 64 bits), the driver is install and configured, and the network between both works too (ping MainPC works, and ping VMPC works too).

I've launched on both side the Proximity sample application and on the MainPC I've launched NetNfpControl.exe VMPC and on the other side (VM) I've launched NetNfpControl.exe MainPC, but nothing happens ! Could you please advise me on how to fix this, please ?

This is the second part of the article, you can find the first one here : Strategies for sharing XAML code in Universal Apps (1/2) We will see different options to get UI and functionnal platform specificities while sharing some XAML at the same...

[Version FR disponible ici ] Thanks to the universal apps, we can now share much more than PCLs between applications targeting different platforms. In Visual Studio, a universal solution is composed of at least 3 projects : one for Windows Store, one...

On Windows 8.1 and WinRT, Wifi-direct enables wireless direct communication scenarios between devices executing the same application . That means you can exchange data between peers in areas without any internet network connectivity. All you need is a...

Did you know that you don’t need any NFC-capable device to develop againt the Near-Field Proximity API ? You can install a sample driver ( Near-Field Proximity Sample Driver (UMDF Version 1) ) that will emulate the hardware layer for you with a TCP connection...