Author Topic: Serial Port List  (Read 4040 times)

Offline marko_shock

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
Serial Port List
« on: October 13, 2010, 03:53:02 PM »
I am pretty much sure that I can Enum available services on paired device but can I start DUN or SerialPort service on paired Device via BTF 6.7.7.0 ?

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3053
  • Karma: 1000
    • Soft Service Company
Re: Serial Port List
« Reply #1 on: October 13, 2010, 04:24:43 PM »
Yes, you can do it easy. See BluetoothClient demo. But as I told before you can not enumerate created serial ports and it is very bad idea to use ny serial port (virtual) to communicate with bluetooth enabled devices. Use direct bluetooth connection instead.

Offline marko_shock

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
Re: Serial Port List
« Reply #2 on: October 13, 2010, 06:22:33 PM »
In example code I found this code snippet:
  if wclClient.State <> csDisconnected then
    MessageDlg('Client is active', mtWarning, [mbOK], 0)
  else
    if not wclVirtualCOMPort.Active then
      MessageDlg('COM Port was not created', mtWarning, [mbOK], 0)
    else begin
      wclClient.Transport := ctSerial;
      wclClient.SerialParams.Port := wclVirtualCOMPort.Port;
      wclShowError(wclClient.Connect);

And does not work well. I always got error 44 meaning service not available but that is not true. I Can do manual pairing(MS BT Stack) and do manual activation of Serial Port service. After that I can just use hyperterminal and send at command to phone to which I am paired.

where I am making mistake ? or this is some know/unknown bug ?

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3053
  • Karma: 1000
    • Soft Service Company
Re: Serial Port List
« Reply #3 on: October 13, 2010, 06:30:17 PM »
As i told you MUST not use any Virtual COM ports use wclClient instead. And yes, there was a bug in C++ and .NET editions.

Offline marko_shock

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
Re: Serial Port List
« Reply #4 on: October 13, 2010, 07:14:02 PM »
First of all tank you for very fast answers.

I have read http://forum.btframework.com/index.php/topic,986.0.html and that was quite helpful. I should you proper GUID
Can I just shortly explain my agenda for BTF WCL component in order to understand me better.

I have some capable to control datacards such as Option-Etna or huawei k4505. In my app I simple use at command to setup 2G or 3G mode and then I create "internet" connect and use it. My key goal is to BTF in order to represent Bluetooth capable phones as modes/datacards to my app so I would not need to change to much code in my App.

1. Discover device with given name
2. Pair with device there is need for this
3. Activate Dialup and Serial port service
4. Use phone as datacard/modem to establish internet connect

I have succeed to establish connection like in blueChatClient Demo but that doesn't helps me.

    wclClient.Transport := ctBluetooth;
          wclClient.BluetoothParams.Address := lvDevices.Selected.Caption;
          wclClient.BluetoothParams.Radio := Radio;
          wclClient.BluetoothParams.Service := StringToGUID('{00001101-0000-1000-8000-00805F9B34FB}');/
          wclClient.BluetoothParams.Authentication := True;
          wclClient.BluetoothParams.Encryption := False;
          wclShowError(wclClient.Connect);
with this code on my phones (Nokia,Samsung) I got DUN or SerialCOnnection but simple that connection is not functional. I don't have same behaviour of MS BT Stack as I do manual pairing then select device->properties->services->then select DUN or SerialPort -> click on apply. With Manual approach I will have "stadard modem over bluetooth link" installed automatically. With code given above I don't have this "stadard modem over bluetooth link" automatically installed.
I know that I am one of million who bothering you but is my plan feasible with latest BTF ?   

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3053
  • Karma: 1000
    • Soft Service Company
Re: Serial Port List
« Reply #5 on: October 13, 2010, 07:45:18 PM »
Hi

I got you. Unfortunately there is no way to create "Standard modem" as to use it as GPRS/GSM modem then in common case. If you need just send and receive AT commands (without FULL DUN functional on PC) use wclClient as it is shown in BluetoothClient demo. With wclClient you can send AT commands to device and receive its answer. But there is no way toturn it work as its windows does to be able to use your internet browser. It is stack limitation. It may be possible with other stacks but WCL does not include such functionality.

So there is no way tot initialize GPRS/GSM internet connection. It can be done with wclClient but your application must include PPP and NDIS implementation to send traffic between MS netwrok drivers (TCP/IP) and between you connection.

 

Sitemap 1 2 3 4 5 6 7 8 9