Wireless Communication Library Support Forum

Frameworks => Bluetooth Framework => Topic started by: MattWhitfield on March 11, 2010, 05:24:59 PM

Title: Issues with WCL and Toshiba stack
Post by: MattWhitfield on March 11, 2010, 05:24:59 PM
Hello again!

I got my software working reliably developing against the WIDCOMM stack - no problems. I was just about to order the software, and my colleague suggested that we try the application on some other stacks. So we tried on two different TOSHIBA stacks, one using 5.10.14 and one using 6.01.03. It failed on both.

On the 5.10.14 stack pairing failed with 'Internal Driver Error'. After connecting to the device manually using the bluetooth driver software, it connects OK.

On the 6.01.03 stack, pairing went OK, but then e.Error was set in the OnConnect event of wclClient (44). I tried this with your BluetoothClientDemo sample, and it did exactly the same thing.

Is there anything obvious that I might be missing, because I can't really release my application if it only works on WIDCOMM, and that was the idea of using the WCL library in the first place - to avoid having to implement separately against 4 separate stacks.

Thanks

Matt
Title: Re: Issues with WCL and Toshiba stack
Post by: Mike Petrichenko on March 11, 2010, 05:46:48 PM
What OS and WCL version do you use? Error 44 means WCL_E_SERVICE_NOT_FOUND - WCL can not find requred service on your device. What device do you use? BluetoothClientDemo uses only SerialPort Profile and DialUp network profile.
Title: Re: Issues with WCL and Toshiba stack
Post by: MattWhitfield on March 11, 2010, 06:06:10 PM
Mike

The O/S was windows XP in all cases. WCL version is 6.7.3. The device is not a standard device - but it connects just fine using the WIDCOMM stack as I mentioned. Also, the toshiba software can connect to the serial port OK, but driving it via WCL is doesn't work. Your demo app also connects fine on the WIDCOMM stack - again using the serial port profile.

Cheers

Matt
Title: Re: Issues with WCL and Toshiba stack
Post by: Mike Petrichenko on March 11, 2010, 06:13:17 PM
Hi

Have just tested and found that the problem you reported exists. Give us few minutes to investigate it deeply and I will back to you. Or better, contract me directly my MSN/ICQ/Skype/Yahoo.
Title: Re: Issues with WCL and Toshiba stack
Post by: MattWhitfield on March 11, 2010, 06:25:31 PM
Mike,

Thanks. I don't have any IM facility at work here unfortunately! I will try and get one installed tomorrow...

Thanks again

Matt
Title: Re: Issues with WCL and Toshiba stack
Post by: Mike Petrichenko on March 11, 2010, 06:46:13 PM
Ok, first test shows that the issue was in Toshiba. It even could not pair (by using toshiba BT tool). It was Samsung NC10 with build-in widcomm dongle.

Going to test it on other notebook.
Title: Re: Issues with WCL and Toshiba stack
Post by: Mike Petrichenko on March 11, 2010, 10:19:02 PM
Ok, Tested:

42001T_20060711 - OK
51012T_20070531 - First install - FAILED, second install - OK
51016x32_20070910 - OK
60009(F)_XPTPC,VISTA_CA41534-3554 - First install - FAILED, second install - OK
v70016T_20091106_x32 - OK
v71004T_20091210_x64 - OK

51012T_20070531 and 60009(F)_XPTPC,VISTA_CA41534-3554 were installed and did not work (with or without WCL). Then them were uninstalled and installed again - second attemp was success.

The results above are absolutly normal for Toshiba stack.
Title: Re: Issues with WCL and Toshiba stack
Post by: MattWhitfield on March 12, 2010, 09:35:05 AM
Mike

So what should I do in my code to ensure a successful pair and connect? Should I just connect twice?

With the version 6 stack, trying multiple times didn't have any effect, and your software always just said connect failed (44). In both situations, WCL has not been able to pair / connect - but the Toshiba software has. Is there any way that I can program around this?

Thanks

Matt
Title: Re: Issues with WCL and Toshiba stack
Post by: Mike Petrichenko on March 12, 2010, 09:52:03 AM
Hi,

Unfortunatly I can not say what can be wrong on your side without know what kind of device you use. Check with BluetoothDiscovery demo which services device has. Check that requered service can be enumerated. Also make sure that there is no parallel calls to toshiba stack.

All times I got failed with test toshiba didn't work too.
Title: Re: Issues with WCL and Toshiba stack
Post by: MattWhitfield on March 12, 2010, 03:53:03 PM
Mike

As I said before, it's a custom device. It only offers the serial port profile (again, as stated before, this works fine under WIDCOMM).

I will run the bluetooth discovery demo on the machines and let you know the results. In the mean-time, can you say what you mean by 'make sure that there is no parallel calls to toshiba stack'? My application manages two message loops, one which handles the device connection, and one which handles a continuous discovery process. During the connection to the device, the discovery process is terminated, and resumes afterwards (again this works fine on WIDCOMM). Could that be a source of problems?

At the end of the day, I need to try and create a reliable connection to these custom devices using various stacks, so any help you can give me in achieving that goal is much appreciated.

Also - do you have any documentation that can be read in order to find out these things like 'make sure there are no parallel calls to toshiba stack'? It's kind of natural to assume that WCL would handle these restrictions internally, seeing as it is a library. But it doesn't handle message loop creation etc, so is there defined somewhere a list of DOs and DONTs?

Thanks again for your help

Matt
Title: Re: Issues with WCL and Toshiba stack
Post by: Mike Petrichenko on March 12, 2010, 04:03:14 PM
Hi,

Yes, I undertood that it is custom device but I thought it has own service. May be Toshiba does not see its services. Every stack has own API and own implementation. What possible with one (WidComm) may be the problem with other (Toshiba). That is why I do not like when WCL is used in mutly threaded applications as well as I do not recomend to use any parallel operations.

'make sure that there is no parallel calls to toshiba stack' means: no one stack (in common case, better if you will think that "no one stack") allow to execute concurent operations (especialy BlueSoleil and Toshiba). It means that if you discover for devices you can no connect, pair or something else. If you connect/connected - you can not pair/discovery. One operation at time.

If you would like you can contact me by MSN or we can start remote debuging session (TeamViewer).
Title: Re: Issues with WCL and Toshiba stack
Post by: MattWhitfield on March 12, 2010, 04:34:06 PM
Mike

Ok thanks. I don't have access to the machines which have the toshiba stacks on (they were borrowed from colleagues) at the moment, when I do, I will test the bluetooth discovery demo on them, let you know the results and then arrange a debugging time with you.

Thanks again

Matt
Title: Re: Issues with WCL and Toshiba stack
Post by: Mike Petrichenko on March 12, 2010, 04:47:55 PM
Ok, I'm mostly online on MSN/ICQ/Skype/Yahoo so you can contact me online to make this faster.
Title: Re: Issues with WCL and Toshiba stack
Post by: Sebastian Herp on March 12, 2010, 06:28:11 PM
Just replying to let you know that we have the same problem "connect failed (44)" with the BluetoothClientDemo on a Toshiba Tegra S10-129 (Toshiba stack version 7.10.04).

Sometimes it works, sometimes it doesn't ...
Title: Re: Issues with WCL and Toshiba stack
Post by: Mike Petrichenko on March 12, 2010, 07:01:14 PM
As I wrote Error 44 means Service Not Found. By some reason Toshiba can not find the service specified. All I can do is just try to help you debug this situation with TeamViewer.
Title: Re: Issues with WCL and Toshiba stack
Post by: Sebastian Herp on March 12, 2010, 07:10:25 PM
Hello Mike,

you are right. The customer had no idea how to use the bluetoothclientdemo correctly :-)

But I had a Teamviewer session with him and the problem is now a lot clearer to me. Apparently it will always hang if I try to open a connection while disconnecting. If I wait long enough until the bluetooth icon in the taskbar turns from blue to white, everything is ok.

I also noticed that the connected device is unable to send data while the pc-software is crashing/hanging. If I reset the device or disconnect via the taskbar icon, everything seems to be ok again.

So the question seems to be: do we have to wait for the OnDisconnect event with Toshiba stacks before reconnecting again?

Greetings
Title: Re: Issues with WCL and Toshiba stack
Post by: Mike Petrichenko on March 12, 2010, 07:13:32 PM
Hi,

That is exactly I wrote erly :) You have to wait wait Discovery operation done and then connect/pair/discover (do other operation).

if you need to connect to the same device - then you have to wait OnDisconnect event fires (or OnConnect with Error).

if you need to connect to other device - wait when connection to first one will be established (OnConnect fires with or without success).

When connections are done - you can exchange data with both (or more) devices at the same time.

P.S. Can you tell me more about crash? It looks like a bug if app crashes/dies.
P.P.S. I had nothing in mind about customer's qualification :) Just thought you/he has understand what I meant on "parallel operations"
Title: Re: Issues with WCL and Toshiba stack
Post by: Sebastian Herp on March 12, 2010, 07:22:08 PM
Ok, my "reading qualification" this late on a friday isn't that good either.

The application we wrote just hang with "no reaction" ("keine R
Title: Re: Issues with WCL and Toshiba stack
Post by: Mike Petrichenko on March 12, 2010, 07:29:23 PM
Can you send me your app on mike@btframework.com - I'll take a look on it here. As It uses just SPP profile I guess it can connect to any Cell Phone (does not matter if it can not communicate), cann't it?
Title: Re: Issues with WCL and Toshiba stack
Post by: Mike Petrichenko on March 12, 2010, 07:43:22 PM
Have just played with BluetoothClientDemo and Toshiba v71004T_20091210_x64 and SE K750i. Win 7 Ultimate 64 bit. All works fine :(
Title: Re: Issues with WCL and Toshiba stack
Post by: Sebastian Herp on March 13, 2010, 12:31:37 AM
I can tell you that it seems to work now that I disabled any interaction with the bluetooth functions while connecting or disconnecting. The Toshiba stack apparently really dislikes multitasking while the other stacks didn't complain in my tests.

BluetoothClientDemo did hang when our software "killed" the connection. We had no problem when BluetoothClientDemo was the only software making a connection.

So everything is fine now. Thank you very much for the hints :-)
Title: Re: Issues with WCL and Toshiba stack
Post by: Mike Petrichenko on March 13, 2010, 06:37:58 AM
Great that you get it working. And yes, toshiba is worst stack at all.