Author Topic: WCL Demo - SilentAuth  (Read 7140 times)

Offline smalinowski

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
WCL Demo - SilentAuth
« on: June 01, 2015, 09:10:57 AM »
I'm very interested in feature SilentAuth (auto-pairing devices). How to use WclAuthenticator to pair devices automatically? Is there any demo for this feature?

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: WCL Demo - SilentAuth
« Reply #1 on: June 01, 2015, 09:49:51 AM »
Hello,

Take a look on AuthenticatorDemo from WCL package. It shows how to use wclAuthenticator to handle authentication requests.

Offline smalinowski

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: WCL Demo - SilentAuth
« Reply #2 on: June 01, 2015, 11:11:35 AM »
Yep, I've seen. But it didn't helps me.

I have AuthenticatorDemo running on two devices. On first device I click Discover and it works find, then I select discovered  device and click Connect. I get "Unkown error: 44".  I didn't found documentation for these methods
- wclAuthenticator.Open()
- wclAuthenticator.Close()

Should I listen for authentication on second device?  Please give me steps how to auto-pair these two devices using AuthenticatorDemo.
Thank you.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: WCL Demo - SilentAuth
« Reply #3 on: June 01, 2015, 11:24:11 AM »
Hello,

Error 44 means that service not found on target device. the demo by default uses DUN service on cell to connect to (as lot of cells have one). If your target device does not have DUN service change demo code to connect to service you want. For example for Serial Port Profile change this code line

wclClient.BluetoothParams.Service = wcl.wclUUIDs.DialupNetworkingServiceClass_UUID;

to

wclClient.BluetoothParams.Service = wcl.wclUUIDs.SerialPortServiceClass_UUID;

After you start demo click Enum then Open (call to wclAuthenticator.Open() which starts "listening" for auth requests). Then Connect to connect to you device. If your device requires Auth then one of the event fires.

Offline smalinowski

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: WCL Demo - SilentAuth
« Reply #4 on: June 02, 2015, 08:52:45 AM »
Changes to:

wclClient.BluetoothParams.Service = wcl.wclUUIDs.SerialPortServiceClass_UUID;

almost solved problem. When, I click connect then I get below message prompt (see attachment). When I enter default PIN (0000) or empty PIN then I get message: Unable to connect: 43 (I've found this is WCL_E_TIMEOUT). Where is the problem? How to hide or omit this message prompt?

My device spec:
First: Windows 8.1, API: baMicrosoft
Second: Windows 7 Pro, API: Toshiba

I try to connect from First -> Second.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: WCL Demo - SilentAuth
« Reply #5 on: June 02, 2015, 08:55:08 AM »
Have you opened Authenticator (click on Open button) before connect?

Offline smalinowski

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: WCL Demo - SilentAuth
« Reply #6 on: June 02, 2015, 09:27:57 AM »
Yes, on Second device.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: WCL Demo - SilentAuth
« Reply #7 on: June 02, 2015, 10:16:06 AM »
You have to do it on both. On Second you have to run server.

Offline smalinowski

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: WCL Demo - SilentAuth
« Reply #8 on: June 02, 2015, 10:53:42 AM »
Ok it works, device are connected. But user has to enter PIN, without this can't connect. It is possible to omit these step?

Other issue, I can connect from First (win8) -> Second (win7), but can't connect Second -> First. I get error: WCL_E_SERVICE_NOT_FOUND.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: WCL Demo - SilentAuth
« Reply #9 on: June 02, 2015, 12:32:46 PM »
You have to run server with wclAuthenticator on PC you want connect to. Toshiba has default (build-in) SPP server running. MS has no one. In any case to be able to process data on both sides you have to run client on one side and server on other. Take a look on BlueChatClient/BlueChatServer demos.

Offline smalinowski

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: WCL Demo - SilentAuth
« Reply #10 on: June 03, 2015, 09:16:18 AM »
Still not works. Let me explain
A. I try to auto-pair devices using Authenticator Demo. I follow these steps

1. Click Open on Device A (Win8/baMicrosoft)
2. Click Open on Device B (Win7/Toshiba)
3. Click Discover on Device A. Device B has been found. Select Device B.
4. Click connect.
5. On Device B  native message box is shown (screen attached in previous post) to confirm authentication. PIN number must be given (If not authentication fails).
6. I put PIN in message box on Device B (default 0000).
7. On device A message is shown - authentication success.  Device are paired.

Summary:
- Firstly, device are paired but not silently. I want to omit these steps 5-6.
- Secondly, when I swap devices in given scenario (Device A = Win7/Toshiba) then after step 4 occurs error: WCL_E_SERVICE_NOT_FOUND. Propably this is incorrect:                   
wclClient.BluetoothParams.Service = wcl.wclUUIDs.SerialPortServiceClass_UUID;

B. I try to auto-pair devices using ChatClient/ChatServerDemo.
1. Click Listen on Device A
2. Click discover on Device B. Device A has been found. Select Device A.
3. Click connect on Device B.
4. On Device B  native message box is shown (similar to previous scenario, but without textBox for PIN) to confirm authentication. Click OK to confirm.
5. I get WCL_E_TIMEOUT. Windows shows tooltip authentication with Device A went wrong.

I am really interested in buy your library but now I'm not satisfied enough. Please help.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: WCL Demo - SilentAuth
« Reply #11 on: June 03, 2015, 09:24:40 AM »
Hello,

As I already told to be able to handle authentication requests with Toshiba stack you must run WCL based server and authentication in one application  on server side. It must not be native (build-in) server but server running by wclServer class. That is by Toshiba API design. But you have to use the same way for any stack as low-level API may change.

By the way, if you conectorl both sides you do not need pairing actualy.

Offline smalinowski

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: WCL Demo - SilentAuth
« Reply #12 on: June 04, 2015, 01:17:08 PM »
Ok, thank you. I understood :)

I change a ChatClient/Server demo by adding wclAuthenticator. Now I can auto-pair devices but... still not silently.

A. When I try connect from A (client/baMicrosoft) to B (server/baToshiba) then windows message box is shown. I need to pass PIN (see attachment TPBluetoothConfirm.png). I pass pin and then devices are paired.

B. When I try connect from B to A  then then windows message box is shown. I don't have to pass PIN (see other attachment). I click on and then devices are paired.

I've tried many combinations with OnPasskey and OnPINRequest events but nothing works.


"By the way, if you conectorl both sides you do not need pairing actualy."
Do you mean that I don't need pairing devices to send data? How to do that? I tried without authenticator and it not works.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: WCL Demo - SilentAuth
« Reply #13 on: June 04, 2015, 02:37:53 PM »
Hello,

The dialog appears when you connect to default Toshiba SPP  service. Disable all default services first.

To be able to connect without PIN you have to set wclClient.BluetoothParams.Authentication = false and wclServer.BluetoothParams.Authentication = false

By the way, which Toshiba version do you use?

Offline smalinowski

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: WCL Demo - SilentAuth
« Reply #14 on: June 04, 2015, 08:16:06 PM »
I stopped TOSHIBA Bluetooth Service and also Bluetooth Support Service. It doesn't help, confirmation message box still apper :(

I develop application for Panasonic FZ-G1 ToughPad. Unfortunetaly, this tablet has system downgraded from Win8 to Win7. It has bluetooth drivers installed:
Bluetooth RFBUS: 9.0.1905.0
Bluetooth RFCOMM: 8.0.281.0
Bluetooth RFHIB: 9.0.801
Bluetooth V4.0 Module: 8.1.1919.0

 

Sitemap 1 2 3 4 5 6 7 8 9