Author Topic: wclClient write hangs  (Read 6994 times)

eeybye

  • Guest
wclClient write hangs
« on: March 12, 2015, 05:18:53 PM »
I have discovered, when I power off my BT device, Write method on wclClient hangs forever - no timeout period.

My application uses wclVirtualPort to open a serial port to a BT device using the SerialPortClass. When opened, it uses a
wclClient to connect to the device using trSerial as transport. That works well and connection is fine.

When I then try to shutdown the BT device, the Write function just hangs on the wclClient object and never returns.

I'm using the wcl library inside a System.Windows.Threading.Dispatcher and every action is invoked on the Dispatcher thread - works also well.

So the question is, why does the Write method hang ? Are there any real long timeout or ??

BR,
Erling

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: wclClient write hangs
« Reply #1 on: March 12, 2015, 05:49:07 PM »
Hello,

First I must say that you are using WCL in wrong way. You should not use any vCOM with Bluetooth enabled devices. Use direct Bluetooth connection with trBluetooth instead.

Now about your problem. As COM port has no mechanism to know that Bluetooth device is turned off it can not return error immediately and will wait for a long time for timeout (or even may not fire any timeout).

eeybye

  • Guest
Re: wclClient write hangs
« Reply #2 on: March 13, 2015, 02:12:31 PM »
Hello,

Thank you for your response. I tried using the wclClient directly without using Virtual com port, and it works - sometime. It turned out it was our embedded device, which doesn't handle the bluetooth correctly.

 

Sitemap 1 2 3 4 5 6 7