Author Topic: Authenticator is already active  (Read 6556 times)

Offline Flominator

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Authenticator is already active
« on: February 21, 2013, 12:10:59 PM »
Hi there,

after updating from 6.7.6.0 to 6.11.2.0 I'm not able to pair anymore.

I use this code:

Code: [Select]
switch( this.m_btDevice.Radio.API )
            {
               case wclBluetoothAPI.baMicrosoft:
               case wclBluetoothAPI.baBlueSoleil:
                  m_authenticator.Radio = this.m_btDevice.Radio;
                  m_authenticator.Open();
                  m_authenticator.OnPINRequest += new wclPINRequestEventHandler( this.OnPINRequest );
                  bSilentAuthentification = true;
                  break;
            }

            // is paired ??
            bool bPaired = false;
            this.m_btDevice.Device.GetPaired(this.m_btDevice.Radio, ref bPaired);
            if( bPaired == false )
            {
               if( bSilentAuthentification == false )
               {
                 //show some message box
               }
               m_BTState = BTConnectionState.Pairing;
               int iPaired = this.m_btDevice.Device.Pair(this.m_btDevice.Radio);
               MessageBox.Show(wclErrors.wclGetErrorMessage(iPaired));
            }
               // connection timeout in milliseconds
               // m_client.ConnectTimeout = 20000;
               m_client.BluetoothParams.Address = this.m_btDevice.Device.Address;
               if (m_client.BluetoothParams.Radio == null)
               {
                  m_client.BluetoothParams.Radio = this.m_btDevice.Radio;
               }
               m_client.BluetoothParams.Service = wcl.wclUUIDs.SerialPortServiceClass_UUID;
               m_client.Transport = wcl.wclClientTransport.ctBluetooth;
               m_BTState = BTConnectionState.Starting;

               m_client.Connect();

      private void OnPINRequest( object sender, wclPINRequestEventArgs e )
      {
         e.PIN = "the PIN";
      }

I had to remove the PIN from Pair() when updating. Pair now returns "Authenticator is already active" (200) while e.Error in OnConnection returns "Access denied" (33).

The demos "AuthenticatorDemo" and "BluetoothClientDemo" will return 33 as well.

Any ideas?

Thanks in advance,

Flo

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: Authenticator is already active
« Reply #1 on: February 21, 2013, 12:21:16 PM »
Hello,

This is known issue and is already fixed. Please, send us an e-mail to support@btframework.com and we will send you a fixed version.

By our customers request we have reworked the Pair method. Now it works as follow:

It takes PIN as a parameter and does not fire events (all events have been removed from wclBluetoothDevice class). The Pair method trys to pair with device with given PIN. If a target device supports BT 2.1 SSP authentication, the Pair method automatically accepts numeric/passkey comparison. If a target device requires legacy PIN authentication then the Pair method trys to pair with given PIN.

P.S. If you are registered user please send your e-mail from registered e-mail so we can know WCL version to send to you.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: Authenticator is already active
« Reply #2 on: February 21, 2013, 01:00:01 PM »
Hello,

Fixed version has been sent

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: Authenticator is already active
« Reply #3 on: February 21, 2013, 01:29:30 PM »
Have you received the fixed version?

Offline Flominator

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Re: Authenticator is already active
« Reply #4 on: February 21, 2013, 03:23:59 PM »
Yes I have, but unfortunatey I can't see any change to the behaviour. Do I have to change anything within my code?

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: Authenticator is already active
« Reply #5 on: February 21, 2013, 03:27:33 PM »
First, Pair needs PIN as in previouse WCL versions.
Second. As Pair now supports all pairing methods it uses the same callbacks which is used by wclAuthenticator. So you can not use Pair if wclAuthenticator active. Your application should use wclauthenticator for silenauth or Pair for manual pairing.

Offline Flominator

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Re: Authenticator is already active
« Reply #6 on: February 21, 2013, 03:38:40 PM »
Does that mean I should simply remove the call of Pair() when going for silent?

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: Authenticator is already active
« Reply #7 on: February 21, 2013, 03:39:28 PM »
Yes, if you would like to use automatically pairing with wclAuthenticator.

Offline Flominator

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Re: Authenticator is already active
« Reply #8 on: February 21, 2013, 03:52:28 PM »
I did. It now looks like this:

Code: [Select]

switch( this.m_btDevice.Radio.API )
            {
               case wclBluetoothAPI.baMicrosoft:
               case wclBluetoothAPI.baBlueSoleil:
                  m_authenticator.OnPINRequest += new wclPINRequestEventHandler(this.OnPINRequest);
                  m_authenticator.OnPaired += new wclPairedEventHandler(m_authenticator_OnPaired);
                  m_authenticator.Radio = this.m_btDevice.Radio;
                  int iOpen = m_authenticator.Open();
                  MessageBox.Show("Open returned: " + wclErrors.wclGetErrorMessage(iOpen));
                  break;
            }

            m_client.BluetoothParams.Address = this.m_btDevice.Device.Address;
            if (m_client.BluetoothParams.Radio == null)
            {
               m_client.BluetoothParams.Radio = this.m_btDevice.Radio;
            }
            m_client.BluetoothParams.Service = wcl.wclUUIDs.SerialPortServiceClass_UUID;
            m_client.Transport = wcl.wclClientTransport.ctBluetooth;
            m_BTState = BTConnectionState.Starting;
            this.OnStateChanged(false, BTState.None, 0);

            this.ShowConnectionState();
            m_client.Connect();

auth.Open returns 0, while e.Error on m_client.OnConnect still is 33 and auth.OnPINRequest is never reached.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: Authenticator is already active
« Reply #9 on: February 21, 2013, 03:57:19 PM »
I guess you use MS BT drivers with BT 2.1 dongle which supports BT 2.1 SSP. So in this case you must use OnNumericComparison or OnPasskey events (depends on your device pairing method). Also, make sure that m_client.BluetoothParams.Authentication = true (it is default value).

If you use BlueSoleil which doesn't support SSP pairing than you have to use Pair method to force PIN pairing.

Can you provide more information about your driver, OS and target device?

Offline Flominator

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Re: Authenticator is already active
« Reply #10 on: February 21, 2013, 04:24:09 PM »
I currently use Microsoft Stack on Windows 7 64bit. I want to connect to a device manufatured by our company by PIN preferably without SSP. Would it help, if I called you?

Pair results in "Authentification failed" in the meantime.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: Authenticator is already active
« Reply #11 on: February 21, 2013, 04:26:30 PM »
Make sure that device is unpaired on PC and PC is unpaired on device.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: Authenticator is already active
« Reply #12 on: February 21, 2013, 04:29:16 PM »
Do you have teamviewer so I can check what is going wrong on your side?

Offline Flominator

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Re: Authenticator is already active
« Reply #13 on: February 21, 2013, 05:01:15 PM »
Please see ticket 325649

 

Sitemap 1 2 3 4 5 6 7 8 9