Author Topic: How to write an read strings to/from a device with SPP profile only?  (Read 11711 times)

lanisoft

  • Guest
Hi,
i don't know how to connect with a device with SPP. Can you help me?
I write:

SerialPortServiceClass_UUID = "{00001101-0000-1000-8000-00805F9B34FB}"

        wclClient.Transport = ctBluetooth
        wclClient.BluetoothParams.Address = "(00:07:80:91:19:F8)"
        wclClient.BluetoothParams.Radio = Radio
        wclClient.BluetoothParams.Service = SerialPortServiceClass_UUID
        wclClient.BluetoothParams.Authentication = False
        wclClient.BluetoothParams.Encryption = False
        wclClient.BluetoothParams.Channel = 1
       
        wclAPI.ShowError (wclClient.Connect)

but the result is error on connect 45. What is the error? UUID? Channel?
Thanks in advanced.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: How to write an read strings to/from a device with SPP profile only?
« Reply #1 on: August 31, 2009, 06:40:24 PM »
Hi,

Add

uses
  wclUIIDs;

Remove this line:
  SerialPortServiceClass_UUID = "{00001101-0000-1000-8000-00805F9B34FB}"

Depends on your device but usualy:
  wclClient.BluetoothParams.Authentication = True

Remove this line:
  wclClient.BluetoothParams.Channel = 1

Of course, if your device has SPP

lanisoft

  • Guest
Re: How to write an read strings to/from a device with SPP profile only?
« Reply #2 on: September 02, 2009, 10:42:54 AM »
Hi,
I dont understand you say with
uses
  wclUIIDs;

I am testing wcl in VB6.

I can connect with this lines

wclClient.Transport = ctBluetooth
wclClient.BluetoothParams.Address = "(00:07:80:91:19:F8)"
wclClient.BluetoothParams.Radio = Radio
wclClient.BluetoothParams.Service = "{00001101-0000-1000-8000-00805F9B34FB}" or "{00001124-0000-1000-8000-00805F9B34FB}" or "{00001126-0000-1000-8000-00805F9B34FB}"
wclClient.BluetoothParams.Authentication = False
wclClient.BluetoothParams.Encryption = False
wclClient.BluetoothParams.Channel = 1


then write this

wclClient.Connect
While wclClient.State <> csConnected
  DoEvents
Wend
wclAPI.ShowError (wclClient.Write(PALABRA))
wclClient.Disconnect
While wclClient.State <> csDisconnected
  DoEvents
Wend


but the device not disconnects. Can you tell me what happen?
Thanks in advanced

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: How to write an read strings to/from a device with SPP profile only?
« Reply #3 on: September 02, 2009, 12:59:43 PM »
Hi,

you have posted topic in WCL VCL Edition so I thought that you use Delphi. There is topics for COM Edition.

wclClient.Connect

after you called Connect wait OnConnect event. Waiting in loop is wrong

The you can write

wclAPI.ShowError (wclClient.Write(PALABRA))

And disconnect

wclClient.Disconnect

Wait for OnDisconnect event. Waiting in loop is wrong.

 

Sitemap 1 2 3 4 5 6 7