Skip to content

Commit

Permalink
Rename bluetooth.requestDevicePromptOpened to bluetooth.requestDevice…
Browse files Browse the repository at this point in the history
…PromptUpdated
  • Loading branch information
OrKoN committed Apr 10, 2024
1 parent d84e7d6 commit 11c7753
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ steps:
<var>uuidExclusionFilters</var>.
1. Let |browsingContext| be [=this=]'s [=relevant global object=]'s [=browsing context=].
1. Let |promptId| be a new unique opaque string.
1. [=Trigger a prompt open event=] given |browsingContext|, |promptId|, and |scanResult|.
1. [=Trigger a prompt updated event=] given |browsingContext|, |promptId|, and |scanResult|.
1. <p id="requestDevice-prompt">Even if <var>scanResult</var> is empty,
<a>prompt the user to choose</a> one of the devices in |scanResult|,
associated with |descriptor|, and let |device| be the result.
Expand Down Expand Up @@ -5006,32 +5006,32 @@ A [=local end=] could dismiss a prompt by sending the following message:

### Events ### {#bidi-events}

#### The bluetooth.requestDevicePromptOpened Event #### {#bluetooth-requestdevicepromptopened-event}
#### The bluetooth.requestDevicePromptUpdated Event #### {#bluetooth-requestdevicepromptupdated-event}

<pre highlight="cddl" class="cddl local-cddl">
bluetooth.RequestDevicePromptOpened = (
method: "bluetooth.requestDevicePromptOpened",
params: bluetooth.RequestDevicePromptOpenedParameters
bluetooth.RequestDevicePromptUpdated = (
method: "bluetooth.requestDevicePromptUpdated",
params: bluetooth.RequestDevicePromptUpdatedParameters
)

bluetooth.RequestDevicePromptOpenedParameters = {
bluetooth.RequestDevicePromptUpdatedParameters = {
context: text,
prompt: bluetooth.RequestDevicePrompt,
devices: [* bluetooth.RequestDeviceInfo],
}
</pre>

<div algorithm="remote end event trigger for bluetooth.requestDevicePromptOpened">
To <dfn>trigger a prompt open event</dfn> given a [=browsing context=] |context|, a string |promptId|, and a [=/set=] of [=Bluetooth devices=] |devices|:
<div algorithm="remote end event trigger for bluetooth.requestDevicePromptUpdated">
To <dfn>trigger a prompt updated event</dfn> given a [=browsing context=] |context|, a string |promptId|, and a [=/set=] of [=Bluetooth devices=] |devices|:

1. Let |context id| be |context|'s [=browsing context id=].
1. Let |prompt| be the [=device prompt=] (|promptId|, |devices|).
1. Let |serialized devices| be the result of [=serialize prompt devices=] with |prompt|.
1. Set [=map of browsing contexts to device prompts=][|context id|] to |prompt|.
1. Let |params| be a [=map=] matching the <code>bluetooth.RequestDevicePromptOpenedParameters</code> production with the <code>context</code> field set to |context id|, the <code>prompt</code> field set to |promptId|, and the <code>devices</code> field set to |serialized devices|.
1. Let |body| be a [=map=] matching the <code>bluetooth.RequestDevicePromptOpened</code> production, with the <code>params</code> field set to |params|.
1. Let |params| be a [=map=] matching the <code>bluetooth.RequestDevicePromptUpdatedParameters</code> production with the <code>context</code> field set to |context id|, the <code>prompt</code> field set to |promptId|, and the <code>devices</code> field set to |serialized devices|.
1. Let |body| be a [=map=] matching the <code>bluetooth.RequestDevicePromptUpdated</code> production, with the <code>params</code> field set to |params|.
1. Let |related browsing contexts| be a [=/set=] containing |context|.
1. For each |session| in the [=set of sessions for which an event is enabled=] given "<code>bluetooth.requestDevicePromptOpened</code>" and |related browsing contexts|:
1. For each |session| in the [=set of sessions for which an event is enabled=] given "<code>bluetooth.requestDevicePromptUpdated</code>" and |related browsing contexts|:
1. [=Emit an event=] with |session| and |body|.

</div>
Expand Down

0 comments on commit 11c7753

Please sign in to comment.