Wireless Communication Library Support Forum

Frameworks => Bluetooth Framework => Topic started by: hessuhessu on November 17, 2009, 10:16:18 AM

Title: Pairing
Post by: hessuhessu on November 17, 2009, 10:16:18 AM
I am using widcom stack and i was wondering is it possible to do the pairing so other way than with
Device.Pair( e.Radio, a_PIN ); cause it seems that when i do this my porgrams goes to notresponding stat untill the
pairing is doen.. also how can i check if the device is allredy paired so i don't need to do the pairing again?

Thanks for help!
Title: Re: Pairing
Post by: Mike Petrichenko on November 17, 2009, 10:19:45 AM
Hi,

You can use wclAuthenticator for automaticaly pair devices.

To check is device paired or not use Device.GetPaired function.
Title: Re: Pairing
Post by: hessuhessu on November 17, 2009, 10:24:46 AM
is there some exmaple that i could check out how the authentificator works?
Title: Re: Pairing
Post by: Mike Petrichenko on November 17, 2009, 10:27:25 AM
Authenticator Demo.

P.S. The wclAuthenticator is available in Personal and Developer Licenses only.
Title: Re: Pairing
Post by: hessuhessu on November 17, 2009, 10:30:55 AM
i checked thaht we did bought the developer license! Thanks for the help!
Title: Re: Pairing
Post by: hessuhessu on November 17, 2009, 10:49:48 AM
is there alos some how that i could check if the devices has been paired so i could start connection..
Title: Re: Pairing
Post by: Mike Petrichenko on November 17, 2009, 11:44:05 AM
Yes, I wrote before: Device (TwclBluetoothDevice object) has method GetPaired
Title: Re: Pairing
Post by: hessuhessu on November 17, 2009, 11:59:37 AM
yes.. i think i am doing that but the pairing does not start untill i try to make connection to the devices. i Would like to first check the pairing and pair the devices that are not paired and then connect the devices to my system.
:)
Title: Re: Pairing
Post by: hessuhessu on November 17, 2009, 12:06:33 PM
I think i mean thaht i would like to first pair all the needed devices with the sytem and form a connection after all the devices are paired. but if i activate the authentificatro and for example check in while loop if the devices thaht i want are paired mys program will never get out of the while loop cause tha pairing doesent seem to start..
Title: Re: Pairing
Post by: Mike Petrichenko on November 17, 2009, 12:20:37 PM
I am sorry, I didn't explaing it all. My fault :)

With wclAuthenticator you do not need to think about pairing and paired devices. Simple activate wclAuthenticator (please, refer to Authentication Demo). The set wclClient.BluetoothParams.Authentication = true. And then simple call wclClient.Connect. If device need pairing then OnPINRequest even fires (from wclAuthenticator) and your application should provide PIN code for device. If pairing will complete success (and connection established) onConnect event fires (from wclClient) with Error = WCL_E_SUCCESS. If pairing will not complete with success or connection will not established then Error parameter will contain error code (for example, WCL_E_ACCESS_DENIED).

The same for wclOPPClient, wclFTPClient, wclServer and wclOPPServer.

So with using this you do not need to check device's paired status and do not need to think how to pair with device.
Title: Re: Pairing
Post by: hessuhessu on November 17, 2009, 12:55:49 PM
hi again.. i think that the authentificator is not working properly.. or int he pairing with the authentificator seems to be something wrong.. When i doesn't use it and do the paring by hand my system pairs the devices first altought freezes for a while and then forms connections and all seems to be in order. But when i try to do the connection with the authentificator my system can make usually first and second connection but then it freezes and for a while i get error code 43 from the wclClient_OnConnect(object sender, wcl.wclConnectEventArgs e) event.. i am using widcomm so coudl the problem be in this or what..
my connection also uses wclClient_OnData(object sender, wcl.wclDataEventArgs e) event where i read data coming from my sesnor...
Title: Re: Pairing
Post by: hessuhessu on November 17, 2009, 01:03:37 PM
and hai again.. When do the connection with using my old bleutooth dongle that uses MS stack.. the connection works smooth as silk :D so i think there might be something wrong with the widcomm bluetooth pairing or connection..
Title: Re: Pairing
Post by: Mike Petrichenko on November 17, 2009, 01:06:22 PM
So connection works fine with WD and MS if you use it without wclAuthenticator. And if you use wclAuthenticator then it works good only with MS, am I correct? If so, can you please tell me your widcomm driver version? I will recheck it and fix if there is something wrong with my coding or will try to find workaround if there is something wrong with widcomm.
Title: Re: Pairing
Post by: Mike Petrichenko on November 17, 2009, 01:07:49 PM
Also, do you use latest WCL version (6.6.7)? Or other?
Title: Re: Pairing
Post by: hessuhessu on November 17, 2009, 01:13:12 PM
hi
i havent tried with MS satck without the authentificator should i do that first?
Title: Re: Pairing
Post by: hessuhessu on November 17, 2009, 01:27:35 PM
yep. MS works with and without the authentificator and widcomm only without. My library version is 6.6.7.0:

Dvice:
manufacturer broadcom
firmware version 2.2.14.291
HCI version: bluetooth HCI 2.1
HCI revision: 5123
LMP version: bluetooth LMP 2.1
LMp sub version : 420E

widcomm bluetooth software 5.5.0.7400

do you need enything else.. or am i even giving the right stuff :)
Title: Re: Pairing
Post by: hessuhessu on November 17, 2009, 01:30:53 PM
the device manage ment gives thaht the driver version is 5.5.0.7100...
Title: Re: Pairing
Post by: Mike Petrichenko on November 17, 2009, 01:33:08 PM
Thanks, That is all I need. I will check it and back to you soon. Will try to do it ASAP.
Title: Re: Pairing
Post by: Mike Petrichenko on November 18, 2009, 01:31:28 PM
Hi,

I have found the problem and will prepare the fix as soon as possible. I will let you know when it will be done and then we decide what to do :)
Title: Re: Pairing
Post by: Mike Petrichenko on November 20, 2009, 06:51:29 AM
Hi,
Problem has been fixed. Download this file (http://www.btframework.com/wcl/wcl2wbt.zip) and replace old one from the package. You need WCL 6.6.7.