Author Topic: Get device information  (Read 12647 times)

fabio.santini

  • Guest
Get device information
« on: August 27, 2009, 10:06:58 AM »
Hi all again, I'm creating new thread for new questions.
I need, in a range of MAC addresses I find, to filter devides. My need is only to send files and I would like to excluse who can't accept files incoming.

    Private Sub wclProximitySender_OnAcceptDevice(ByVal sender As System.Object, ByVal e As wcl.wclAcceptDeviceEventArgs) Handles wclProximitySender.OnAcceptDevice
       
        Dim Radio As wcl.wclBluetoothRadio = New wcl.wclBluetoothRadio()
        Dim Services As wcl.wclBluetoothServices = New wcl.wclBluetoothServices()
        Radio.API = wcl.wclBluetoothAPI.baMicrosoft        'assume using of MS driver

        Dim a As Integer = e.Device.EnumServices(Radio, Services, Guid.Empty)
       
        If a = 0 Then
            e.Accept = True
        Else
            e.Accept = False
        End If

    End Sub

Here, I'm guessing 0 is EnumServices for accept incoming files. I tried with a bluetooth headset and I got 2. Now, is it correct my code? Is it correct 0 as "file receiving allowed" and not allowed for any other? Or is there a list with all possibile result? (I didn't find anything about that)*. I spend 6 minutes trying to send files to devices who can't receive (14dbi antenna on dongle Sena) and I need to decrease time wasting, considering the fact I still have other problem at the end of OnSendComplete randomly.

* I found another document with error codes received on sending, and I find it out some important things. I also see HTC Diamond, not listed in your device, always accept file sending without asking user but it returns 130 as error code, even file is sent and readable.

Sorry if I'm asking so many things, but we need to use a component like this and I'm evaluating as best as I need before purchase it. And sorry again for my english.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Get device information
« Reply #1 on: August 27, 2009, 10:40:53 AM »
Here is the code:

Dim a As Integer = e.Device.EnumServices(Radio, Services, wcl.wclUUIDs.OBEXObjectPushServiceClass_UUID)

e.Accept = ((a = wcl.wclErrors.WCL_E_SUCCESS) And (Services.Count > 0))

 

Sitemap 1 2 3 4 5 6 7