问题描述
- 枚举蓝牙设备时,下面一段代码求解析
-
粗体字求解析
while(!bFinished)
{
if(WSALookupServiceNext(hService, dwWsaqsFlags, &dwWsaqsLen, lpWsaqs) == NO_ERROR)
{
SOCKADDR_BTH saBth = (SOCKADDR_BTH)lpWsaqs->lpcsaBuffer->RemoteAddr.lpSockaddr;
BTH_ADDR bthAddr = saBth->btAddr;
_tprintf(_T("
发现蓝牙设备:
"));
_tprintf(_T("------------------------
"));
_tprintf(_T("NAP: 0x%04X SAP: 0x%08X 设备名称: %s
"), GET_NAP(bthAddr), GET_SAP(bthAddr), lpWsaqs->lpszServiceInstanceName);
}
解决方案
时间: 2024-10-26 23:19:03