18,356
社区成员
发帖
与我相关
我的任务
分享
BOOL CALLBACK BluetoothAuthCallback(
LPVOID pvParam,
PBLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS pAuthCallbackParams)
{
BLUETOOTH_AUTHENTICATE_RESPONSE AuthRes;
::ZeroMemory(&AuthRes, sizeof(BLUETOOTH_AUTHENTICATE_RESPONSE));
AuthRes.authMethod = pAuthCallbackParams->authenticationMethod;
AuthRes.bthAddressRemote = pAuthCallbackParams->deviceInfo.Address;
AuthRes.negativeResponse = 0;
if (AuthRes.authMethod == BLUETOOTH_AUTHENTICATION_METHOD_NUMERIC_COMPARISON)
{
AuthRes.numericCompInfo.NumericValue = 0;
}
// Send authentication response to authenticate device
DWORD dwRet = BluetoothSendAuthenticationResponseEx(*(HANDLE*)pvParam, &AuthRes);
if (dwRet == ERROR_SUCCESS)
{
}
return TRUE;
}