1 /* 2 * Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com 3 * 4 * All rights reserved. Distributed under the terms of the MIT License. 5 * 6 */ 7 8 #ifndef _DEVICE_CLASS_H 9 #define _DEVICE_CLASS_H 10 11 #include <String.h> 12 13 namespace Bluetooth { 14 15 class DeviceClass { 16 17 public: 18 19 DeviceClass(int record) 20 { 21 this->record = record; 22 } 23 24 25 int GetServiceClasses() 26 { 27 return (record & 0x00FFE000) >> 13; 28 } 29 30 31 int GetMajorDeviceClass() 32 { 33 return (record & 0x00001F00) >> 8; 34 } 35 36 37 void GetMajorDeviceClass(BString* str) 38 { 39 40 } 41 42 43 int GetMinorDeviceClass() 44 { 45 return (record & 0x000000FF) >> 2; 46 } 47 48 49 void GetMinorDeviceClass(BString* str) 50 { 51 52 } 53 54 private: 55 int record; 56 }; 57 58 } 59 60 #ifndef _BT_USE_EXPLICIT_NAMESPACE 61 using Bluetooth::DeviceClass; 62 #endif 63 64 #endif 65