HTMLBluetoothElement.close()

BFChainAugust 11, 2023
  • WebComponent
  • HTMLBluetoothElement
  • close
Less than 1 minute

Closes the bluetooth device; internally calls the BluetoothPlugin.close() method

HTMLBluetoothElement.close()

Parameters

  • None

Return Value

Returns a Promise that resolves to a BluetoothCloseResponse object

Example

<body>

  <dweb-bluetooth></dweb-bluetooth>

  <button>close</button>

  <script type="module">

    import "@plaoc/plugins"
    
    const bluetooth = document.querySelector("dweb-bluetooth")!
    
    const btn = document.querySelector('button');
    
    btn.addEventListener('click', async () => {
    
      const res = await bluetooth.close();
      
    })
    
  </script>

</body>

Platform Compatibility

Properties/Methods/EventsAndroidiOSDesktop-DevDesktop
closeX

HTMLBluetoothElement

Comments
  • Latest
  • Oldest
  • Hottest
Powered by Waline v2.13.0