Author Topic: SPP Connection with WCL  (Read 7382 times)

BT_User

  • Guest
SPP Connection with WCL
« on: September 02, 2010, 10:27:54 PM »
Hi

I am trying to receive  a file from an external device using SPP interface. My project is .NET project (C#) and I am using demo version of WCL.
Basically, device wakes up sometimes and is available for a SPP connection. I managed to connect to it
using discover and connect interfaces (wclBluetoothDiscovery, wclClient). After a successful connection I  have a ZModem interface which opens connected port and gets the file. I have three cases about this scheme and none of them worked.

1. After I setup

wclClient.Transport = wcl.wclClientTransport.ctBluetooth;

I connect but there is no information that describes which COMM port is used for current connection. Even I hard coded comm port that used for current connection, obviously COMM port is already open and my ZModem interface cannot open same port.

2. After I setup

wclClient.Transport = wcl.wclClientTransport.ctSerial;

I connect but I have to hard code port number and again port is already open and I cannot open same port.

3. After I setup

wclClient.Transport = wcl.wclClientTransport.ctSerial;

I created a virtual COMM port using wclVirtualCOMPort that solved to get the port number but again port is already open and I cannot open same port.


Is there anyway that I can find out which COMM port is used for current connection? I prefer to connect to device like case #1.

Also after I connect to remote device SPP service, is it possible to keep COMM port NOT allocated by WCL? That way I can use my ZModem interface to open COMM port and get the file.

Regards,


Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: SPP Connection with WCL
« Reply #1 on: September 02, 2010, 10:37:45 PM »
Hi,

COM ports is used for wired connection. Bluetooth is wireless one. Use wclClient and its method Write to send data to device and OnData event to process received data.

Do not use COM ports for Bluetooth. It is old and bad idea.

BT_User

  • Guest
Re: SPP Connection with WCL
« Reply #2 on: September 03, 2010, 03:47:59 PM »
Thanks for the advice,

Unfortunately Zmodem API works only for COMM port, I will try to convert the code to accept data coming from wclClient_OnData  function but it wont be easy...

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: SPP Connection with WCL
« Reply #3 on: September 03, 2010, 04:32:00 PM »
Possible solution: com0com. One COM port is "connected" to WCL, second one is used by ZModem API.

 

Sitemap 1 2 3 4 5 6 7