This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

pairing in rejected when running central as windows service

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

Parents
  • Hello,

    I don't know why it doesn't work when you run it as a service and not an .exe, and it may be a bit outside our area of expertise. 

    As for the event on the nRF:

     

    BLE_GAP_EVT_AUTH_STATUS: status=0x1 bond=0x0 lv4: 0 kdist_own:0x0 kdist_peer:0x0 procedure: Bonding, error: 1

     Means:

    status:0x1 = BLE_GAP_SEC_STATUS_TIMEOUT

    bonded:0x0: This did not result in a bond.

    lv4: 0: security level 4 is not supported.

    Perhaps it would be useful for you to look at a sniffer trace of the bonding procedure. I suggest you look into the nRF Sniffer. Perhaps it shows what part of the bonding that fails. Other than that, I guess you need to debug your application (I am not familiar with Bluetooth apps running on Windows). Perhaps it doesn't have the same permissions in service and .exe mode? At least it looks like it fails to reply to the bonding procedure. 

    Feel free to upload the sniffer trace if you need more input. Preferably one trace captured while running .exe and one while running the service.

    Best regards,

    Edvin

Reply
  • Hello,

    I don't know why it doesn't work when you run it as a service and not an .exe, and it may be a bit outside our area of expertise. 

    As for the event on the nRF:

     

    BLE_GAP_EVT_AUTH_STATUS: status=0x1 bond=0x0 lv4: 0 kdist_own:0x0 kdist_peer:0x0 procedure: Bonding, error: 1

     Means:

    status:0x1 = BLE_GAP_SEC_STATUS_TIMEOUT

    bonded:0x0: This did not result in a bond.

    lv4: 0: security level 4 is not supported.

    Perhaps it would be useful for you to look at a sniffer trace of the bonding procedure. I suggest you look into the nRF Sniffer. Perhaps it shows what part of the bonding that fails. Other than that, I guess you need to debug your application (I am not familiar with Bluetooth apps running on Windows). Perhaps it doesn't have the same permissions in service and .exe mode? At least it looks like it fails to reply to the bonding procedure. 

    Feel free to upload the sniffer trace if you need more input. Preferably one trace captured while running .exe and one while running the service.

    Best regards,

    Edvin

Children
No Data
Related