Author Topic: Device Class help  (Read 16221 times)

TheodorosGR

  • Guest
Device Class help
« on: September 05, 2008, 10:32:40 PM »
Hello!
I am trying to understand the Device.ClassOfDevice and the return code but unfortunately with no luck.
For example the above function returns "5898756" for a nokia mobile phone and "5243396" for a sharp mobile!!!! And.....??????
I have downloaded the pack.zip from this forum with the wclCODs.cs wclManufacturers.cs wclUUIDs.cs file but i didnt get it!!
Any help?any line of sample code? I hope you can help me cause i want to add this function to my app.
Thanks in advance!
 

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries

TheodorosGR

  • Guest
Re: Device Class help
« Reply #2 on: September 05, 2008, 11:22:44 PM »
:( i can only find pascal code which i cant translate.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Device Class help
« Reply #3 on: September 06, 2008, 08:39:55 AM »
Here is simple code on C# (typed right here so may have mistakes)
 
swicth ((COD & COD_MAJOR_MASK) >> COD_MAJOR_BIT_OFFSET)
{
    case COD_MAJOR_MISCELLANEOUS: return "Unknown Device";
 
    case COD_MAJOR_COMPUTER: swicth ((COD & COD_MINOR_MASK) >> COD_MINOR_BIT_OFFSET)
                        {
                          case COD_COMPUTER_MINOR_DESKTOP: return "Desktop computer";
                          case COD_COMPUTER_MINOR_SERVER: return "Service computer";
                          case COD_COMPUTER_MINOR_LAPTOP: return "Laptop computer";
                          case COD_COMPUTER_MINOR_HANDHELD: return "Handheld computer";
                          case COD_COMPUTER_MINOR_PALM: return "Palm computer";
 
                        default:
                          return "Computer";
                        }
 
    case COD_MAJOR_PHONE: switch ((COD & COD_MINOR_MASK) >> COD_MINOR_BIT_OFFSET)
                     {
                       case COD_PHONE_MINOR_CELLULAR: return "Mobile phone";
                       case COD_PHONE_MINOR_CORDLESS: return "Cordless phone";
                       case COD_PHONE_MINOR_SMART: return "Smartphone";
                       case COD_PHONE_MINOR_WIRED_MODEM: return "Modem";
                       case COD_PHONE_MINOR_COMMON_ISDN_ACCESS: return "ISDN Modem";
 
                     default:
                       return "Phone device";
                     }
}

 

Sitemap 1 2 3 4 5 6 7