Wireless Communication Library Support Forum

Frameworks => Bluetooth Framework => Topic started by: viriato on May 06, 2008, 10:37:08 AM

Title: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 06, 2008, 10:37:08 AM
Simply example:

Code: [Select]
Private Sub Command1_Click()
    Dim mApi As wclAPIx
    Dim mDiscovery As wclBluetoothDiscoveryx
    Dim mRadios As wclBluetoothRadiosx
    Dim mDevice As wclBluetoothDevicex
    Dim mDevices As wclBluetoothDevicesx
   
    Set mApi = New wclAPIx
    mApi.Load
   
    List1.AddItem ("Api Loaded: " + mApi.Version)
    Set mDiscovery = New wclBluetoothDiscoveryx
    Set mRadios = mDiscovery.EnumRadios
    List1.AddItem ("Radios loaded: " + Str(mRadios.Count))
    Set mDevices = mDiscovery.Discovery (mRadios(0))
    Set mDevice = mDiscovery.SelectDevice(mRadios(0))
End Sub

Code: [Select]
Set mDevices = mDiscovery.Discovery(mRadios(0))
Expected function or variable.

Code: [Select]
Set mDevice = mDiscovery.Discovery(mRadios(0))
Object doesn't support this property or method.


So I can't retrieve a device or device list :S

(my intention is to do a simply object push example in vb and wcl 6, no problem to share  :))

Thanks in advance.
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 06, 2008, 10:52:24 AM
Little update... i make a mistake...

I must write mRadios.Items(0) but the problems persists
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: Mike Petrichenko on May 06, 2008, 11:49:02 AM
WCL is asynchroniouse application

Dim WithEvents mDiscovery As wclBluetoothDiscoveryx

it will raises OnDiscoveryComplete event when discovery done
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 06, 2008, 12:01:33 PM
WCL is asynchroniouse application

Dim WithEvents mDiscovery As wclBluetoothDiscoveryx

it will raises OnDiscoveryComplete event when discovery done
Same problem...
mDiscovery.Discovery <----- Expected function or variable.
mDiscovery.SelectDevice <------- Object doesn't support this property or method.
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 06, 2008, 12:31:29 PM
I will attach this small example using the 6.0.0 version of ActiveX WCL

[attachment deleted by admin]
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 06, 2008, 01:11:14 PM
At least SelectDevice function seems to be buggy or not implemented in wclBluetoothDiscoveryx at this version of the ActiveX WCL and is not recognised as a available function by VB.
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: Mike Petrichenko on May 06, 2008, 01:38:37 PM
Correct, there is no SelectDevice function.

The VB demos will be ready in 2 days. Please, wait for it :)
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 06, 2008, 04:20:08 PM
Correct, there is no SelectDevice function.

The VB demos will be ready in 2 days. Please, wait for it :)
I'll wait :) thanks!

P.D. I ask myself how to retrieve devices without selectdevice.
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: Mike Petrichenko on May 06, 2008, 06:10:48 PM
By using Discovery function
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 07, 2008, 09:10:28 AM
I don't wanna to be annoying but myDiscovery.Discovery(myRadio) says "Error: Expected function or variable." if i change the parameter or the number of parameters it lauch compiling errors so the function is wellknown by the compiler :S

Thanks in advance.
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: Mike Petrichenko on May 07, 2008, 09:45:22 AM
The discovery function does not return any values but you trying to assign its retuend value to variable.
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 07, 2008, 09:52:12 AM
Ok you are right as ever  :-[ i was using an old demo that use discovery(radio, boolAsync) and returns the device, i asume that now ever is async.
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 07, 2008, 10:02:05 AM
I saw that onDiscoveryComplete is changed for DiscoveryComplete :D all works now!
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 07, 2008, 12:35:25 PM
Ummm strange... with BtFrameworkX 6 beta i can discover 12 bluetooths... with WCL.net only 3 :(
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: Mike Petrichenko on May 07, 2008, 12:47:46 PM
http://www.btframework.com/download.htm

Quote
The demo version of Wireless Communication Library has the following limitations:

only 3 devices can be discovered;
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 09, 2008, 08:51:57 AM
http://www.btframework.com/download.htm

Quote
The demo version of Wireless Communication Library has the following limitations:

only 3 devices can be discovered;
Thanks i read it before but how using the previous 6.0 beta release i didn't have that limitation i forget it.
Anyway i hope we could buy the Personal Licence tomorrow, here all boughts are made between days 10-15 of the month (stupid company policy)

Anyway i think I will need help in only one more point... how OPP works now? i mean if .push fuction now takes 0 arguments how I specify the file?

THANKS IN ADVANCE, AND GREAT WORK MIKE!
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: Mike Petrichenko on May 09, 2008, 09:02:12 AM
Put function takes 1 argument - a file name. and it is asynchroniouse command. I.e. after wille putted it call OnComplete event
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 09, 2008, 10:00:34 AM
The first part is not a question is only a help for people that some day could read this topic:


mmm Put function works in a strange way... first of all i must do late initialitations:

Not working:
Dim mObjectPush As wclOPPClientx
Set mObjectPush = New wclOPPClientx


Working
Dim mObjectPush As Object
Set mObjectPush = New wclOPPClientx

Using the second way I manage to avoid this error: "Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic" when i call the put function


Anyway Put seems to need 2 parameters string ObjectName, System.IO.Stream Stream.

Unfortunately i only manage to get "Client not connected" errors... I'll try it. People stay on line :)

Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 09, 2008, 11:33:16 AM
Maybe this could be the fish that bites his own tail...

if i need to declare it as object i can't declare it withevents (asyncronous)

 :-[
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 09, 2008, 12:31:30 PM
My app shows "Client not connected" but the mobile ask about recibe the file  ???
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: sobolev on May 10, 2008, 02:04:46 PM
Hi, everyone. Sorry for my English, I speak rather bad.
I've made a simple vb6demo. It does not work with exceptions, so be carefull.
It will be updated in two days

[attachment deleted by admin]
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 20, 2008, 09:47:46 AM
My app shows "Client not connected" but the mobile ask about recibe the file  ???
Still same problem with the personal licence purchased.  :-\
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: Mike Petrichenko on May 20, 2008, 10:13:02 AM
How do you use it? Can you show the code?
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: sobolev on May 20, 2008, 10:25:20 AM
VBdemo

[attachment deleted by admin]
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 20, 2008, 10:30:21 AM
How do you use it? Can you show the code?
Sure! I tried it in two ways: here we go!


In this first one the error shown is "client not connected" but the phone ask to recive data (anyway you can't recive it)
Code: [Select]
Private Sub btEnviar_Click()

    num = ListReceptores.SelectedItem.Index

    Set mObjectPush = New wclOPPClientx

    mObjectPush.ClientTransport = ctBluetooth
    mObjectPush.BluetoothParams.Radio = mRadio   
    mObjectPush.BluetoothParams.Authentication = False
    mObjectPush.BluetoothParams.Encryption = False   
    mObjectPush.BluetoothParams.Address = mDevices.Items(num - 1).Address

    mObjectPush.Open
   
     If mObjectPush.Active = True Then
        On Error GoTo ErrorHandlerPush
        mObjectPush.Put "C:\\a.jpg", "C:\\a.jpg"
    Else
        listLog.AddItem "No se pudo abrir"
       
    End If
    mObjectPush.Close
ErrorHandlerPush:
    listLog.AddItem Err.Description
   
End Sub


The second one was separating it in two steps , the first one is until .open function , so the phone ask for connection  :) you can reply yes! but when i launch the seccond part (the .put and .close function) nothing seems to happen, if you lauch this second part again the Active propertie is false so it was well close.

I tried too a third way that was make a clientx connection before but no luck again.


Thank you in advance (I didn't purchase BTframework with my nickname, it was purchased with the company name "Carintia")
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 20, 2008, 10:53:08 AM
VBdemo
I ask about OPP wich is not implemented yet, but thank you anyway.
P.D. It only discover 1 Device for me and I allways discover something like 10-15 usually.
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: Mike Petrichenko on May 20, 2008, 05:41:16 PM
here is

[attachment deleted by admin]
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: sobolev on May 21, 2008, 02:18:49 PM
VBDemo :

Works on my machine
Opp works
Proximity sender
vCardParser
BTDiscovery
SerialMonitor
UsbMonitor
Client  ???

Not tested:
IrDaDiscovery
DevInfoClient
IrMC Client

Not done yet:
Athenticator
FTP

[attachment deleted by admin]
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 22, 2008, 11:33:25 AM
:'( :'( :'(

(http://www.carintia.com/clientesinfo/a.gif) 
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 22, 2008, 11:36:10 AM
I'm using Win XP 64 bit and Visual Basic 6 SP6 (also tried in win XP pro SP2)
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: Mike Petrichenko on May 22, 2008, 12:14:14 PM
You must download latest update:

http://private.btframework.com/index.php?topic=4.msg18#msg18
or
http://private.btframework.com/index.php?topic=2.msg17#msg17
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 22, 2008, 12:18:58 PM
You must download latest update:

http://private.btframework.com/index.php?topic=4.msg18#msg18
or
http://private.btframework.com/index.php?topic=2.msg17#msg17
Sorry, I find the error just now... i ask my boss two times that if he has downloaded the LAST version... ej?m ej?m.... XD
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 22, 2008, 12:45:32 PM
Last question (i hope) I don't know why the transmited data reserves double the space that in the HD and of course is corrupted :(
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: viriato on May 22, 2008, 12:57:23 PM
FIXED AND ALL WORKING:  ;D ;D ;D

The fail was in the reading binary part.

SOLUTION:
    Dim B() As Byte
    srcFile = "a.jpg"

    Open srcFile For Binary Access Read As #1
    ReDim B(LOF(1) - 1)
    Get #1, , B
    Close #1
         
  On Error GoTo ErrorHandlerPush
  mObjectPush.Put srcFile, B
 
ErrorHandlerPush:
    listLog.AddItem Err.Description
Title: Re: Some problems with wclBluetoothDiscoveryx (VB6)
Post by: Mike Petrichenko on June 18, 2008, 01:20:40 PM
ProximitySender for VB 6 with WCL.NET

[attachment deleted by admin]