diff --git a/index.html b/index.html index f955133..94c0045 100644 --- a/index.html +++ b/index.html @@ -96,6 +96,9 @@ }, }; +
- The UA MUST maintain a Bluetooth cache
- of the hierarchy of Services, Characteristics, and Descriptors
- it has discovered on a device.
- The UA MAY share this cache between multiple origins accessing the same device.
- Each potential entity in the cache is either known-present, known-absent, or unknown.
- The cache MUST NOT contain two entities that are for the same attribute.
- Each known-present entity in the cache is associated with an optional
- Promise<BluetoothGATTService>
,
- Promise<BluetoothGATTCharacteristic>
,
- or Promise<BluetoothGATTDescriptor>
instance
- for each script execution environment.
-
- For example, if a user calls the serviceA.getCharacteristic(uuid1)
function
- with an initially empty Bluetooth cache,
- the UA uses the Discover Characteristics by UUID procedure
- to fill the needed cache entries,
- and the UA ends the procedure early because
- it only needs one Characteristic to fulfil the returned Promise,
- then the first Characteristic with UUID uuid1
inside serviceA
- is known-present,
- and any subsequent Characteristics with that UUID remain unknown.
- If the user later calls serviceA.getCharacteristics(uuid1)
,
- the UA needs to resume or restart the Discover Characteristics by UUID procedure.
- If it turns out that
- serviceA
only has one Characteristic with UUID uuid1
,
- then the subsequent Characteristics become known-absent.
-
+ The UA MUST maintain a Bluetooth cache
+ of the hierarchy of Services, Characteristics, and Descriptors
+ it has discovered on a device.
+ The UA MAY share this cache between multiple origins accessing the same device.
+ Each potential entity in the cache is either known-present, known-absent, or unknown.
+ The cache MUST NOT contain two entities that are for the same attribute.
+ Each known-present entity in the cache is associated with an optional
+ Promise<BluetoothGATTService>
,
+ Promise<BluetoothGATTCharacteristic>
,
+ or Promise<BluetoothGATTDescriptor>
instance
+ for each script execution environment.
+
- The known-present entries in the Bluetooth cache are ordered: - Primary Services appear in a particular order within a device, - Included Services and Characteristics appear in a particular order within Services, - and Descriptors appear in a particular order within Characteristics. - The order SHOULD match the order of Attribute Handles on the device, - but UAs MAY use another order if the device's order isn't available. -
+
+ For example, if a user calls the serviceA.getCharacteristic(uuid1)
function
+ with an initially empty Bluetooth cache,
+ the UA uses the Discover Characteristics by UUID procedure
+ to fill the needed cache entries,
+ and the UA ends the procedure early because
+ it only needs one Characteristic to fulfil the returned Promise,
+ then the first Characteristic with UUID uuid1
inside serviceA
+ is known-present,
+ and any subsequent Characteristics with that UUID remain unknown.
+ If the user later calls serviceA.getCharacteristics(uuid1)
,
+ the UA needs to resume or restart the Discover Characteristics by UUID procedure.
+ If it turns out that
+ serviceA
only has one Characteristic with UUID uuid1
,
+ then the subsequent Characteristics become known-absent.
+
- To populate the Bluetooth cache with entries matching some description, - the UA MUST run the following steps. - Note that these steps can block, - so uses of this algorithm must be in parallel. -
-+ The known-present entries in the Bluetooth cache are ordered: + Primary Services appear in a particular order within a device, + Included Services and Characteristics appear in a particular order within Services, + and Descriptors appear in a particular order within Characteristics. + The order SHOULD match the order of Attribute Handles on the device, + but UAs MAY use another order if the device's order isn't available. +
-- To query the Bluetooth cache for entries matching some description, - the UA MUST return a new promise promise - and run the following steps in parallel: -
-BluetoothGATT*
instance
- for the current script execution environment,
- create a BluetoothGATTService
- representing entry,
- create a BluetoothGATTCharacteristic
- representing entry,
- or create a BluetoothGATTDescriptor
- representing entry,
- depending on whether entry is a Service, Characteristic, or Descriptor,
- and associate the resulting Promise
with entry.
- Promise<BluetoothGATT*>
instance
- associated with entry
- for the current script execution environment.
- + To populate the Bluetooth cache with entries matching some description, + the UA MUST run the following steps. + Note that these steps can block, + so uses of this algorithm must be in parallel. +
++ To query the Bluetooth cache for entries matching some description, + the UA MUST return a new promise promise + and run the following steps in parallel: +
+BluetoothGATT*
instance
+ for the current script execution environment,
+ create a BluetoothGATTService
+ representing entry,
+ create a BluetoothGATTCharacteristic
+ representing entry,
+ or create a BluetoothGATTDescriptor
+ representing entry,
+ depending on whether entry is a Service, Characteristic, or Descriptor,
+ and associate the resulting Promise
with entry.
+ Promise<BluetoothGATT*>
instance
+ associated with entry
+ for the current script execution environment.
+
+ To GetGATTChildren(attribute: GATT Attribute,
+ single: boolean,
+ uuidCanonicalizer: function,
+ uuid: optional (DOMString or unsigned int)
,
+ child type: GATT declaration type),
+ the UA MUST perform the following steps:
+
The getPrimaryService(service)
method, when invoked,
- MUST perform the following steps:
+ MUST return
BluetoothUUID.getService(service)
.
- If BluetoothUUID.getService threw an exception,
- return a promise rejected with that exception and abort these steps.
- this@[[\representedDevice]]
- whose UUID is service
- and whose UUID is in this@[[\allowedServices]]
,
- and let promise be the result.
- + GetGATTChildren(attribute=this@[[\representedDevice]]
,
+ single=true,
+ uuidCanonicalizer=BluetoothUUID.getService
,
+ uuid=service
,
+ child type="GATT Primary Service") +
The getPrimaryServices(service)
method, when invoked,
- MUST perform the following steps:
+ MUST return
BluetoothUUID.getService(service)
.
- If BluetoothUUID.getService threw an exception,
- return a promise rejected with that exception and abort these steps.
- this@[[\representedDevice]]
- whose UUIDs are in this@[[\allowedServices]]
- and, if service is present, whose UUIDs are equal to service,
- and let promise be the result.
- + GetGATTChildren(attribute=this@[[\representedDevice]]
,
+ single=false,
+ uuidCanonicalizer=BluetoothUUID.getService
,
+ uuid=service
,
+ child type="GATT Primary Service") +
The getCharacteristic(characteristic)
method
retrieves a Characteristic inside this Service.
- When invoked, it MUST perform the following steps:
+ When invoked, it MUST return
BluetoothUUID.getCharacteristic(characteristic)
.
- If BluetoothUUID.getCharacteristic threw an exception,
- return a promise rejected with that exception and abort these steps.
- + GetGATTChildren(attribute=this
,
+ single=true,
+ uuidCanonicalizer=BluetoothUUID.getCharacteristic
,
+ uuid=characteristic
,
+ child type="GATT Characteristic") +
The getCharacteristics(characteristic)
method
retrieves a list of Characteristics inside this Service.
- When invoked, it MUST perform the following steps:
+ When invoked, it MUST return
BluetoothUUID.getCharacteristic(characteristic)
.
- If BluetoothUUID.getCharacteristic threw an exception,
- return a promise rejected with that exception and abort these steps.
- + GetGATTChildren(attribute=this
,
+ single=false,
+ uuidCanonicalizer=BluetoothUUID.getCharacteristic
,
+ uuid=characteristic
,
+ child type="GATT Characteristic") +
The getIncludedService(service)
method
retrieves an Included Service inside this Service.
- When invoked, it MUST perform the following steps:
+ When invoked, it MUST return
BluetoothUUID.getService(service)
.
- If BluetoothUUID.getService threw an exception,
- return a promise rejected with that exception and abort these steps.
- + GetGATTChildren(attribute=this
,
+ single=true,
+ uuidCanonicalizer=BluetoothUUID.getService
,
+ uuid=service
,
+ child type="GATT Included Service") +
The getIncludedServices(service)
method
retrieves a list of Included Services inside this Service.
- When invoked, it MUST perform the following steps:
+ When invoked, it MUST return
BluetoothUUID.getService(service)
.
- If BluetoothUUID.getService threw an exception,
- return a promise rejected with that exception and abort these steps.
- + GetGATTChildren(attribute=this
,
+ single=false,
+ uuidCanonicalizer=BluetoothUUID.getService
,
+ uuid=service
,
+ child type="GATT Included Service") +
The getDescriptor(descriptor)
method
retrieves a Descriptor inside this Characteristic.
- When invoked, it MUST perform the following steps:
+ When invoked, it MUST return
BluetoothUUID.getDescriptor(descriptor)
.
- If BluetoothUUID.getDescriptor threw an exception,
- return a promise rejected with that exception and abort these steps.
- + GetGATTChildren(attribute=this
,
+ single=true,
+ uuidCanonicalizer=BluetoothUUID.getDescriptor
,
+ uuid=descriptor
,
+ child type="GATT Descriptor") +
The getDescriptors(descriptor)
method
retrieves a list of Descriptors inside this Characteristic.
- When invoked, it MUST perform the following steps:
+ When invoked, it MUST return
BluetoothUUID.getDescriptor(descriptor)
.
- If BluetoothUUID.getDescriptor threw an exception,
- return a promise rejected with that exception and abort these steps.
- + GetGATTChildren(attribute=this
,
+ single=false,
+ uuidCanonicalizer=BluetoothUUID.getDescriptor
,
+ uuid=descriptor
,
+ child type="GATT Descriptor") +
The readValue()
method, when invoked,