I'm trying to pair my peripheral with the central using BLE.
In the central code (running on windows c#):
device.DeviceInformation.Pairing.Custom.PairingRequested += Custom_PairingRequested; DevicePairingResult devpairres = await device.DeviceInformation.Pairing.Custom.PairAsync(DevicePairingKinds.ProvidePin, DevicePairingProtectionLevel.Encryption); device.DeviceInformation.Pairing.Custom.PairingRequested -= Custom_PairingRequested;
In the peripheral terminal:
the device in sending PM_EVT_CONN_SEC_PARAMS_REQ but then I receive BLE_GAP_EVT_AUTH_STATUS status = 1:
PM_EVT_CONN_SEC_FAILED
BLE_GAP_EVT_AUTH_STATUS: status=0x1 bond=0x0 lv4: 0 kdist_own:0x0 kdist_peer:0x0 procedure: Bonding, error: 1
Also, DevicePairingResult (in the central) return Failed, PairingRequested isn't fired and in the windows event viewer I get:
An incoming authentication request from a remote device ([address]) was rejected.
It works fine when I run my central app as an exe, but not as service.
Is there as issue in windows services or my problem in the SD or peripheral?
Best regards
Litaf