• Skip to main content
  • Select language
  • Skip to search
mozilla
Mozilla Developer Network
  • Sign in
    • Persona
    • GitHub
  • Web Platform
    Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • APIs / DOM
    • Apps
    • MathML
    References & Guides
    • Learn the Web
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • ...more docs
  • Mozilla Docs
    • Add-ons
    • Firefox
    • Firefox Marketplace
    • Firefox OS
    • Persona
  • Developer Tools
  • Feedback
    • Get Firefox help
    • Get web development help
    • Join the MDN community
    • Report a content problem
    • Report a bug
  •  
B2G OS
    • No translations exist for this article.
    • Add a translation
  • Edit
  • Advanced
    • History
    • Print this article
  1. MDN
  2. Mozilla
  3. B2G OS
  4. Firefox OS APIs
  5. BluetoothClassOfDevice (Firefox OS)
Your Search Results

    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

    Share:
    • Twitter
    • Facebook
    • Google+

    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, Feb 11, 2016, 2:26:20 AM
    See also
    1. Web Bluetooth API
    2. BluetoothClassOfDevice
    3. Related pages for Bluetooth API (Firefox OS)
      1. BluetoothAdapter
      2. BluetoothAdapterEvent
      3. BluetoothAttributeEvent
      4. BluetoothDevice
      5. BluetoothDeviceEvent
      6. BluetoothDiscoveryHandle
      7. BluetoothGatt
      8. BluetoothGattCharacteristic
      9. BluetoothGattCharacteristicEvent
      10. BluetoothGattDescriptor
      11. BluetoothGattServer
      12. BluetoothGattService
      13. BluetoothLeDeviceEvent
      14. BluetoothManager
      15. BluetoothPairingEvent
      16. BluetoothPairingHandle
      17. BluetoothPairingListener
      18. BluetoothStatusChangedEvent

    © 2005-2016 Mozilla Developer Network and individual contributors.

    Content is available under these licenses.

    • About MDN
    • Terms
    • Privacy
    • Cookies
    • Contribute to the code

    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy
    BESbswy