• 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. BluetoothDevice (Firefox OS)
Your Search Results

    BluetoothDevice (Firefox OS)

    In This Article
    1. Interface overview
    2. Properties
      1. Event handlers
      2. Obsolete properties
    3. Methods
    4. Specifications
    5. Browser Compatibility
    6. See also

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

    The BluetoothDevice interface of the Web Bluetooth API provides information regarding a given Bluetooth device.

    Interface overviewEdit

    [CheckPermissions="bluetooth"]
    interface BluetoothDevice: EventTarget
    {
      readonly attribute DOMString address;
      readonly attribute BluetoothClassOfDevice cod;
      readonly attribute DOMString name;
      readonly attribute boolean paired;
      [Cached, Pure] readonly attribute sequence<DOMString> uuids;
      readonly attribute BluetoothDeviceType type;
      readonly attribute BluetoothGatt? gatt;
    
               attribute EventHandler onattributechanged;
    
      [NewObject] Promise<sequence<DOMString>> fetchUuids();
    };

    PropertiesEdit

    BluetoothDevice.address Read only
    A string representing the address of the device on the Bluetooth micro-network.
    BluetoothDevice.cod Read only
    Returns a BluetoothClassOfDevice object containing information about the device's capabilities.
    BluetoothDevice.gatt Read only
    Returns a BluetoothGatt object that allows JavaScript to conduct GATT client operations on a remote LE device. This property will return null for devices of type classic or unknown.
    BluetoothDevice.name Read only
    The human readable name of the device.
    BluetoothDevice.paired Read only
    A boolean indicating if the device is paired to the adapter (true) or not (false).
    BluetoothDevice.services Read only
    An Array of strings indicating what kind of Bluetooth services the device is able to provide.
    BluetoothDevice.type Read only
    Returns the device type of the remote device.
    BluetoothDevice.uuids Read only
    An Array of strings indicating the UUIDs of each Bluetooth service the device is able to provide.

    Event handlers

    BluetoothDevice.onattributechanged
    Defines a handler for the attributechanged event; triggers when a remote device's properties have changed (has a BluetoothAttributeEvent as a parameter.)

    Obsolete properties

    BluetoothDevice.class Read only
    A number representing the Bluetooth "Class of Device" number for the device.
    BluetoothDevice.connected Read only
    A boolean indicating if the device is connected to the adapter (true) or not (false).
    BluetoothDevice.icon Read only
    A string indicating which kind of icon could be used to represent the device.

    MethodsEdit

    BluetoothDevice.fetchUuids()
    Fetches the up-to-date UUID list of services that the device provides. If the operation succeeds, an BluetoothDevice_%28Firefox_OS%29.onattributechanged is triggered right before the Promise is resolved to indicate BluetoothDevice.uuids has changed.

    SpecificationsEdit

    Specification Status Comment
    Web Bluetooth
    The definition of 'BluetoothDevice' 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 CompatibilityEdit

    • 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
    Bluetooth v2 support: cod, type, gatt, onattributechanged, fetchUuids() No support No support No support 2.1 No support No support No support No support
    Initial bluetooth support: address, connected, class, icon, name, paired, uuids No support No support No support 1.0.1 No support No support No support No support

     

    See alsoEdit

    Using the Web Bluetooth API

    Share:
    • Twitter
    • Facebook
    • Google+

    Document Tags and Contributors

    Tags: 
    • API
    • BluetoothDevice
    • Certified
    • Firefox OS
    • Interface
    • Non-standard
    • Reference
    • Référence
    • Web Bluetooth
     Contributors to this page: chrisdavidmills, fscholz, Jamin_Liu, sabrish, kscarfone, Jeremie
     Last updated by: chrisdavidmills, Feb 11, 2016, 2:26:14 AM
    See also
    1. Web Bluetooth API
    2. BluetoothDevice
    3. Properties
      1. address
      2. class
      3. connected
      4. icon
      5. name
      6. paired
      7. services
      8. uuids
    4. Inheritance:
      1. EventTarget
    5. Related pages for Bluetooth API (Firefox OS)
      1. BluetoothAdapter
      2. BluetoothAdapterEvent
      3. BluetoothAttributeEvent
      4. BluetoothClassOfDevice
      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