• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. B2G OS APIs
  5. BluetoothClassOfDevice (Firefox OS)

BluetoothClassOfDevice (Firefox OS)

In This Article
  1. Interface overview
  2. Properties
  3. Specifications
  4. Browser Compatibility
  5. See also

This API is available on Firefox OS for internal applications only.

The BluetoothClassOfDevice interface of the Web Bluetooth API provides identifying/classification information about a given remote Bluetooth device, available at discovery stage.

Interface overview

[CheckPermissions="bluetooth"]
interface BluetoothClassOfDevice
{
  /**
   * The following constants are defined in Assigned Numbers of bluetooth General Access Profile (GAP) spec.
   * See https://www.bluetooth.org/en-us/specification/assigned-numbers/baseband for more information.
   */
  // Major service class
  const unsigned short LIMITED_DISCOVERABILITY = 0x0001;
  const unsigned short POSITIONING             = 0x0008;
  const unsigned short NETWORKING              = 0x0010;
  const unsigned short RENDERING               = 0x0020;
  const unsigned short CAPTURING               = 0x0040;
  const unsigned short OBJECT_TRANSFER         = 0x0080;
  const unsigned short AUDIO                   = 0x0100;
  const unsigned short TELEPHONY               = 0x0200;
  const unsigned short INFORMATION             = 0x0400;
  // Major device class
  const octet MISC          = 0x00;
  const octet COMPUTER      = 0x01;
  const octet PHONE         = 0x02;
  const octet NETWORK       = 0x03;
  const octet AUDIO_VIDEO   = 0x04;
  const octet PERIPHERAL    = 0x05;
  const octet IMAGING       = 0x06;
  const octet WEARABLE      = 0x07;
  const octet TOY           = 0x08;
  const octet HEALTH        = 0x09;
  const octet UNCATEGORIZED = 0x1F;
  readonly attribute unsigned short majorServiceClass;
  readonly attribute octet majorDeviceClass;
  readonly attribute octet minorDeviceClass;
};

Properties

BluetoothClassOfDevice.majorDeviceClass Read only
Represents the Major Device Class of the CoD field of a Bluetooth Device; "the highest level of granularity for defining a Bluetooth device". [1]
BluetoothClassOfDevice.minorDeviceClass Read only
Represents the Minor Device Class of the CoD field of a Bluetooth Device; "interpreted only in the context of the Major Device Class (but independently of the Service Class field)". [1]
BluetoothClassOfDevice.majorServiceClass Read only
Represents the Major Service Class of the CoD field of a Bluetooth Device; "the general families of devices with which Bluetooth SIG members want their applications to be associated". [1]

[1] https://www.bluetooth.org/en-us/specification/assigned-numbers/baseband

Specifications

Specification Status Comment
Web Bluetooth
The definition of 'BluetoothClassOfDevice' in that specification.
Draft Rough draft; not part of any official specification yet. It should be discussed as part of the W3C's System Applications Working Group.

Browser Compatibility

  • Desktop
  • Mobile
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support No support No support No support No support No support
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support No support No support No support 2.1 No support No support No support No support

 

See also

Using the Web Bluetooth API

Document Tags and Contributors

Tags: 
  • API
  • B2G
  • Bluetooth
  • BluetoothClassOfDevice
  • Certified
  • Firefox OS
  • Interface
  • Non-standard
  • Reference
  • Web Bluetooth
 Contributors to this page: chrisdavidmills
 Last updated by: chrisdavidmills, May 4, 2016, 1:03:52 AM
See also
  1. Web Bluetooth API
  2. Archive
  3. Related pages for Bluetooth API (Firefox OS)
    1. BluetoothAdapter
    2. BluetoothAdapterEvent
    3. BluetoothAttributeEvent
    4. BluetoothClassOfDevice
    5. BluetoothDevice
    6. BluetoothDeviceEvent
    7. BluetoothDiscoveryHandle
    8. BluetoothGatt
    9. BluetoothGattCharacteristic
    10. BluetoothGattCharacteristicEvent
    11. BluetoothGattDescriptor
    12. BluetoothGattServer
    13. BluetoothGattService
    14. BluetoothLeDeviceEvent
    15. BluetoothManager
    16. BluetoothPairingEvent
    17. BluetoothPairingHandle
    18. BluetoothPairingListener