问题
I'm wondering if there's a way for two iPhones to communicate with Wifi-Direct Exclusively.
(No Bluetooth, No Servers, Just Wifi-Direct)
Correct me if I'm wrong, but MultiPeerConnectivity, GameKit, and CFNetServices don't allow using exclusively Wifi-Direct. If they do can someone show me an example?
Thanks for your time!
回答1:
The Multipeer Connectivity framework does not support Wi-Fi Direct but it does support direct ad-hoc connections between two iOS devices using a proprietary Apple technology that's similar to Wi-Fi Direct.
It's mentioned on the Multipeer reference where it's called "peer-to-peer Wi-Fi".
You can also get more basic peer-to-peer Wi-Fi discovery and communication between two iOS devices using Bonjour with NSNetService
and NSNetServiceBrowser
, if you set the includesPeerToPeer
property to YES on each (Note this is not mentioned in the online docs but it is in the header files). This is what Multipeer Connectivity is built on.
来源:https://stackoverflow.com/questions/24680709/ios-wifi-direct-communication