.NET Components for Mobility

Bug getting Class of Device on discovered Devices?

Last post 04-14-2008 11:03 AM by alanjmcf. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 03-19-2008 5:38 AM

    Bug getting Class of Device on discovered Devices?

     I think the CoD field isnt set on discovered devices

    BluetoothRadio.PrimaryRadio.ClassOfDevice works fine resulting in a hex value like A01234 (6 hex values)

    but the CoD on discovered devices isn't set

     

    BluetoothClient cl=new  BluetoothClient();

    BluetoothDeviceInfo[ devices=cl.DiscoverDevices();

    foreach(BluetoothDeviceInfo device in devices)

    {

        //device.ClassOfDevice always returns "0" and not a hex value length 6 

    perhaps you forgotten to set the class of Device field? 

     

     

    Filed under:
  • 03-19-2008 7:20 AM In reply to

    Re: Bug getting Class of Device on discovered Devices?

    Is this on Win32 or on WinCE/WM?  On WinCE the native support is only present on later versions, according to our class docs on that member:

    Some CE 4.2 devices such as original PPC2003 devices don't have this API — it was added as part of a hotfix. The property will always return zero in such a case.

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
  • 03-19-2008 7:48 AM In reply to

    Re: Bug getting Class of Device on discovered Devices?

     Currently I'm using the CE2 Version v2.0.50727 on a Windows Mobile 6 Professional Device

    There can I find more infos about that?? link? 

  • 03-19-2008 7:53 AM In reply to

    Re: Bug getting Class of Device on discovered Devices?

     I build the Project for an PPC2003 ... hmm perhaps I have to choose another project like Smartphone 2003 or Windows CE 5.0??

  • 03-20-2008 9:24 AM In reply to

    Re: Bug getting Class of Device on discovered Devices?

    Its a run-time issue.  The library is the same for all device and will call the native method, but will handle the situation where the native method simply doesn't exist.  You'd need a later version of the OS on the device for the call to work.  (You can see this in the library sources if you download them from http://www.codeplex.com/32feet)

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
  • 04-02-2008 2:30 PM In reply to

    Re: Bug getting Class of Device on discovered Devices?

    Hello,

    I stumbled upon the same problem, no success with an HTC P3300 (WM5) nor HTC P3650 (WM6)
    Should it normally work under WM5/WM6, or is the used function native function BthGetRemoteCOD (http://msdn2.microsoft.com/en-us/library/aa916233.aspx) in the CF1/CF2 Libraries sources only supported with Windows CE, but not with Windows Mobile? Or is it vendor/device dependent?

    Is maybe someone aware of a different way to get the COD, as e.g. btCrawler (http://www.silentservices.de/btCrawler.html)  is able to show it on both devices?

     

     

  • 04-02-2008 6:07 PM In reply to

    Re: Bug getting Class of Device on discovered Devices?

    You could check what error is being reported when the library calls it.  Download the sources from http://www.codeplex.com/32feet and see what happens when you step into the method.  Does it throw an exception, is it MissingMemberException etc?

    I'll check whether Peter know more about which devices can support the underlying API.

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
  • 04-03-2008 9:10 AM In reply to

    Re: Bug getting Class of Device on discovered Devices?

    The API was introduced around CE.NET 4.2. It is definitely present on all Windows Mobile 5.0 and later devices. I've done some testing and it appears there is an error in the library which I'm working on fixing. I'll post to the forums once the online source code has been updated.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 04-03-2008 12:51 PM In reply to

    Re: Bug getting Class of Device on discovered Devices?

    Hello,

    the result code of  the line
    int result = NativeMethods.BthGetRemoteCOD(ref deviceInfo.Address, ref deviceInfo.ulClassofDevice)
    in BluetoothDeviceInfo.cs is 0x490 (which shold be ERROR_NOT_FOUND). No Exception thrown however, and no value changed (also when trying with a local uint variable). Same behavior on both devices.

    Thanks for the quick reply!

  • 04-04-2008 9:57 AM In reply to

    Re: Bug getting Class of Device on discovered Devices?

    Just a quick reply for now.  Peter's found that it seems that there must be a connection (baseband connection) to the device for the API to work.  We'll look at changing the library somehow to make that work 'behind the scenes'...  For now, you should just force a connection somehow and then the API should work...  Hope that works for you.

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
  • 04-07-2008 11:45 AM In reply to

    Re: Bug getting Class of Device on discovered Devices?

    Hello,

    found that the latest sources contain a fix, and its working nicely so far, even for RSSI readings! Great!
    Thanks a lot for the support!

  • 04-11-2008 6:57 AM In reply to

    Re: Bug getting Class of Device on discovered Devices?

    Hi, 

    My phone is HP 514 voice messenger whith WM6.

    I use 32feet 2.2.0.0

    I can't see the ClassOfDevice, return always 0.

    I also tried with an HTC Touch Dual and i got the same problem.

    What should i do? 

    Thanks 

  • 04-11-2008 10:00 AM In reply to

    Re: Bug getting Class of Device on discovered Devices?

    Hello,

    you need to check out the latest source code from codeplex, and compile the library yourself.
    Using this version it should work nicely, even RSSI is usable.

  • 04-14-2008 11:03 AM In reply to

    Re: Bug getting Class of Device on discovered Devices?

    I'm pleased to hear that it works well for you. :-)

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
Page 1 of 1 (14 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.