Proximity sample

This sample demonstrates how to use the PeerFinder, ProximityDevice, and PeerWatcher classes to communicate with nearby devices.

 
 
 
 
 
4.5 Star
(13)
36,262 times
Add to favorites
11/26/2014
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • NFC dont work :(
    4 Posts | Last post October 31, 2012
    • Hi, I have 2 tablet PC and try use this sample. In first scenario I send message to my device and it's work fine, but when I turn off WIFI/Bluetooth - message sending stopped working. Then, I put breakpoint in second scenario in 'DeviceArrived' event handler method and it's never enter here. 
      P.S.: ProximityDevice.GetDefault() on both tablets pc return NOT null value.
    • Nevermind, all work fine.
    • Hi kurzov,
      i am trying on 2 tablet i am not able to connect two tablets.
      i am following below procedure.
        i lunch the application on both tab then hit Advertise button on both then it displays either use browse for peer or tab other devise which is advertising then i will tab both device then on both side i will get display socket connection started then in one it displays connecting in other listening then after some it displays connection failed on both
      
      i am getting following errors
      Peer connecting side.
      ERROR:Exception from HRESUIT :0X80043C04.
      Peer acceptance side.
      ERROR:Value doesnot fall within the expected range
      
      please help me to solve this problem and what is your procedure.
      
      
    • hi Kurzov,
      
      can you please post the procedure you followed and what kind of tablet your using and which build.
  • addtion:about bluetooth
    1 Posts | Last post October 29, 2012
    • if i want to make a connection between two bluetooth by browse,do i need a NFC device? I am looking for your answer!
  • bluetooth for comunication by using peerfinder class?
    1 Posts | Last post October 29, 2012
    • hi,i want to ask a question that wether can i use the peerfinder class to make a connection between two bluetooth device? if the aswer is true,what should i do,can you give me a part of important code? thank you.
  • Proximity Device?
    4 Posts | Last post October 16, 2012
    • What constitutes a proximity device?  From the WinRT API I would assume it would be certain WIFI chipsets (WIFI Direct), bluetooth chipsets (Bluetooth), and any normal network adapter on an active network (TCP/IP).  I hoped that the VMs I am testing with would have communicated using a proximity TCP/IP connection.  No luck (ProximityDevice.GetDefault() always returns null).  
      
      Are normal active network adapters not considered to be proximity devices that work with TCP/IP connections? 
      
      I am excited about these proximity APIs which seem like they will make multiplayer gaming between tablets very easy to do.  This is why I am looking into it.
    • Hello
      
      I successful build c++ NetNfpProvider driver project, install *.pfx file on test computer.
      Then copied  needed files to 'C:/NetNfpprovider' directory and have problem with install driver on main computer(not test):
      
      C:\NetNfpprovider>devcon.exe install NetNfpProvider.inf WUDF\NetNfpProvider Device node created. Install is complete when drivers are installed... Updating drivers for WUDF\NetNfpProvider from C:\NetNfpprovider\NetNfpProvider.inf.
      
      devcon.exe failed.
      
      Any ideas how fix it?
    • Proximity is a new device type in Windows 8. One of the primary proximity technologies expected to be supported in Windows 8 is Near-field communications (NFC). If you do not have one of the slate PCs given out at the //build conference, or one of the many soon to be available for sale slate PCs, you probably don’t have a proximity device available. You can see more information about what you can do with proximity aware metro applications here: http://msdn.microsoft.com/en-us/library/windows/apps/hh465229(v=VS.85).aspx
      For information on how to write a driver for a proximity device go here: http://msdn.microsoft.com/en-us/library/windows/hardware/hh439292(v=VS.85).aspx
      The sample proximity driver contained in the Windows 8 WDK can also serve as a simulator to enable proximity applications and experiences.
      
      -Mike [MSFT]
    • oleg.kurzov,
      
      For questions building and installing the sample proximity device/simulator please post your question on the page for the proximity device sample: http://code.msdn.microsoft.com/windowshardware/NetNfpProvider-4ad80340
      
      -Mike [MSFT]
  • Peer Finder with external NFC reader
    2 Posts | Last post October 16, 2012
    • Hi,
      
      I'm trying this sample with an external NFC reader but I keep getting "Tag based discovery of peers not supported" for Scenario 1. The reader shows up in Device Manager as 'Smart card readers --> SCL3711 reader and NFC device'. I was wondering if PeerFinder supports external NFC readers at all and if anyone's had luck with such a scenario.
      
      Thanks!
    • Proximity in Windows 8 only works with devices of the "Proximity devices" class. If the device in Device Manager is not listed in the "Proximity devices" class, it is not supported for Windows 8 proximity scenarios and APIs. You can contact the manufacturer of your existing hardware and ask if they are making a Windows 8 driver, or search for an vendor that has existing Windows 8 support.
      
      -Mike [MSFT]
  • NFC connection
    16 Posts | Last post October 09, 2012
    • i have downloaded the this c# application i builded successfully,
      and deployed on to two tab,when i launch the application and try to connect throw NFC it is failing.after displaying connecting in one tab and displaying listening in other tab. 
    • Take a look at the troubleshooting instructions here: http://msdn.microsoft.com/en-us/library/windows/apps/hh967765.aspx
      
      Specifically:
      "An attempt to connect from a tap fails after one minute- 
      Check the wireless settings on both computers involved in the tap and ensure that their Wi-Fi and Bluetooth radios are on. If either computer does not have a wireless device that supports Wi-Fi Direct, or a Bluetooth radio, ensure that both computers are connected to the same network."
      
      -Mike [MSFT]
    • thanks for your reply Mike.
      I have checked the troubleshooting link every think is fine tab does not support Wi-Fi Direct but i want connect two tabs using NFC.
    • Have you confirmed that Bluetooth is enabled and functioning on both devices? Are both devices connected to a WiFi access point? Only one of these things needs to be true, but making sure both are wouldn't hurt.
      
      Also, what driver date and version is your NFC device? You can check this from device manager and looking at the Proximity Device.
      
      -Mike [MSFT]
    • thanks Mike.
      i have confirmed both Bluetooth is enabled and functioning on both tab,both are connected to same Wi-Fi access point.
      NFC Driver Version 1.3.4.2
          Driver Date 9th AUG 2012.
    • Can you please describe in more detail what you are trying and what the result you are seeing is? Do you run the sample on both machines, hit the Advertise button on the PeerFinder scenario on both, then tap? And you see "Listening" on one side and "Connecting" on the other? Then after about 60 seconds it says "Socket connect failed!"?
      
      Are both of the tablets the same? What kind of tablets are they?
      
      -Mike [MSFT]
    • i lunch the application on both tab then hit Advertise button on both then it displays either use browse for peer or tab other devise which is advertising then i will tab both device then on both side i will get display socket connection started then in one it displays connecting in other listening then after some it displays connection failed on both
      
      i have checked both the tablet are same
      s4processor APQ8060 1.51GHz
      i am using image magellaun 1140.0C.LH5
    • It sounds like your devices do support WiFi-direct browse. Have you tried using Browse to connect the devices? You may need to disconnect from the access point first.
      
      What build of Windows 8 are you running?
      
      I have never seen a case where at least Bluetooth would not connect. My best guess at this point is there is some sort of hardware problem.
      
      -Mike [MSFT]
    • thank you very much mike,
      how do i know my device do support Wi-Fi direct or not.
      when i disconnect both tab from access point and launch both application and then  hit the Advertise button on the PeerFinder scenario on both then it displays either use browse for peer or tab other devise which is advertising and then if hit  Browse button on both tab both are able to find each other.
      after that if i press connect to peer button on one tab i am able to get the Accept for connection button on other peer on pressing acceptance button.
      i am getting following errors
      Peer connecting side.
      ERROR:Exception from HRESUIT :0X80043C04.
      Peer acceptance side.
      ERROR:Value doesnot fall within the expected range
      
    • Well if the Browse button is provided, the hardware is reporting that it supports WiFi-direct. The fact that it fails to connect suggests that there is a hardware or driver issue.
      
      Do you have access to newer drivers for your devices? Also, do you have any other hardware you could test with?
      
      You didn't mention which build of Windows 8 you have.
      
      -Mike [MSFT]
    • hi mike,
      i am using build 9200
    • Unfortunately the only thing I can suggest is trying different hardware and/or newer drivers. Presumably you are working with some pre-release hardware.
      
      -Mike [MSFT]
    • while debugging i found that i am getting the above listed error when i call ConnectAsync() function it is throwing the exception.
    • hi mike,
      i found that in the PeerFinderScenario.xaml.cs file in the PeerFinder_Accept and PeerFinder_Connect functions PeerFinder.ConnectAsync() API is returning the NULL to _socket in spite it is passing correct peer information to that API 
    • Hello 198gp.
      How about the result now?
      I download and compile the sample too, but always "No peer found" :-(
      I debug and watching this sample, found that the _peerInformationList always null.
      I use 2 different kinds wireless card, one card made the _browseConnectSupport true, and another one made it false. But the _peerInformationList both null, so never found a peer.
      What hardware you using for running this sample? 
    • //////////////////
       198gp
      
      thank you very much mike,
      how do i know my device do support Wi-Fi direct or not.
      when i disconnect both tab from access point and launch both application and then  hit the Advertise button on the PeerFinder scenario on both then it displays either use browse for peer or tab other devise which is advertising and then if hit  Browse button on both tab both are able to find each other.
      after that if i press connect to peer button on one tab i am able to get the Accept for connection button on other peer on pressing acceptance button.
      i am getting following errors
      Peer connecting side.
      ERROR:Exception from HRESUIT :0X80043C04.
      Peer acceptance side.
      ERROR:Value doesnot fall within the expected range
      ////////////////
      
      Yes, I do the same as 198gp doing.
      I'm using two PC and the same build OS, the same wireless card.
      But after click "Browse for Peers", always "No peers found".
      Debugging this sample, _peerInformationList value always null...
  • How do I run the APP to ARM platform ?
    8 Posts | Last post October 09, 2012
    • I have downloaded this example(C#), and complete build successfully.
      Also, I would like run the Metro-App on ARM but fail.
      Could you provide the method to install the Metro-App into ARM platform ?
      
      Vincent  
    • environment: WIN8 release preview Build8400
    • I alreay know how to install Metro-App by Package.
      - creating an app package successfuly.
        -- http://msdn.microsoft.com/en-us/library/windows/apps/hh975357.aspx
       
      - But installing the package is fail because of certificate.
        -- Add-AppDevPackage.ps1
        -- http://msdn.microsoft.com/en-us/library/windows/apps/hh975356.aspx
       
      Does Microsoft help? Thanks!
      
    • Are you making sure that you have selected the ARM configuration in Visual Studio?
      
      This issue also doesn't sound like it is related to this sample. I would recommend posting a question in the "Building Metro style apps with C# or VB" forum if you continue to have issues deploying apps for ARM devices.
      http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/threads
      
      -Mike [MSFT]
    • Thanks
    • I have downloaded VB version, and following the steps.
      1)Click "Advertise" on both PCs
      2)Click "Browsw for Peers" on one of them, and it show "Connect to a Peer"
      3)Click "Connect to a Peer" 
      4)Click "Accept Connection Request" on the other PC
      5)They try to make a connection...,but fail 
      OUTPUT:
      - HRESULT:0x80043C04
      - Not fall within the expected range (However, both of tem are so close)
    • hi vincent 
      
      did you got the solution for the cause because i am also facing the same problem.
      
      Thanks
      
    • Hello Vincent.
      How did you do it well?
      I download and compile the sample too, but always "No peer found" :-(
      I debug and watching this sample, found that the _peerInformationList always null.
      I use 2 different kinds wireless card, one card made the _browseConnectSupport true, and another one made it false. But the peerInformationList both null, so never found a peer.
      What hardware you using for running this sample? 
  • Able to build and run on 9200 Windows 8 Enterprise?
    2 Posts | Last post September 06, 2012
    • i tried to compile the C++ sample code under build 9200 but gave me error shown below
      
      C:\proximity sample\c++\MainPage.xaml.h(56): error C2035: a non-virtual destructor with 'public' accessibility is not allowed for this type a non-virtual destructor must have 'protected private' or 'private' accessibility
      
      Anyone tried on build 9200?
      i am able to build in build 8400
    • i am able to build now at 9200 after re-download the sample code again. Thanks..
  • How do I build proximity Sample application ?
    2 Posts | Last post August 28, 2012
    • Dear Sir,
      I have prepare 2012RC on Windows 7 and try to build proximity Sample application for RTM.
      The step, "Press F7 or use Build > Build Solution to build the sample", could not get it after loading sln file. Questions as below,
      1. Is it suitable enviroment for building? 
      2. Is there any built/released proximity tool on site?
      3. Does the application also run on Metro and desktop mode?
      Eddie
    • See this page: http://msdn.microsoft.com/en-us/library/windows/apps/br211384.aspx
      "Metro style app development in Visual Studio is supported only on Windows 8. Windows 7 is not supported."
      
      So the answer to your first question is 'no'.
      
      The answer to your second question is 'no', however there is a driver sample that can be built and used as a proximity simulator between two PCs. See here:
      http://code.msdn.microsoft.com/windowshardware/NetNfpProvider-4ad80340
      
      For your third question, the sample is a Metro app and Metro apps do not have a desktop mode.
      
      -Mike [MSFT]
  • Windows.Networking.Proximity - Android Interoperability
    4 Posts | Last post August 23, 2012
    • I am currently looking into developing a WinRT based application which utilises NFC communications. Is the Windows.Networking.Proximity NFC implementation interoperable with Android devices (Orange San Diego)?...As I am failing to have any luck with getting 'DeviceArrived' events...
      
      The hosts NFC device is detected via the 'GetDefault()' method, however the Android device is never detected as being in proximity. I have even tested the sample Proximity application with no success. 
    • Windows utilizes many relatively new standards. I can't say whether various Android devices also implement those same standards. It is best to contact the Android vendor for this information.
      
      When you say you have tested the sample Proximity application and it is not working, can you please clarify what you have tried and how it is not working?
      
      -Mike [MSFT]
    • Many thanks for your reply Mike.
      
      I am trying to get a connection between an Orange San Diego smartphone (running Android) and a laptop running Windows 8 RTM.
      
      I can't understand how there can be different implementations of NFC - I thought the entire concept of "standards" is that they are interoperable? The Microsoft implementation of the NFC stack should be interoperable with Android etc. Or am I just doing something incorrectly?
      
      I tested the Proximity sample here, and when looking for devices in the proximity, no events fire when the two devices are physically in proximity.
      
    • My point is that there are relatively new NFC standards (less than a year old). Windows adheres to these standards. Older devices may not. I suggest you contact the phone manufacturer for information on what standards they support.
      
      It also depends a lot on what scenario you are trying. I know nothing about Android, but it is conceivable they have proprietary scenarios.
      
      -Mike [MSFT]
21 - 30 of 44 Items