我会尽量保持简短.我一直在Windows 10(10130)中运行Microsoft的WiFi Direct Services示例,可以在GitHub上找到,这是Visual Studio 2015 RC中的C#.现在,在他们的Build会议中,他们说你可以在CMD中运行命令,知道你的WiFi适配器是否与WiFi Direct兼容
netsh wlan show wirelesscap
Run Code Online (Sandbox Code Playgroud)
这给了我一个很大的肯定,你的无线适配器是兼容的.
Wi-Fi Direct Device : Supported
Wi-Fi Direct GO : Supported
Wi-Fi Direct Client : Supported
Run Code Online (Sandbox Code Playgroud)
但是,当我运行上面提到的示例时,一切都会正常,直到触发WiFiDirectServiceWrapper.OnAdvertisementStatusChanged(...),在创建广告商之后几乎无效.在附加了分析器的情况下运行示例时,我得到了:
private void OnAdvertisementStatusChanged(WiFiDrectServiceAdvertiser sender, object args)
Run Code Online (Sandbox Code Playgroud)
-
sender | {Windows.Devices.WiFiDirect.Services.WiFiDirectServiceAdvertiser}
AdvertisementStatus: Aborted
AutoAcceptSession: true
CustomServiceStatusCode: 0
DeferredSessionInfo: null
PreferGroupOwnerMode: true
PreferredConfigurationMethods : _native, can't see_
ServiceError: UnsupportedHardware
ServiceInfo: null
ServiceName: "myservice"
ServiceNamePrefixes: {System.__comObject}
ServiceStatus: Available
Run Code Online (Sandbox Code Playgroud)
我真的不知道我应该如何去除这个,因为我找不到这个事件的引发位置(对该方法的唯一引用是
this.advertiser.AdversitementStatusChanged += OnAdvertisementStatusChanged
this.advertiser.AdversitementStatusChanged -= OnAdvertisementStatusChanged
Run Code Online (Sandbox Code Playgroud)
^那些),我看不到WifiDirectServiceAdvertiser实现. …