Advertisement

How can i establish a wifi-direct connection ?

Started by December 10, 2014 07:14 PM
1 comment, last by Gl2eenDl2agon 9 years, 11 months ago

Hi,

I want to setup a Windows Runtime 8.1 - Windows Runtime 8.1 / Phone 8.1 server and client using Wifi-Direct. But I have had absolutely no success in writing an application that can do even the most simple of tasks, My PC doesn't even see any other wifi-direct devices using the MS samples. In my own code I get one breaking issue after another ... Can someone please talk me through setting up a basic application that can establish a wifi-direct connection between my pc and my laptop (or lumia 520).

My intention is to be able to stream arbitrary data from my pc to a wifi-direct device (phone, pc or custom hardware).

Ok, scrap that idea completely. I am using WebSockets instead over LAN.

Advertisement

If your PC and your phone have WIFI and its connected, you can just use sockets and broadcast over UDP to discover IP addresses.

This doesn't require any special libraries or code.

Now if you are trying to force the PC and phone to connect to a certain AP, then you would need to use the special libraries that are OS specific and change between versions of windows.

Typically only the admin/root user can muck with WIFI programatically.

But once connected to the same WIFI AP on the phone and PC (or maybe even adhoc) you have a fully working ethernet/wifi IP connection and you just discover the addresses using UDP broadcasts, and then you can send and recv data using any socket or socket-like way.

After reading....

http://msdn.microsoft.com/en-us/library/windows/hardware/hh440285(v=vs.85).aspx

A Wi-Fi Direct Device on the PC is not discoverable by default. Before it becomes discoverable, Windows will configure the P2P Device Info on the port and provide the set of IEs to include in the probe response. The Device port should only make itself discoverable once Windows has enabled Listen State on the port.

The Wi-Fi Direct device port is requested to perform Device Discovery with theOID_DOT11_WFD_DISCOVER_REQUEST. The miniport driver follows the guidelines in the Wi-Fi Peer-To-Peer Technical Specification for performing device discovery. It reports the completion of the discovery process using NDIS_STATUS_DOT11_WFD_DISCOVER_COMPLETE. The miniport driver must report the list of discovered devices in this completion indication. This completion behavior is different than scanning in Extensible Station Mode.

WIFI-Direct is not going to work right out of the box for security reasons.

This topic is closed to new replies.

Advertisement