目录
接口种类
windows的wifi接口分好几种,一种是uwp的,一种是classic的,还有window7的接口
这几种接口也不是很分的清
接口的Samples
uwp的接口和samples:
接口:
IAsyncOperation
AsyncStatus Enum (Windows.Foundation) - Windows UWP applications | Microsoft Docs
IAsyncAction::put_Completed method - Win32 apps | Microsoft Docs
下面代码的理解:
ComPtr<IAsyncOperation<WiFiDirectDevice*>> asyncAction;
hr = wfdStatics->FromIdAsync(deviceId.Get(), &asyncAction);
if (FAILED(hr)) {
log_e("From ID Async for WiFiDirectDevice failed 0x%x", hr);
return hr;
}
hr = asyncAction->put_Completed(Callback<FromIdAsyncHandler>([this](IAsyncOperation<WiFiDirectDevice*>* pHandler, AsyncStatus status) -> HRESULT {
通过上面的 可以创建一个wifirdirectDevice设备, 返回一个异步IAsyncOperation<WiFiDirectDevice>, 通过iasyncoperation 的completet方法,可以获取到
一个result(wfdDevice)。
samples:
https://github.com/microsoft/Windows-universal-samples/tree/main/Samples/WiFiDirect
(可以主要看cs的,可以直接编译出来可执行文件执行)
classic(win32)接口的samples:
接口:
WlanSetProfile function (wlanapi.h) - Win32 apps | Microsoft Docs
samples:
https://github.com/microsoft/Windows-classic-samples/tree/main/Samples/WiFiDirectLegacyAP
win7samples:
其他的参考链接:
C++/CLI,C++/CX,WRL 有什么区别? - 知乎
通用 Windows 平台 (UWP) 应用的参考 - Windows UWP applications | Microsoft Docs
WiFiDirectAdvertisementPublisher.Start Method (Windows.Devices.WiFiDirect) - Windows UWP applications | Microsoft Docs
Windows.Devices.WiFiDirect Namespace - Windows UWP applications | Microsoft Docs
C++/WinRT学习笔记(六):接口的录用和作成 | Marvin's Blog【程式人生】
C++/WinRT简介 | Marvin's Blog【程式人生】
C++/WinRT - UWP applications | Microsoft Docs
https://chromium.googlesource.com/chromium/src.git/+/HEAD/docs/README.md#Misc-Windows_Specific-Docs
win32 wifi连接_MikeDai的博客-CSDN博客
WlanSetProfile function (wlanapi.h) - Win32 apps | Microsoft Docs