BluetoothRemoteGATTServer: getPrimaryService() method
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("Bluetooth API")}}{{SeeCompatTable}}{{SecureContext_Header}}
The **BluetoothRemoteGATTServer.getPrimaryService()** method returns a promise to the primary {{domxref("BluetoothRemoteGATTService")}} offered by the Bluetooth device for a specified bluetooth service UUID.
Syntax
js-nolint
getPrimaryService(bluetoothServiceUUID)Parameters
bluetoothServiceUUID- : A Bluetooth service universally unique identifier for a specified device, that is either a 128-bit UUID, a 16-bit or 32-bit UUID alias, or a string from the list of GATT assigned services keys.
Return value
A {{jsxref("Promise")}} that resolves to a {{domxref("BluetoothRemoteGATTService")}} object.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}