Wireless Communication Library Support Forum

Frameworks => Bluetooth Framework => Topic started by: TheodorosGR on September 05, 2008, 10:32:40 PM

Title: Device Class help
Post by: TheodorosGR 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!
 
Title: Re: Device Class help
Post by: Mike Petrichenko on September 05, 2008, 11:04:03 PM
http://forum.btframework.com/index.php?topic=171.0
http://forum.btframework.com/index.php?topic=537.0
Title: Re: Device Class help
Post by: TheodorosGR on September 05, 2008, 11:22:44 PM
:( i can only find pascal code which i cant translate.
Title: Re: Device Class help
Post by: Mike Petrichenko 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";
                     }
}