Home > Software engineering >  Bluetooth API] [Windows 10 NumericValue is used in automatic matching with the bluetooth device?
Bluetooth API] [Windows 10 NumericValue is used in automatic matching with the bluetooth device?

Time:11-25

Windows provides two kinds of API used to connect a bluetooth device: BluetoothAuthenticateDevice, BluetoothAuthenticateDeviceEx

The scheme of the first need to click on the system the user information, and will not pop up after verified some system Settings can click on the information,

The second solution, can realize automatic matching all the way, need through BluetoothRegisterForAuthenticationEx register a callback for when pairing, the callback function is as follows:
 
BOOL CALLBACK BluetoothAuthCallback (
LPVOID pvParam,
PBLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS pAuthCallbackParams)
{
BLUETOOTH_AUTHENTICATE_RESPONSE AuthRes;
: : ZeroMemory (& amp; AuthRes, sizeof (BLUETOOTH_AUTHENTICATE_RESPONSE));
AuthRes. AuthMethod=pAuthCallbackParams - & gt; AuthenticationMethod;
AuthRes. BthAddressRemote=pAuthCallbackParams - & gt; DeviceInfo. Address;
AuthRes. NegativeResponse=0;

If (AuthRes authMethod==BLUETOOTH_AUTHENTICATION_METHOD_NUMERIC_COMPARISON)
{
AuthRes. NumericCompInfo. NumericValue=https://bbs.csdn.net/topics/0;
}

//Send the authentication response to authenticate the device
DWORD dwRet=BluetoothSendAuthenticationResponseEx (* (HANDLE *) pvParam, & amp; AuthRes);
If (dwRet==ERROR_SUCCESS)
{
}
return TRUE;
}

The authentication method has always been BLUETOOTH_AUTHENTICATION_METHOD_NUMERIC_COMPARISON, NumericValue tried a lot of (0, 1, pAuthCallbackParams - & gt; NumericValue,... ), but the return value dwRet is 1244 (ERROR_NOT_AUTHENTICATED)

Does anyone know the NumericValue from where can I find? How to set? (can't find the equipment supplier, but there is a software can automatically matching)

CodePudding user response:

Please help to see Daniel,

CodePudding user response:

Callback opens at the incoming parameters are to see whether some what information, if not may have to look at the device end of the service is how to set the

CodePudding user response:

Top, does anyone know?
  • Related