Author Topic: Device Discovery  (Read 20313 times)

TcomGregg

  • Guest
Device Discovery
« on: November 23, 2008, 08:32:25 PM »
I would like to discover a single Bluetooth device (it will be in a RF shield box) and check it against a database of Bluetooth devices.
Does anyone have a visual basic routine which can do this?  ???
Thank You

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Device Discovery
« Reply #1 on: November 23, 2008, 09:27:52 PM »
There is no way to discover SINGLE BT device. Following by BT specification (BT Core 1.X, 2.X) the discover (inquery) procedure returns all availbale devices (which has Visible flag set). If you need to know is device available use InRange function.

TcomGregg

  • Guest
Re: Device Discovery
« Reply #2 on: November 23, 2008, 09:35:34 PM »
Thank You Micheal,
As you can tell I am new to bluetooth -
does the DeviceInRange function
  • Require the device to be discovered first?
  • Is it the same thing as Attaching and Detaching from a device?
Thank You Once Again.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Device Discovery
« Reply #3 on: November 23, 2008, 09:57:12 PM »
No, it does not requre that device is in Discoverable mode. And yes, it does something like attaching and detaching to/from device.

Added: it does not require that device is discovered before if you know the device's address. If you don't know the devices address then, of course, you need to discover the devices t know which one you need to check then. If (and when) you know the device's address you may create wclBluetoothDevice object (it shows in the sample I uploaded yesterday as an answer to one of your question), the assign address to the created object and call its InRange function.

Additional information for WCL 6.2: WCL 6.2 does not have that function but it can be simulated by calling EnumServices function (as I described here on forum already).
« Last Edit: November 23, 2008, 10:00:25 PM by Mike Petrichenko »

TcomGregg

  • Guest
Re: Device Discovery
« Reply #4 on: November 23, 2008, 10:27:44 PM »
The Enum function takes more time I assume because it is looking for all devices in range of the adapter?
Are you going to include the InRange function in future releases?
Thank You

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Device Discovery
« Reply #5 on: November 23, 2008, 10:46:09 PM »
The EnumServices function does not take longer than InRange because may not look for all services. It is first. The second why it does not take longer is because this function is used internally in InRange function.

TcomGregg

  • Guest
Re: Device Discovery
« Reply #6 on: November 23, 2008, 11:40:54 PM »
I am using two cellphones a Motorola and a Samsung to test the software.
In your demo program - If the Samsung is not Paired - the Services Enum function gives a COMExecption was unhandedled error and blows out to the debugger?
The Motorola does not have to be Paiired to report back the ENUM Services to the demo program?
Have you seen this before?
Thank You

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Device Discovery
« Reply #7 on: November 24, 2008, 12:58:56 AM »
It just means that samsung requires to be paied before enumerate its services. No work around.

 

Sitemap 1 2 3 4 5 6 7