CINXE.COM

Web Bluetooth

<!doctype html><html lang="en"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"> <title>Web Bluetooth</title> <meta content="CG-DRAFT" name="w3c-status"> <link href="https://www.w3.org/StyleSheets/TR/2021/cg-draft" rel="stylesheet"> <meta content="Bikeshed version 82ce88815, updated Thu Sep 7 16:33:55 2023 -0700" name="generator"> <link href="https://webbluetoothcg.github.io/web-bluetooth/" rel="canonical"> <meta content="f3b31870764ce76fa1fa671f7bcdac7944a246a0" name="document-revision"> <style> .argument-list { display: inline-block; vertical-align: top; } /* Show self-links for various elements. This is incompatible with nearby floats. */ .note, .why, .example, .issue { overflow: inherit; } .unstable::before { content: "This section is not stable."; float: right; color: red; } .unstable { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='290'><text transform='rotate(-45)' text-anchor='middle' font-family='sans-serif' font-weight='bold' font-size='70' y='210' opacity='.1'>Unstable</text></svg>"); background-repeat: repeat } .unstable.example:not(.no-marker)::before { content: "Example " counter(example) " (Unstable)"; float: none; } .note { background-color: rgba(145, 235, 145, .2); } .example { background-color: rgba(240, 230, 170, .2); } .def { background-color: rgba(85, 170, 255, .2); } .issue { background-color: rgba(235, 145, 145, .2); } table { border-collapse: collapse; border-left-style: hidden; border-right-style: hidden; text-align: left; } table caption { font-weight: bold; padding: 3px; text-align: left; } table td, table th { border: 1px solid black; padding: 3px; } </style> <style>/* Boilerplate: style-autolinks */ .css.css, .property.property, .descriptor.descriptor { color: var(--a-normal-text); font-size: inherit; font-family: inherit; } .css::before, .property::before, .descriptor::before { content: "‘"; } .css::after, .property::after, .descriptor::after { content: "’"; } .property, .descriptor { /* Don't wrap property and descriptor names */ white-space: nowrap; } .type { /* CSS value <type> */ font-style: italic; } pre .property::before, pre .property::after { content: ""; } [data-link-type="property"]::before, [data-link-type="propdesc"]::before, [data-link-type="descriptor"]::before, [data-link-type="value"]::before, [data-link-type="function"]::before, [data-link-type="at-rule"]::before, [data-link-type="selector"]::before, [data-link-type="maybe"]::before { content: "‘"; } [data-link-type="property"]::after, [data-link-type="propdesc"]::after, [data-link-type="descriptor"]::after, [data-link-type="value"]::after, [data-link-type="function"]::after, [data-link-type="at-rule"]::after, [data-link-type="selector"]::after, [data-link-type="maybe"]::after { content: "’"; } [data-link-type].production::before, [data-link-type].production::after, .prod [data-link-type]::before, .prod [data-link-type]::after { content: ""; } [data-link-type=element], [data-link-type=element-attr] { font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace; font-size: .9em; } [data-link-type=element]::before { content: "<" } [data-link-type=element]::after { content: ">" } [data-link-type=biblio] { white-space: pre; } @media (prefers-color-scheme: dark) { :root { --selflink-text: black; --selflink-bg: silver; --selflink-hover-text: white; } } </style> <style>/* Boilerplate: style-colors */ /* Any --*-text not paired with a --*-bg is assumed to have a transparent bg */ :root { color-scheme: light dark; --text: black; --bg: white; --unofficial-watermark: url(https://www.w3.org/StyleSheets/TR/2016/logos/UD-watermark); --logo-bg: #1a5e9a; --logo-active-bg: #c00; --logo-text: white; --tocnav-normal-text: #707070; --tocnav-normal-bg: var(--bg); --tocnav-hover-text: var(--tocnav-normal-text); --tocnav-hover-bg: #f8f8f8; --tocnav-active-text: #c00; --tocnav-active-bg: var(--tocnav-normal-bg); --tocsidebar-text: var(--text); --tocsidebar-bg: #f7f8f9; --tocsidebar-shadow: rgba(0,0,0,.1); --tocsidebar-heading-text: hsla(203,20%,40%,.7); --toclink-text: var(--text); --toclink-underline: #3980b5; --toclink-visited-text: var(--toclink-text); --toclink-visited-underline: #054572; --heading-text: #005a9c; --hr-text: var(--text); --algo-border: #def; --del-text: red; --del-bg: transparent; --ins-text: #080; --ins-bg: transparent; --a-normal-text: #034575; --a-normal-underline: #bbb; --a-visited-text: var(--a-normal-text); --a-visited-underline: #707070; --a-hover-bg: rgba(75%, 75%, 75%, .25); --a-active-text: #c00; --a-active-underline: #c00; --blockquote-border: silver; --blockquote-bg: transparent; --blockquote-text: currentcolor; --issue-border: #e05252; --issue-bg: #fbe9e9; --issue-text: var(--text); --issueheading-text: #831616; --example-border: #e0cb52; --example-bg: #fcfaee; --example-text: var(--text); --exampleheading-text: #574b0f; --note-border: #52e052; --note-bg: #e9fbe9; --note-text: var(--text); --noteheading-text: hsl(120, 70%, 30%); --notesummary-underline: silver; --assertion-border: #aaa; --assertion-bg: #eee; --assertion-text: black; --advisement-border: orange; --advisement-bg: #fec; --advisement-text: var(--text); --advisementheading-text: #b35f00; --warning-border: red; --warning-bg: hsla(40,100%,50%,0.95); --warning-text: var(--text); --amendment-border: #330099; --amendment-bg: #F5F0FF; --amendment-text: var(--text); --amendmentheading-text: #220066; --def-border: #8ccbf2; --def-bg: #def; --def-text: var(--text); --defrow-border: #bbd7e9; --datacell-border: silver; --indexinfo-text: #707070; --indextable-hover-text: black; --indextable-hover-bg: #f7f8f9; --outdatedspec-bg: rgba(0, 0, 0, .5); --outdatedspec-text: black; --outdated-bg: maroon; --outdated-text: white; --outdated-shadow: red; --editedrec-bg: darkorange; } @media (prefers-color-scheme: dark) { :root { --text: #ddd; --bg: black; --unofficial-watermark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cg fill='%23100808' transform='translate(200 200) rotate(-45) translate(-200 -200)' stroke='%23100808' stroke-width='3'%3E%3Ctext x='50%25' y='220' style='font: bold 70px sans-serif; text-anchor: middle; letter-spacing: 6px;'%3EUNOFFICIAL%3C/text%3E%3Ctext x='50%25' y='305' style='font: bold 70px sans-serif; text-anchor: middle; letter-spacing: 6px;'%3EDRAFT%3C/text%3E%3C/g%3E%3C/svg%3E"); --logo-bg: #1a5e9a; --logo-active-bg: #c00; --logo-text: white; --tocnav-normal-text: #999; --tocnav-normal-bg: var(--bg); --tocnav-hover-text: var(--tocnav-normal-text); --tocnav-hover-bg: #080808; --tocnav-active-text: #f44; --tocnav-active-bg: var(--tocnav-normal-bg); --tocsidebar-text: var(--text); --tocsidebar-bg: #080808; --tocsidebar-shadow: rgba(255,255,255,.1); --tocsidebar-heading-text: hsla(203,20%,40%,.7); --toclink-text: var(--text); --toclink-underline: #6af; --toclink-visited-text: var(--toclink-text); --toclink-visited-underline: #054572; --heading-text: #8af; --hr-text: var(--text); --algo-border: #456; --del-text: #f44; --del-bg: transparent; --ins-text: #4a4; --ins-bg: transparent; --a-normal-text: #6af; --a-normal-underline: #555; --a-visited-text: var(--a-normal-text); --a-visited-underline: var(--a-normal-underline); --a-hover-bg: rgba(25%, 25%, 25%, .2); --a-active-text: #f44; --a-active-underline: var(--a-active-text); --borderedblock-bg: rgba(255, 255, 255, .05); --blockquote-border: silver; --blockquote-bg: var(--borderedblock-bg); --blockquote-text: currentcolor; --issue-border: #e05252; --issue-bg: var(--borderedblock-bg); --issue-text: var(--text); --issueheading-text: hsl(0deg, 70%, 70%); --example-border: hsl(50deg, 90%, 60%); --example-bg: var(--borderedblock-bg); --example-text: var(--text); --exampleheading-text: hsl(50deg, 70%, 70%); --note-border: hsl(120deg, 100%, 35%); --note-bg: var(--borderedblock-bg); --note-text: var(--text); --noteheading-text: hsl(120, 70%, 70%); --notesummary-underline: silver; --assertion-border: #444; --assertion-bg: var(--borderedblock-bg); --assertion-text: var(--text); --advisement-border: orange; --advisement-bg: #222218; --advisement-text: var(--text); --advisementheading-text: #f84; --warning-border: red; --warning-bg: hsla(40,100%,20%,0.95); --warning-text: var(--text); --amendment-border: #330099; --amendment-bg: #080010; --amendment-text: var(--text); --amendmentheading-text: #cc00ff; --def-border: #8ccbf2; --def-bg: #080818; --def-text: var(--text); --defrow-border: #136; --datacell-border: silver; --indexinfo-text: #aaa; --indextable-hover-text: var(--text); --indextable-hover-bg: #181818; --outdatedspec-bg: rgba(255, 255, 255, .5); --outdatedspec-text: black; --outdated-bg: maroon; --outdated-text: white; --outdated-shadow: red; --editedrec-bg: darkorange; } /* In case a transparent-bg image doesn't expect to be on a dark bg, which is quite common in practice... */ img { background: white; } } </style> <style>/* Boilerplate: style-counters */ body { counter-reset: example figure issue; } .issue { counter-increment: issue; } .issue:not(.no-marker)::before { content: "Issue " counter(issue); } .example { counter-increment: example; } .example:not(.no-marker)::before { content: "Example " counter(example); } .invalid.example:not(.no-marker)::before, .illegal.example:not(.no-marker)::before { content: "Invalid Example" counter(example); } figcaption { counter-increment: figure; } figcaption:not(.no-marker)::before { content: "Figure " counter(figure) " "; } </style> <style>/* Boilerplate: style-dfn-panel */ :root { --dfnpanel-bg: #ddd; --dfnpanel-text: var(--text); } @media (prefers-color-scheme: dark) { :root { --dfnpanel-bg: #222; --dfnpanel-text: var(--text); } } .dfn-panel { position: absolute; z-index: 35; width: 20em; width: 300px; height: auto; max-height: 500px; overflow: auto; padding: 0.5em 0.75em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: var(--dfnpanel-bg); color: var(--dfnpanel-text); border: outset 0.2em; white-space: normal; /* in case it's moved into a pre */ } .dfn-panel:not(.on) { display: none; } .dfn-panel * { margin: 0; padding: 0; text-indent: 0; } .dfn-panel > b { display: block; } .dfn-panel a { color: var(--dfnpanel-text); } .dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; } .dfn-panel > b + b { margin-top: 0.25em; } .dfn-panel ul { padding: 0 0 0 1em; list-style: none; } .dfn-panel li a { white-space: pre; display: inline-block; max-width: calc(300px - 1.5em - 1em); overflow: hidden; text-overflow: ellipsis; } .dfn-panel.activated { display: inline-block; position: fixed; left: .5em; bottom: 2em; margin: 0 auto; max-width: calc(100vw - 1.5em - .4em - .5em); max-height: 30vh; } .dfn-paneled[role="button"] { cursor: pointer; } </style> <style>/* Boilerplate: style-dfn-panel */ :root { --dfnpanel-bg: #ddd; --dfnpanel-text: var(--text); } @media (prefers-color-scheme: dark) { :root { --dfnpanel-bg: #222; --dfnpanel-text: var(--text); } } .dfn-panel { position: absolute; z-index: 35; width: 20em; width: 300px; height: auto; max-height: 500px; overflow: auto; padding: 0.5em 0.75em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: var(--dfnpanel-bg); color: var(--dfnpanel-text); border: outset 0.2em; white-space: normal; /* in case it's moved into a pre */ } .dfn-panel:not(.on) { display: none; } .dfn-panel * { margin: 0; padding: 0; text-indent: 0; } .dfn-panel > b { display: block; } .dfn-panel a { color: var(--dfnpanel-text); } .dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; } .dfn-panel > b + b { margin-top: 0.25em; } .dfn-panel ul { padding: 0 0 0 1em; list-style: none; } .dfn-panel li a { white-space: pre; display: inline-block; max-width: calc(300px - 1.5em - 1em); overflow: hidden; text-overflow: ellipsis; } .dfn-panel.activated { display: inline-block; position: fixed; left: .5em; bottom: 2em; margin: 0 auto; max-width: calc(100vw - 1.5em - .4em - .5em); max-height: 30vh; } .dfn-paneled[role="button"] { cursor: pointer; } </style> <style>/* Boilerplate: style-issues */ a[href].issue-return { float: right; float: inline-end; color: var(--issueheading-text); font-weight: bold; text-decoration: none; } </style> <style>/* Boilerplate: style-md-lists */ /* This is a weird hack for me not yet following the commonmark spec regarding paragraph and lists. */ [data-md] > :first-child { margin-top: 0; } [data-md] > :last-child { margin-bottom: 0; } </style> <style>/* Boilerplate: style-mdn-anno */ :root { --mdn-bg: #EEE; --mdn-shadow: #999; --mdn-nosupport-text: #ccc; } @media (prefers-color-scheme: dark) { :root { --mdn-bg: #222; --mdn-shadow: #444; --mdn-nosupport-text: #666; } } .mdn-anno { background: var(--mdn-bg, #EEE); border-radius: .25em; box-shadow: 0 0 3px var(--mdn-shadow, #999); color: var(--text, black); font: 1em sans-serif; hyphens: none; max-width: min-content; overflow: hidden; padding: 0.2em; position: absolute; right: 0.3em; top: auto; white-space: nowrap; word-wrap: normal; z-index: 8; } .mdn-anno.unpositioned { display: none; } .mdn-anno.overlapping-main { opacity: .2; transition: opacity .1s; } .mdn-anno[open] { opacity: 1; z-index: 9; min-width: 9em; } .mdn-anno:hover { opacity: 1; outline: var(--text, black) 1px solid; } .mdn-anno > summary { font-weight: normal; text-align: right; cursor: pointer; display: block; } .mdn-anno > summary > .less-than-two-engines-flag { color: red; padding-right: 2px; } .mdn-anno > summary > .all-engines-flag { color: green; padding-right: 2px; } .mdn-anno > summary > span { color: #fff; background-color: #000; font-weight: normal; font-family: zillaslab, Palatino, "Palatino Linotype", serif; padding: 2px 3px 0px 3px; line-height: 1.3em; vertical-align: top; } .mdn-anno > .feature { margin-top: 20px; } .mdn-anno > .feature:not(:first-of-type) { border-top: 1px solid #999; margin-top: 6px; padding-top: 2px; } .mdn-anno > .feature > .less-than-two-engines-text { color: red; } .mdn-anno > .feature > .all-engines-text { color: green; } .mdn-anno > .feature > p { font-size: .75em; margin-top: 6px; margin-bottom: 0; } .mdn-anno > .feature > p + p { margin-top: 3px; } .mdn-anno > .feature > .support { display: block; font-size: 0.6em; margin: 0; padding: 0; margin-top: 2px; } .mdn-anno > .feature > .support + div { padding-top: 0.5em; } .mdn-anno > .feature > .support > hr { display: block; border: none; border-top: 1px dotted #999; padding: 3px 0px 0px 0px; margin: 2px 3px 0px 3px; } .mdn-anno > .feature > .support > hr::before { content: ""; } .mdn-anno > .feature > .support > span { padding: 0.2em 0; display: block; display: table; } .mdn-anno > .feature > .support > span.no { color: var(--mdn-nosupport-text); filter: grayscale(100%); } .mdn-anno > .feature > .support > span.no::before { opacity: 0.5; } .mdn-anno > .feature > .support > span:first-of-type { padding-top: 0.5em; } .mdn-anno > .feature > .support > span > span { padding: 0 0.5em; display: table-cell; } .mdn-anno > .feature > .support > span > span:first-child { width: 100%; } .mdn-anno > .feature > .support > span > span:last-child { width: 100%; white-space: pre; padding: 0; } .mdn-anno > .feature > .support > span::before { content: ' '; display: table-cell; min-width: 1.5em; height: 1.5em; background: no-repeat center center; background-size: contain; text-align: right; font-size: 0.75em; font-weight: bold; } .mdn-anno > .feature > .support > .chrome_android::before { background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg); } .mdn-anno > .feature > .support > .firefox_android::before { background-image: url(https://resources.whatwg.org/browser-logos/firefox.png); } .mdn-anno > .feature > .support > .chrome::before { background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg); } .mdn-anno > .feature > .support > .edge_blink::before { background-image: url(https://resources.whatwg.org/browser-logos/edge.svg); } .mdn-anno > .feature > .support > .edge::before { background-image: url(https://resources.whatwg.org/browser-logos/edge_legacy.svg); } .mdn-anno > .feature > .support > .firefox::before { background-image: url(https://resources.whatwg.org/browser-logos/firefox.png); } .mdn-anno > .feature > .support > .ie::before { background-image: url(https://resources.whatwg.org/browser-logos/ie.png); } .mdn-anno > .feature > .support > .safari_ios::before { background-image: url(https://resources.whatwg.org/browser-logos/safari-ios.svg); } .mdn-anno > .feature > .support > .nodejs::before { background-image: url(https://nodejs.org/static/images/favicons/favicon.ico); } .mdn-anno > .feature > .support > .opera_android::before { background-image: url(https://resources.whatwg.org/browser-logos/opera.svg); } .mdn-anno > .feature > .support > .opera::before { background-image: url(https://resources.whatwg.org/browser-logos/opera.svg); } .mdn-anno > .feature > .support > .safari::before { background-image: url(https://resources.whatwg.org/browser-logos/safari.png); } .mdn-anno > .feature > .support > .samsunginternet_android::before { background-image: url(https://resources.whatwg.org/browser-logos/samsung.svg); } .mdn-anno > .feature > .support > .webview_android::before { background-image: url(https://resources.whatwg.org/browser-logos/android-webview.png); } .name-slug-mismatch { color: red; } .caniuse-status:hover { z-index: 9; } /* dt, li, .issue, .note, and .example are "position: relative", so to put annotation at right margin, must move to right of containing block */; .h-entry:not(.status-LS) dt > .mdn-anno, .h-entry:not(.status-LS) li > .mdn-anno, .h-entry:not(.status-LS) .issue > .mdn-anno, .h-entry:not(.status-LS) .note > .mdn-anno, .h-entry:not(.status-LS) .example > .mdn-anno { right: -6.7em; } .h-entry p + .mdn-anno { margin-top: 0; } h2 + .mdn-anno.after { margin: -48px 0 0 0; } h3 + .mdn-anno.after { margin: -46px 0 0 0; } h4 + .mdn-anno.after { margin: -42px 0 0 0; } h5 + .mdn-anno.after { margin: -40px 0 0 0; } h6 + .mdn-anno.after { margin: -40px 0 0 0; } </style> <style>/* Boilerplate: style-selflinks */ :root { --selflink-text: white; --selflink-bg: gray; --selflink-hover-text: black; } .heading, .issue, .note, .example, li, dt { position: relative; } a.self-link { position: absolute; top: 0; left: calc(-1 * (3.5rem - 26px)); width: calc(3.5rem - 26px); height: 2em; text-align: center; border: none; transition: opacity .2s; opacity: .5; } a.self-link:hover { opacity: 1; } .heading > a.self-link { font-size: 83%; } .example > a.self-link, .note > a.self-link, .issue > a.self-link { /* These blocks are overflow:auto, so positioning outside doesn't work. */ left: auto; right: 0; } li > a.self-link { left: calc(-1 * (3.5rem - 26px) - 2em); } dfn > a.self-link { top: auto; left: auto; opacity: 0; width: 1.5em; height: 1.5em; background: var(--selflink-bg); color: var(--selflink-text); font-style: normal; transition: opacity .2s, background-color .2s, color .2s; } dfn:hover > a.self-link { opacity: 1; } dfn > a.self-link:hover { color: var(--selflink-hover-text); } a.self-link::before { content: "¶"; } .heading > a.self-link::before { content: "§"; } dfn > a.self-link::before { content: "#"; } </style> <style>/* Boilerplate: style-syntax-highlighting */ pre.idl.highlight { background: var(--borderedblock-bg, var(--def-bg)); } </style> <style>/* Boilerplate: style-syntax-highlighting */ code.highlight { padding: .1em; border-radius: .3em; } pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; } .highlight:not(.idl) { background: rgba(0, 0, 0, .03); } c-[a] { color: #990055 } /* Keyword.Declaration */ c-[b] { color: #990055 } /* Keyword.Type */ c-[c] { color: #708090 } /* Comment */ c-[d] { color: #708090 } /* Comment.Multiline */ c-[e] { color: #0077aa } /* Name.Attribute */ c-[f] { color: #669900 } /* Name.Tag */ c-[g] { color: #222222 } /* Name.Variable */ c-[k] { color: #990055 } /* Keyword */ c-[l] { color: #000000 } /* Literal */ c-[m] { color: #000000 } /* Literal.Number */ c-[n] { color: #0077aa } /* Name */ c-[o] { color: #999999 } /* Operator */ c-[p] { color: #999999 } /* Punctuation */ c-[s] { color: #a67f59 } /* Literal.String */ c-[t] { color: #a67f59 } /* Literal.String.Single */ c-[u] { color: #a67f59 } /* Literal.String.Double */ c-[cp] { color: #708090 } /* Comment.Preproc */ c-[c1] { color: #708090 } /* Comment.Single */ c-[cs] { color: #708090 } /* Comment.Special */ c-[kc] { color: #990055 } /* Keyword.Constant */ c-[kn] { color: #990055 } /* Keyword.Namespace */ c-[kp] { color: #990055 } /* Keyword.Pseudo */ c-[kr] { color: #990055 } /* Keyword.Reserved */ c-[ld] { color: #000000 } /* Literal.Date */ c-[nc] { color: #0077aa } /* Name.Class */ c-[no] { color: #0077aa } /* Name.Constant */ c-[nd] { color: #0077aa } /* Name.Decorator */ c-[ni] { color: #0077aa } /* Name.Entity */ c-[ne] { color: #0077aa } /* Name.Exception */ c-[nf] { color: #0077aa } /* Name.Function */ c-[nl] { color: #0077aa } /* Name.Label */ c-[nn] { color: #0077aa } /* Name.Namespace */ c-[py] { color: #0077aa } /* Name.Property */ c-[ow] { color: #999999 } /* Operator.Word */ c-[mb] { color: #000000 } /* Literal.Number.Bin */ c-[mf] { color: #000000 } /* Literal.Number.Float */ c-[mh] { color: #000000 } /* Literal.Number.Hex */ c-[mi] { color: #000000 } /* Literal.Number.Integer */ c-[mo] { color: #000000 } /* Literal.Number.Oct */ c-[sb] { color: #a67f59 } /* Literal.String.Backtick */ c-[sc] { color: #a67f59 } /* Literal.String.Char */ c-[sd] { color: #a67f59 } /* Literal.String.Doc */ c-[se] { color: #a67f59 } /* Literal.String.Escape */ c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */ c-[si] { color: #a67f59 } /* Literal.String.Interpol */ c-[sx] { color: #a67f59 } /* Literal.String.Other */ c-[sr] { color: #a67f59 } /* Literal.String.Regex */ c-[ss] { color: #a67f59 } /* Literal.String.Symbol */ c-[vc] { color: #0077aa } /* Name.Variable.Class */ c-[vg] { color: #0077aa } /* Name.Variable.Global */ c-[vi] { color: #0077aa } /* Name.Variable.Instance */ c-[il] { color: #000000 } /* Literal.Number.Integer.Long */ @media (prefers-color-scheme: dark) { .highlight:not(.idl) { background: rgba(255, 255, 255, .05); } c-[a] { color: #d33682 } /* Keyword.Declaration */ c-[b] { color: #d33682 } /* Keyword.Type */ c-[c] { color: #2aa198 } /* Comment */ c-[d] { color: #2aa198 } /* Comment.Multiline */ c-[e] { color: #268bd2 } /* Name.Attribute */ c-[f] { color: #b58900 } /* Name.Tag */ c-[g] { color: #cb4b16 } /* Name.Variable */ c-[k] { color: #d33682 } /* Keyword */ c-[l] { color: #657b83 } /* Literal */ c-[m] { color: #657b83 } /* Literal.Number */ c-[n] { color: #268bd2 } /* Name */ c-[o] { color: #657b83 } /* Operator */ c-[p] { color: #657b83 } /* Punctuation */ c-[s] { color: #6c71c4 } /* Literal.String */ c-[t] { color: #6c71c4 } /* Literal.String.Single */ c-[u] { color: #6c71c4 } /* Literal.String.Double */ c-[ch] { color: #2aa198 } /* Comment.Hashbang */ c-[cp] { color: #2aa198 } /* Comment.Preproc */ c-[cpf] { color: #2aa198 } /* Comment.PreprocFile */ c-[c1] { color: #2aa198 } /* Comment.Single */ c-[cs] { color: #2aa198 } /* Comment.Special */ c-[kc] { color: #d33682 } /* Keyword.Constant */ c-[kn] { color: #d33682 } /* Keyword.Namespace */ c-[kp] { color: #d33682 } /* Keyword.Pseudo */ c-[kr] { color: #d33682 } /* Keyword.Reserved */ c-[ld] { color: #657b83 } /* Literal.Date */ c-[nc] { color: #268bd2 } /* Name.Class */ c-[no] { color: #268bd2 } /* Name.Constant */ c-[nd] { color: #268bd2 } /* Name.Decorator */ c-[ni] { color: #268bd2 } /* Name.Entity */ c-[ne] { color: #268bd2 } /* Name.Exception */ c-[nf] { color: #268bd2 } /* Name.Function */ c-[nl] { color: #268bd2 } /* Name.Label */ c-[nn] { color: #268bd2 } /* Name.Namespace */ c-[py] { color: #268bd2 } /* Name.Property */ c-[ow] { color: #657b83 } /* Operator.Word */ c-[mb] { color: #657b83 } /* Literal.Number.Bin */ c-[mf] { color: #657b83 } /* Literal.Number.Float */ c-[mh] { color: #657b83 } /* Literal.Number.Hex */ c-[mi] { color: #657b83 } /* Literal.Number.Integer */ c-[mo] { color: #657b83 } /* Literal.Number.Oct */ c-[sa] { color: #6c71c4 } /* Literal.String.Affix */ c-[sb] { color: #6c71c4 } /* Literal.String.Backtick */ c-[sc] { color: #6c71c4 } /* Literal.String.Char */ c-[dl] { color: #6c71c4 } /* Literal.String.Delimiter */ c-[sd] { color: #6c71c4 } /* Literal.String.Doc */ c-[se] { color: #6c71c4 } /* Literal.String.Escape */ c-[sh] { color: #6c71c4 } /* Literal.String.Heredoc */ c-[si] { color: #6c71c4 } /* Literal.String.Interpol */ c-[sx] { color: #6c71c4 } /* Literal.String.Other */ c-[sr] { color: #6c71c4 } /* Literal.String.Regex */ c-[ss] { color: #6c71c4 } /* Literal.String.Symbol */ c-[fm] { color: #268bd2 } /* Name.Function.Magic */ c-[vc] { color: #cb4b16 } /* Name.Variable.Class */ c-[vg] { color: #cb4b16 } /* Name.Variable.Global */ c-[vi] { color: #cb4b16 } /* Name.Variable.Instance */ c-[vm] { color: #cb4b16 } /* Name.Variable.Magic */ c-[il] { color: #657b83 } /* Literal.Number.Integer.Long */ } </style> <style>/* Boilerplate: style-var-click-highlighting */ /* Colors were chosen in Lab using https://nixsensor.com/free-color-converter/ D50 2deg illuminant, L in [0,100], a and b in [-128, 128] 0 = lab(85,0,85) 1 = lab(85,80,30) 2 = lab(85,-40,40) 3 = lab(85,-50,0) 4 = lab(85,5,15) 5 = lab(85,-10,-50) 6 = lab(85,35,-15) */ var { cursor: pointer; } var.selected0 { background-color: #F4D200; box-shadow: 0 0 0 2px #F4D200; } var.selected1 { background-color: #FF87A2; box-shadow: 0 0 0 2px #FF87A2; } var.selected2 { background-color: #96E885; box-shadow: 0 0 0 2px #96E885; } var.selected3 { background-color: #3EEED2; box-shadow: 0 0 0 2px #3EEED2; } var.selected4 { background-color: #EACFB6; box-shadow: 0 0 0 2px #EACFB6; } var.selected5 { background-color: #82DDFF; box-shadow: 0 0 0 2px #82DDFF; } var.selected6 { background-color: #FFBCF2; box-shadow: 0 0 0 2px #FFBCF2; } </style> <body class="h-entry"> <div class="head"> <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2021/logos/W3C" width="72"> </a> </p> <h1 class="p-name no-ref" id="title">Web Bluetooth</h1> <p id="w3c-state"><a href="https://www.w3.org/standards/types#CG-DRAFT">Draft Community Group Report</a>, <time class="dt-updated" datetime="2024-10-09">9 October 2024</time></p> <details open> <summary>More details about this document</summary> <div data-fill-with="spec-metadata"> <dl> <dt>This version: <dd><a class="u-url" href="https://webbluetoothcg.github.io/web-bluetooth/">https://webbluetoothcg.github.io/web-bluetooth/</a> <dt>Issue Tracking: <dd><a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/">GitHub</a> <dd><a href="#issues-index">Inline In Spec</a> <dt class="editor">Editors: <dd class="editor p-author h-card vcard" data-editor-id="83788"><a class="p-name fn u-email email" href="mailto:reillyg@google.com">Reilly Grant</a> (<a class="p-org org" href="https://www.google.com">Google LLC</a>) <dd class="editor p-author h-card vcard" data-editor-id="106543"><a class="p-name fn u-email email" href="mailto:odejesush@google.com">Ovidio Ruiz-Henríquez</a> (<a class="p-org org" href="https://www.google.com">Google LLC</a>) <dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="https://github.com/WebBluetoothCG/web-bluetooth/graphs/contributors">See contributors on GitHub</a> <dt>Translations <small>(non-normative)</small>: <dd><span title="Japanese"><a href="https://tkybpp.github.io/web-bluetooth-jp/" hreflang="ja" lang="ja" rel="alternate">日本語</a></span> <dt>Participate: <dd><a href="https://www.w3.org/community/web-bluetooth/">Join the W3C Community Group</a> <dd><a href="https://github.com/WebBluetoothCG/web-bluetooth">Fix the text through GitHub</a> <dd><a href="mailto:public-web-bluetooth@w3.org">public-web-bluetooth@w3.org</a> (<a href="https://lists.w3.org/Archives/Public/public-web-bluetooth/" rel="discussion">archives</a>) <dd><a href="irc://irc.w3.org:6665/#web-bluetooth">IRC: #web-bluetooth on W3C’s IRC</a> </dl> </div> </details> <div data-fill-with="warning"></div> <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/policies/#copyright">Copyright</a> © 2024 the Contributors to the Web Bluetooth Specification, published by the <a href="https://www.w3.org/community/web-bluetooth/">Web Bluetooth Community Group</a> under the <a href="https://www.w3.org/community/about/agreements/cla/">W3C Community Contributor License Agreement (CLA)</a>. A human-readable <a href="http://www.w3.org/community/about/agreements/cla-deed/">summary</a> is available. </p> <hr title="Separator for header"> </div> <div class="p-summary" data-fill-with="abstract"> <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2> <p>This document describes an API to discover and communicate with devices over the Bluetooth 4 wireless standard using the Generic Attribute Profile (GATT).</p> </div> <h2 class="no-num no-toc no-ref heading settled" id="sotd"><span class="content">Status of this document</span></h2> <div data-fill-with="status"> <p> This specification was published by the <a href="https://www.w3.org/community/web-bluetooth/">Web Bluetooth Community Group</a>. It is not a W3C Standard nor is it on the W3C Standards Track. Please note that under the <a href="https://www.w3.org/community/about/agreements/cla/">W3C Community Contributor License Agreement (CLA)</a> there is a limited opt-out and other conditions apply. Learn more about <a href="http://www.w3.org/community/">W3C Community and Business Groups</a>. </p> <p> Changes to this document may be tracked at <a href="https://github.com/WebBluetoothCG/web-bluetooth/commits/gh-pages">https://github.com/WebBluetoothCG/web-bluetooth/commits/gh-pages</a>. </p> <p>If you wish to make comments regarding this document, please send them to <a href="mailto:public-web-bluetooth@w3.org">public-web-bluetooth@w3.org</a> (<a href="mailto:public-web-bluetooth-request@w3.org?subject=subscribe">subscribe</a>, <a href="http://lists.w3.org/Archives/Public/public-web-bluetooth/">archives</a>).</p> <p></p> </div> <div data-fill-with="at-risk"></div> <nav data-fill-with="table-of-contents" id="toc"> <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2> <ol class="toc" role="directory"> <li> <a href="#introduction"><span class="secno">1</span> <span class="content">Introduction</span></a> <ol class="toc"> <li><a href="#introduction-examples"><span class="secno">1.1</span> <span class="content">Examples</span></a> </ol> <li><a href="#security-and-privacy"><span class="secno">2</span> <span class="content">Security considerations</span></a> <li> <a href="#privacy"><span class="secno">3</span> <span class="content">Privacy considerations</span></a> <ol class="toc"> <li><a href="#device-access-is-powerful"><span class="secno">3.1</span> <span class="content">Device access is powerful</span></a> <li><a href="#server-takeovers"><span class="secno">3.2</span> <span class="content">Trusted servers can serve malicious code</span></a> <li><a href="#attacks-on-devices"><span class="secno">3.3</span> <span class="content">Attacks on devices</span></a> <li> <a href="#bluetooth-device-identifiers"><span class="secno">3.4</span> <span class="content">Bluetooth device identifiers</span></a> <ol class="toc"> <li><a href="#remote-device-identifiers"><span class="secno">3.4.1</span> <span class="content">Identifiers for remote Bluetooth devices</span></a> <li><a href="#ua-bluetooth-address"><span class="secno">3.4.2</span> <span class="content">The UA’s Bluetooth address</span></a> </ol> <li><a href="#availability-fingerprint"><span class="secno">3.5</span> <span class="content">Exposing Bluetooth availability</span></a> </ol> <li> <a href="#device-discovery"><span class="secno">4</span> <span class="content">Device Discovery</span></a> <ol class="toc"> <li><a href="#permission-api-integration"><span class="secno">4.1</span> <span class="content">Permission API Integration</span></a> <li><a href="#availability"><span class="secno">4.2</span> <span class="content">Overall Bluetooth availability</span></a> </ol> <li> <a href="#device-representation"><span class="secno">5</span> <span class="content">Device Representation</span></a> <ol class="toc"> <li><a href="#global-device-properties"><span class="secno">5.1</span> <span class="content">Global Bluetooth device properties</span></a> <li> <a href="#bluetoothdevice-interface"><span class="secno">5.2</span> <span class="content">BluetoothDevice</span></a> <ol class="toc"> <li><a href="#handling-visibility-change"><span class="secno">5.2.1</span> <span class="content">Handling Visibility Change</span></a> <li><a href="#handling-full-activity-loss"><span class="secno">5.2.2</span> <span class="content">Handling Document Loss of Full Activity</span></a> <li> <a href="#advertising-events"><span class="secno">5.2.3</span> <span class="content">Responding to Advertising Events</span></a> <ol class="toc"> <li><a href="#bluetoothmanufacturerdatamap"><span class="secno">5.2.3.1</span> <span class="content">BluetoothManufacturerDataMap</span></a> <li><a href="#bluetoothservicedatamap"><span class="secno">5.2.3.2</span> <span class="content">BluetoothServiceDataMap</span></a> </ol> </ol> </ol> <li> <a href="#gatt-interaction"><span class="secno">6</span> <span class="content">GATT Interaction</span></a> <ol class="toc"> <li> <a href="#information-model"><span class="secno">6.1</span> <span class="content">GATT Information Model</span></a> <ol class="toc"> <li><a href="#persistence"><span class="secno">6.1.1</span> <span class="content">Persistence across connections</span></a> <li><a href="#bluetooth-cache"><span class="secno">6.1.2</span> <span class="content">The Bluetooth cache</span></a> <li><a href="#navigating-bluetooth-hierarchy"><span class="secno">6.1.3</span> <span class="content">Navigating the Bluetooth Hierarchy</span></a> <li><a href="#identifying-attributes"><span class="secno">6.1.4</span> <span class="content">Identifying Services, Characteristics, and Descriptors</span></a> </ol> <li><a href="#bluetoothgattremoteserver-interface"><span class="secno">6.2</span> <span class="content">BluetoothRemoteGATTServer</span></a> <li><a href="#bluetoothgattservice-interface"><span class="secno">6.3</span> <span class="content">BluetoothRemoteGATTService</span></a> <li> <a href="#bluetoothgattcharacteristic-interface"><span class="secno">6.4</span> <span class="content">BluetoothRemoteGATTCharacteristic</span></a> <ol class="toc"> <li><a href="#characteristicproperties-interface"><span class="secno">6.4.1</span> <span class="content">BluetoothCharacteristicProperties</span></a> </ol> <li><a href="#bluetoothgattdescriptor-interface"><span class="secno">6.5</span> <span class="content">BluetoothRemoteGATTDescriptor</span></a> <li> <a href="#events"><span class="secno">6.6</span> <span class="content">Events</span></a> <ol class="toc"> <li><a href="#bluetooth-tree"><span class="secno">6.6.1</span> <span class="content">Bluetooth Tree</span></a> <li><a href="#event-types"><span class="secno">6.6.2</span> <span class="content">Event types</span></a> <li><a href="#disconnection-events"><span class="secno">6.6.3</span> <span class="content">Responding to Disconnection</span></a> <li><a href="#notification-events"><span class="secno">6.6.4</span> <span class="content">Responding to Notifications and Indications</span></a> <li><a href="#service-change-events"><span class="secno">6.6.5</span> <span class="content">Responding to Service Changes</span></a> <li><a href="#idl-event-handlers"><span class="secno">6.6.6</span> <span class="content">IDL event handlers</span></a> </ol> <li><a href="#error-handling"><span class="secno">6.7</span> <span class="content">Error handling</span></a> </ol> <li> <a href="#uuids"><span class="secno">7</span> <span class="content">UUIDs</span></a> <ol class="toc"> <li><a href="#standardized-uuids"><span class="secno">7.1</span> <span class="content">Standardized UUIDs</span></a> <li><a href="#gatt-assigned-numbers"><span class="secno">7.2</span> <span class="content">GATT assigned numbers</span></a> </ol> <li><a href="#advertising-data-filter"><span class="secno">8</span> <span class="content">Advertising Data Filter</span></a> <li><a href="#the-blocklist"><span class="secno">9</span> <span class="content">The Blocklist</span></a> <li><a href="#navigator-extensions"><span class="secno">10</span> <span class="content">Extensions to the Navigator Interface</span></a> <li> <a href="#integrations"><span class="secno">11</span> <span class="content">Integrations</span></a> <ol class="toc"> <li><a href="#permissions-policy"><span class="secno">11.1</span> <span class="content">Permissions Policy</span></a> </ol> <li> <a href="#automated-testing"><span class="secno">12</span> <span class="content">Automated testing</span></a> <ol class="toc"> <li><a href="#bluetooth-bidi-definitions"><span class="secno">12.1</span> <span class="content">Definitions</span></a> <li> <a href="#bluetooth-module"><span class="secno">12.2</span> <span class="content">The bluetooth module</span></a> <ol class="toc"> <li> <a href="#bidi-types"><span class="secno">12.2.1</span> <span class="content">Types</span></a> <ol class="toc"> <li><a href="#bluetooth-requestdevice-type"><span class="secno">12.2.1.1</span> <span class="content">The bluetooth.RequestDevice Type</span></a> <li><a href="#bluetooth-requestdeviceinfo-type"><span class="secno">12.2.1.2</span> <span class="content">The bluetooth.RequestDeviceInfo Type</span></a> <li><a href="#bluetooth-requestdeviceprompt-type"><span class="secno">12.2.1.3</span> <span class="content">The bluetooth.RequestDevicePrompt Type</span></a> <li><a href="#bluetooth-scanrecord-type"><span class="secno">12.2.1.4</span> <span class="content">The bluetooth.ScanRecord Type</span></a> </ol> <li><a href="#bidi-errors"><span class="secno">12.2.2</span> <span class="content">Errors</span></a> <li> <a href="#bidi-commands"><span class="secno">12.2.3</span> <span class="content">Commands</span></a> <ol class="toc"> <li><a href="#bluetooth-handlerequestdeviceprompt-command"><span class="secno">12.2.3.1</span> <span class="content">The bluetooth.handleRequestDevicePrompt Command</span></a> <li><a href="#bluetooth-simulateAdapter-command"><span class="secno">12.2.3.2</span> <span class="content">The bluetooth.simulateAdapter Command</span></a> <li><a href="#bluetooth-simulateconnectedperipheral-command"><span class="secno">12.2.3.3</span> <span class="content">The bluetooth.simulatePreconnectedPeripheral Command</span></a> <li><a href="#bluetooth-simulateadvertisement-command"><span class="secno">12.2.3.4</span> <span class="content">The bluetooth.simulateAdvertisement Command</span></a> </ol> <li> <a href="#bidi-events"><span class="secno">12.2.4</span> <span class="content">Events</span></a> <ol class="toc"> <li><a href="#bluetooth-requestdevicepromptupdated-event"><span class="secno">12.2.4.1</span> <span class="content">The bluetooth.requestDevicePromptUpdated Event</span></a> </ol> </ol> </ol> <li><a href="#terminology"><span class="secno">13</span> <span class="content">Terminology and Conventions</span></a> <li> <a href="#w3c-conformance"><span class="secno"></span> <span class="content">Conformance</span></a> <ol class="toc"> <li><a href="#w3c-conventions"><span class="secno"></span> <span class="content">Document conventions</span></a> </ol> <li> <a href="#index"><span class="secno"></span> <span class="content">Index</span></a> <ol class="toc"> <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a> <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a> </ol> <li> <a href="#references"><span class="secno"></span> <span class="content">References</span></a> <ol class="toc"> <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a> <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a> </ol> <li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a> <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a> </ol> </nav> <main> <h2 class="heading settled" data-level="1" id="introduction"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#introduction"></a></h2> <p><em>This section is non-normative.</em></p> <p><a href="https://developer.bluetooth.org/">Bluetooth</a> is a standard for short-range wireless communication between devices. Bluetooth "Classic" (<abbr title="Basic Rate">BR</abbr>/<abbr title="Enhanced Data Rate">EDR</abbr>) defines a set of binary protocols and supports speeds up to about 24Mbps. Bluetooth 4.0 introduced a new "Low Energy" mode known as "Bluetooth Smart", <abbr title="Bluetooth Low Energy">BLE</abbr>, or just <abbr title="Low Energy">LE</abbr> which is limited to about 1Mbps but allows devices to leave their transmitters off most of the time. BLE provides most of its functionality through key/value pairs provided by the <a data-link-type="dfn" href="#generic-attribute-profile" id="ref-for-generic-attribute-profile">Generic Attribute Profile (<abbr title="Generic Attribute Profile">GATT</abbr>)</a>.</p> <p>BLE defines multiple roles that devices can play. The <a data-link-type="dfn" href="#broadcaster" id="ref-for-broadcaster">Broadcaster</a> and <a data-link-type="dfn" href="#observer" id="ref-for-observer">Observer</a> roles are for transmitter- and receiver-only applications, respectively. Devices acting in the <a data-link-type="dfn" href="#peripheral" id="ref-for-peripheral">Peripheral</a> role can receive connections, and devices acting in the <a data-link-type="dfn" href="#central" id="ref-for-central">Central</a> role can connect to <a data-link-type="dfn" href="#peripheral" id="ref-for-peripheral①">Peripheral</a> devices.</p> <p>A device acting in either the <a data-link-type="dfn" href="#peripheral" id="ref-for-peripheral②">Peripheral</a> or <a data-link-type="dfn" href="#central" id="ref-for-central①">Central</a> role can host a <a data-link-type="dfn" href="#gatt-server" id="ref-for-gatt-server">GATT Server</a>, which exposes a hierarchy of <a data-link-type="dfn" href="#service" id="ref-for-service">Service</a>s, <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic">Characteristic</a>s, and <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor">Descriptor</a>s. See <a href="#information-model">§ 6.1 GATT Information Model</a> for more details about this hierarchy. Despite being designed to support BLE transport, the GATT protocol can also run over BR/EDR transport.</p> <p>The first version of this specification allows web pages, running on a UA in the <a data-link-type="dfn" href="#central" id="ref-for-central②">Central</a> role, to connect to <a data-link-type="dfn" href="#gatt-server" id="ref-for-gatt-server①">GATT Server</a>s over either a BR/EDR or LE connection. While this specification cites the <a data-link-type="biblio" href="#biblio-bluetooth42" title="BLUETOOTH SPECIFICATION Version 4.2">[BLUETOOTH42]</a> specification, it intends to also support communication among devices that only implement Bluetooth 4.0 or 4.1.</p> <h3 class="heading settled" data-level="1.1" id="introduction-examples"><span class="secno">1.1. </span><span class="content">Examples</span><a class="self-link" href="#introduction-examples"></a></h3> <div class="example" id="example-heart-rate-monitor"> <a class="self-link" href="#example-heart-rate-monitor"></a> To discover and retrieve data from a standard heart rate monitor, a website would use code like the following: <pre class="highlight"><c- a>let</c-> chosenHeartRateService <c- o>=</c-> <c- kc>null</c-><c- p>;</c-> navigator<c- p>.</c->bluetooth<c- p>.</c-><a data-link-type="idl" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice">requestDevice</a><c- p>({</c-> filters<c- o>:</c-> <c- p>[{</c-> services<c- o>:</c-> <c- p>[</c-><c- t>'heart_rate'</c-><c- p>],</c-> <c- p>}]</c-> <c- p>}).</c->then<c- p>(</c->device <c- p>=></c-> device<c- p>.</c->gatt<c- p>.</c-><a data-link-type="functionish" href="#dom-bluetoothremotegattserver-connect" id="ref-for-dom-bluetoothremotegattserver-connect">connect<c- p>()</c-></a><c- p>)</c-> <c- p>.</c->then<c- p>(</c->server <c- p>=></c-> server<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothremotegattserver-getprimaryservice" id="ref-for-dom-bluetoothremotegattserver-getprimaryservice">getPrimaryService</a><c- p>(</c-><a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_services.txt#:~:text=heart_rate" id="ref-for-:~:text=heart_rate"><c- t>'heart_rate'</c-></a><c- p>))</c-> <c- p>.</c->then<c- p>(</c->service <c- p>=></c-> <c- p>{</c-> chosenHeartRateService <c- o>=</c-> service<c- p>;</c-> <c- k>return</c-> Promise<c- p>.</c->all<c- p>([</c-> service<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothremotegattservice-getcharacteristic" id="ref-for-dom-bluetoothremotegattservice-getcharacteristic">getCharacteristic</a><c- p>(</c-><a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=body_sensor_location" id="ref-for-:~:text=body_sensor_location"><c- t>'body_sensor_location'</c-></a><c- p>)</c-> <c- p>.</c->then<c- p>(</c->handleBodySensorLocationCharacteristic<c- p>),</c-> service<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothremotegattservice-getcharacteristic" id="ref-for-dom-bluetoothremotegattservice-getcharacteristic①">getCharacteristic</a><c- p>(</c-><a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=heart_rate_measurement" id="ref-for-:~:text=heart_rate_measurement"><c- t>'heart_rate_measurement'</c-></a><c- p>)</c-> <c- p>.</c->then<c- p>(</c->handleHeartRateMeasurementCharacteristic<c- p>),</c-> <c- p>]);</c-> <c- p>});</c-> <c- a>function</c-> handleBodySensorLocationCharacteristic<c- p>(</c->characteristic<c- p>)</c-> <c- p>{</c-> <c- k>if</c-> <c- p>(</c->characteristic <c- o>===</c-> <c- kc>null</c-><c- p>)</c-> <c- p>{</c-> console<c- p>.</c->log<c- p>(</c-><c- u>"Unknown sensor location."</c-><c- p>);</c-> <c- k>return</c-> Promise<c- p>.</c->resolve<c- p>();</c-> <c- p>}</c-> <c- k>return</c-> characteristic<c- p>.</c-><a data-link-type="functionish" href="#dom-bluetoothremotegattcharacteristic-readvalue" id="ref-for-dom-bluetoothremotegattcharacteristic-readvalue">readValue<c- p>()</c-></a> <c- p>.</c->then<c- p>(</c->sensorLocationData <c- p>=></c-> <c- p>{</c-> <c- a>const</c-> sensorLocation <c- o>=</c-> sensorLocationData<c- p>.</c->getUint8<c- p>(</c-><c- mf>0</c-><c- p>);</c-> <c- k>switch</c-> <c- p>(</c->sensorLocation<c- p>)</c-> <c- p>{</c-> <c- k>case</c-> <c- mf>0</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Other'</c-><c- p>;</c-> <c- k>case</c-> <c- mf>1</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Chest'</c-><c- p>;</c-> <c- k>case</c-> <c- mf>2</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Wrist'</c-><c- p>;</c-> <c- k>case</c-> <c- mf>3</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Finger'</c-><c- p>;</c-> <c- k>case</c-> <c- mf>4</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Hand'</c-><c- p>;</c-> <c- k>case</c-> <c- mf>5</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Ear Lobe'</c-><c- p>;</c-> <c- k>case</c-> <c- mf>6</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Foot'</c-><c- p>;</c-> <c- k>default</c-><c- o>:</c-> <c- k>return</c-> <c- t>'Unknown'</c-><c- p>;</c-> <c- p>}</c-> <c- p>}).</c->then<c- p>(</c->location <c- p>=></c-> console<c- p>.</c->log<c- p>(</c->location<c- p>));</c-> <c- p>}</c-> <c- a>function</c-> handleHeartRateMeasurementCharacteristic<c- p>(</c->characteristic<c- p>)</c-> <c- p>{</c-> <c- k>return</c-> characteristic<c- p>.</c-><a data-link-type="functionish" href="#dom-bluetoothremotegattcharacteristic-startnotifications" id="ref-for-dom-bluetoothremotegattcharacteristic-startnotifications">startNotifications<c- p>()</c-></a> <c- p>.</c->then<c- p>(</c-><c- kr>char</c-> <c- p>=></c-> <c- p>{</c-> characteristic<c- p>.</c->addEventListener<c- p>(</c-><c- t>'</c-><a class="idl-code" data-link-type="event" href="#eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged" id="ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged"><c- t>characteristicvaluechanged</c-></a><c- t>'</c-><c- p>,</c-> onHeartRateChanged<c- p>);</c-> <c- p>});</c-> <c- p>}</c-> <c- a>function</c-> onHeartRateChanged<c- p>(</c->event<c- p>)</c-> <c- p>{</c-> <c- a>const</c-> characteristic <c- o>=</c-> event<c- p>.</c->target<c- p>;</c-> console<c- p>.</c->log<c- p>(</c->parseHeartRate<c- p>(</c->characteristic<c- p>.</c-><a class="idl-code" data-link-type="attribute" href="#dom-bluetoothremotegattcharacteristic-value" id="ref-for-dom-bluetoothremotegattcharacteristic-value">value</a><c- p>));</c-> <c- p>}</c-> </pre> <p><code>parseHeartRate()</code> would be defined using the <a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=heart_rate_measurement" id="ref-for-:~:text=heart_rate_measurement①"> <code>heart_rate_measurement</code> documentation</a> to read the <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor">DataView</a></code> stored in a <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic">BluetoothRemoteGATTCharacteristic</a></code>'s <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-value" id="ref-for-dom-bluetoothremotegattcharacteristic-value①">value</a></code> field.</p> <pre class="highlight"><c- a>function</c-> parseHeartRate<c- p>(</c->data<c- p>)</c-> <c- p>{</c-> <c- a>const</c-> flags <c- o>=</c-> data<c- p>.</c->getUint8<c- p>(</c-><c- mf>0</c-><c- p>);</c-> <c- a>const</c-> rate16Bits <c- o>=</c-> flags <c- o>&amp;</c-> <c- mh>0x1</c-><c- p>;</c-> <c- a>const</c-> result <c- o>=</c-> <c- p>{};</c-> <c- a>let</c-> index <c- o>=</c-> <c- mf>1</c-><c- p>;</c-> <c- k>if</c-> <c- p>(</c->rate16Bits<c- p>)</c-> <c- p>{</c-> result<c- p>.</c->heartRate <c- o>=</c-> data<c- p>.</c->getUint16<c- p>(</c->index<c- p>,</c-> <c- d>/*littleEndian=*/</c-><c- kc>true</c-><c- p>);</c-> index <c- o>+=</c-> <c- mf>2</c-><c- p>;</c-> <c- p>}</c-> <c- k>else</c-> <c- p>{</c-> result<c- p>.</c->heartRate <c- o>=</c-> data<c- p>.</c->getUint8<c- p>(</c->index<c- p>);</c-> index <c- o>+=</c-> <c- mf>1</c-><c- p>;</c-> <c- p>}</c-> <c- a>const</c-> contactDetected <c- o>=</c-> flags <c- o>&amp;</c-> <c- mh>0x2</c-><c- p>;</c-> <c- a>const</c-> contactSensorPresent <c- o>=</c-> flags <c- o>&amp;</c-> <c- mh>0x4</c-><c- p>;</c-> <c- k>if</c-> <c- p>(</c->contactSensorPresent<c- p>)</c-> <c- p>{</c-> result<c- p>.</c->contactDetected <c- o>=</c-> <c- o>!!</c->contactDetected<c- p>;</c-> <c- p>}</c-> <c- a>const</c-> energyPresent <c- o>=</c-> flags <c- o>&amp;</c-> <c- mh>0x8</c-><c- p>;</c-> <c- k>if</c-> <c- p>(</c->energyPresent<c- p>)</c-> <c- p>{</c-> result<c- p>.</c->energyExpended <c- o>=</c-> data<c- p>.</c->getUint16<c- p>(</c->index<c- p>,</c-> <c- d>/*littleEndian=*/</c-><c- kc>true</c-><c- p>);</c-> index <c- o>+=</c-> <c- mf>2</c-><c- p>;</c-> <c- p>}</c-> <c- a>const</c-> rrIntervalPresent <c- o>=</c-> flags <c- o>&amp;</c-> <c- mh>0x10</c-><c- p>;</c-> <c- k>if</c-> <c- p>(</c->rrIntervalPresent<c- p>)</c-> <c- p>{</c-> <c- a>const</c-> rrIntervals <c- o>=</c-> <c- p>[];</c-> <c- k>for</c-> <c- p>(;</c-> index <c- o>+</c-> <c- mf>1</c-> <c- o>&lt;</c-> data<c- p>.</c->byteLength<c- p>;</c-> index <c- o>+=</c-> <c- mf>2</c-><c- p>)</c-> <c- p>{</c-> rrIntervals<c- p>.</c->push<c- p>(</c->data<c- p>.</c->getUint16<c- p>(</c->index<c- p>,</c-> <c- d>/*littleEndian=*/</c-><c- kc>true</c-><c- p>));</c-> <c- p>}</c-> result<c- p>.</c->rrIntervals <c- o>=</c-> rrIntervals<c- p>;</c-> <c- p>}</c-> <c- k>return</c-> result<c- p>;</c-> <c- p>}</c-> </pre> <p><code>onHeartRateChanged()</code> might log an object like</p> <pre class="highlight"><c- p>{</c-> heartRate<c- o>:</c-> <c- mf>70</c-><c- p>,</c-> contactDetected<c- o>:</c-> <c- kc>true</c-><c- p>,</c-> energyExpended<c- o>:</c-> <c- mf>750</c-><c- p>,</c-> <c- c1>// Meaning 750kJ.</c-> rrIntervals<c- o>:</c-> <c- p>[</c-><c- mf>890</c-><c- p>,</c-> <c- mf>870</c-><c- p>]</c-> <c- c1>// Meaning .87s and .85s.</c-> <c- p>}</c-> </pre> <p>If the heart rate sensor reports the <code>energyExpended</code> field, the web application can reset its value to <code>0</code> by writing to the <code class="idl"><a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=heart_rate_control_point" id="ref-for-:~:text=heart_rate_control_point">heart_rate_control_point</a></code> characteristic:</p> <pre class="highlight"><c- a>function</c-> resetEnergyExpended<c- p>()</c-> <c- p>{</c-> <c- k>if</c-> <c- p>(</c-><c- o>!</c->chosenHeartRateService<c- p>)</c-> <c- p>{</c-> <c- k>return</c-> Promise<c- p>.</c->reject<c- p>(</c-><c- ow>new</c-> <c- ne>Error</c-><c- p>(</c-><c- t>'No heart rate sensor selected yet.'</c-><c- p>));</c-> <c- p>}</c-> <c- k>return</c-> chosenHeartRateService<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothremotegattservice-getcharacteristic" id="ref-for-dom-bluetoothremotegattservice-getcharacteristic②">getCharacteristic</a><c- p>(</c-><a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=heart_rate_control_point" id="ref-for-:~:text=heart_rate_control_point①"><c- t>'heart_rate_control_point'</c-></a><c- p>)</c-> <c- p>.</c->then<c- p>(</c->controlPoint <c- p>=></c-> <c- p>{</c-> <c- a>const</c-> resetEnergyExpended <c- o>=</c-> <c- ow>new</c-> Uint8Array<c- p>([</c-><c- mf>1</c-><c- p>]);</c-> <c- k>return</c-> controlPoint<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-writevalue" id="ref-for-dom-bluetoothremotegattcharacteristic-writevalue">writeValue</a><c- p>(</c->resetEnergyExpended<c- p>);</c-> <c- p>});</c-> <c- p>}</c-> </pre> </div> <h2 class="heading settled" data-level="2" id="security-and-privacy"><span class="secno">2. </span><span class="content">Security considerations</span><a class="self-link" href="#security-and-privacy"></a></h2> <p class="issue" id="issue-965b39bd"><a class="self-link" href="#issue-965b39bd"></a> See <a href="#privacy">§ 3 Privacy considerations</a> section. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/575">[Issue #575]</a></p> <h2 class="heading settled" data-level="3" id="privacy"><span class="secno">3. </span><span class="content">Privacy considerations</span><a class="self-link" href="#privacy"></a></h2> <h3 class="heading settled" data-level="3.1" id="device-access-is-powerful"><span class="secno">3.1. </span><span class="content">Device access is powerful</span><a class="self-link" href="#device-access-is-powerful"></a></h3> <p>When a website requests access to devices using <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice①">requestDevice()</a></code>, it gets the ability to access all GATT services mentioned in the call. The UA MUST inform the user what capabilities these services give the website before asking which devices to entrust to it. If any services in the list aren’t known to the UA, the UA MUST assume they give the site complete control over the device and inform the user of this risk. The UA MUST also allow the user to inspect what sites have access to what devices and <a data-link-type="dfn" href="#revoke-bluetooth-access" id="ref-for-revoke-bluetooth-access">revoke</a> these pairings.</p> <p>The UA MUST NOT allow the user to pair entire classes of devices with a website. It is possible to construct a class of devices for which each individual device sends the same Bluetooth-level identifying information. UAs are not required to attempt to detect this sort of forgery and MAY let a user pair this pseudo-device with a website.</p> <p>To help ensure that only the entity the user approved for access actually has access, this specification requires that only <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#secure-context" id="ref-for-secure-context">secure contexts</a> can access Bluetooth devices.</p> <h3 class="heading settled" data-level="3.2" id="server-takeovers"><span class="secno">3.2. </span><span class="content">Trusted servers can serve malicious code</span><a class="self-link" href="#server-takeovers"></a></h3> <p><em>This section is non-normative.</em></p> <p>Even if the user trusts an origin, that origin’s servers or developers could be compromised, or the origin’s site could be vulnerable to XSS attacks. Either could lead to users granting malicious code access to valuable devices. Origins should define a Content Security Policy (<a data-link-type="biblio" href="#biblio-csp3" title="Content Security Policy Level 3">[CSP3]</a>) to reduce the risk of XSS attacks, but this doesn’t help with compromised servers or developers.</p> <p>The ability to retrieve granted devices after a page reload, provided by <a href="#permission-api-integration">§ 4.1 Permission API Integration</a>, makes this risk worse. Instead of having to get the user to grant access while the site is compromised, the attacker can take advantage of previously-granted devices if the user simply visits while the site is compromised. On the other hand, when sites can keep access to devices across page reloads, they don’t have to show as many permission prompts overall, making it more likely that users will pay attention to the prompts they do see.</p> <h3 class="heading settled" data-level="3.3" id="attacks-on-devices"><span class="secno">3.3. </span><span class="content">Attacks on devices</span><a class="self-link" href="#attacks-on-devices"></a></h3> <p><em>This section is non-normative.</em></p> <p>Communication from websites can break the security model of some devices, which assume they only receive messages from the trusted operating system of a remote device. Human Interface Devices are a prominent example, where allowing a website to communicate would allow that site to log keystrokes. This specification includes a <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist">GATT blocklist</a> of such vulnerable services, characteristics, and descriptors to prevent websites from taking advantage of them.</p> <p>We expect that many devices are vulnerable to unexpected data delivered to their radio. In the past, these devices had to be exploited one-by-one, but this API makes it plausible to conduct large-scale attacks. This specification takes several approaches to make such attacks more difficult:</p> <ul> <li data-md> <p>Pairing individual devices instead of device classes requires at least a user action before a device can be exploited.</p> <li data-md> <p>Constraining access to <a data-link-type="dfn" href="#generic-attribute-profile" id="ref-for-generic-attribute-profile①">GATT</a>, as opposed to generic byte-stream access, denies malicious websites access to most parsers on the device.</p> <p>On the other hand, GATT’s <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic①">Characteristic</a> and <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor①">Descriptor</a> values are still byte arrays, which may be set to lengths and formats the device doesn’t expect. UAs are encouraged to validate these values when they can.</p> <li data-md> <p>This API never exposes Bluetooth addressing, data signing or encryption keys (<a data-link-type="dfn" href="#definition-of-keys-and-values" id="ref-for-definition-of-keys-and-values">Definition of Keys and Values</a>) to websites. This makes it more difficult for a website to predict the bits that will be sent over the radio, which blocks <a href="https://www.usenix.org/legacy/events/woot11/tech/final_files/Goodspeed.pdf">packet-in-packet injection attacks</a>. Unfortunately, this only works over encrypted links, which not all BLE devices are required to support.</p> <li data-md> <p>The integration with <a href="#permissions-policy">§ 11.1 Permissions Policy</a> provides protection against unwanted access to Bluetooth capabilities, which requires the top-level document to explicitly allow a cross-origin iframe to use the API’s methods.</p> </ul> <p>UAs can also take further steps to protect their users:</p> <ul> <li data-md> <p>A web service may collect lists of malicious websites and vulnerable devices. UAs can deny malicious websites access to any device and any website access to vulnerable devices.</p> </ul> <h3 class="heading settled" data-level="3.4" id="bluetooth-device-identifiers"><span class="secno">3.4. </span><span class="content">Bluetooth device identifiers</span><a class="self-link" href="#bluetooth-device-identifiers"></a></h3> <p><em>This section is non-normative.</em></p> <p>Each Bluetooth BR/EDR device has a unique 48-bit MAC address known as the <a data-link-type="dfn" href="#bd_addr" id="ref-for-bd_addr">BD_ADDR</a>. Each Bluetooth LE device has at least one of a <a data-link-type="dfn" href="#public-device-address" id="ref-for-public-device-address">Public Device Address</a> and a <a data-link-type="dfn" href="#static-device-address" id="ref-for-static-device-address">Static Device Address</a>. The <a data-link-type="dfn" href="#public-device-address" id="ref-for-public-device-address①">Public Device Address</a> is a MAC address. The <a data-link-type="dfn" href="#static-device-address" id="ref-for-static-device-address①">Static Device Address</a> may be regenerated on each restart. A BR/EDR/LE device will use the same value for the <a data-link-type="dfn" href="#bd_addr" id="ref-for-bd_addr①">BD_ADDR</a> and the <a data-link-type="dfn" href="#public-device-address" id="ref-for-public-device-address②">Public Device Address</a> (specified in the <a data-link-type="dfn" href="#read-bd_addr-command" id="ref-for-read-bd_addr-command">Read BD_ADDR Command</a>).</p> <p>An LE device may also have a unique, 128-bit <a data-link-type="dfn" href="#identity-resolving-key" id="ref-for-identity-resolving-key">Identity Resolving Key</a>, which is sent to trusted devices during the bonding process. To avoid leaking a persistent identifier, an LE device may scan and advertise using a random Resolvable or Non-Resolvable <a data-link-type="dfn" href="#private-address" id="ref-for-private-address">Private Address</a> instead of its Static or Public Address. These are regenerated periodically (approximately every 15 minutes), but a bonded device can check whether one of its stored <a data-link-type="dfn" href="#identity-resolving-key" id="ref-for-identity-resolving-key①">IRK</a>s matches any given Resolvable Private Address using the <a data-link-type="dfn" href="#resolvable-private-address-resolution-procedure" id="ref-for-resolvable-private-address-resolution-procedure">Resolvable Private Address Resolution Procedure</a>.</p> <p>Each Bluetooth device also has a human-readable <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name">Bluetooth Device Name</a>. These aren’t guaranteed to be unique, but may well be, depending on the device type.</p> <h4 class="heading settled" data-level="3.4.1" id="remote-device-identifiers"><span class="secno">3.4.1. </span><span class="content">Identifiers for remote Bluetooth devices</span><a class="self-link" href="#remote-device-identifiers"></a></h4> <p><em>This section is non-normative.</em></p> <p>If a website can retrieve any of the persistent device IDs, these can be used, in combination with a large effort to catalog ambient devices, to discover a user’s location. A device ID can also be used to identify that a user who pairs two different websites with the same Bluetooth device is a single user. On the other hand, many GATT services are available that could be used to fingerprint a device, and a device can easily expose a custom GATT service to make this easier.</p> <p>This specification <a href="#note-device-id-tracking">suggests</a> that the UA use different device IDs for a single device when its user doesn’t intend scripts to learn that it’s a single device, which makes it difficult for websites to abuse the device address like this. Device makers can still design their devices to help track users, but it takes work.</p> <h4 class="heading settled" data-level="3.4.2" id="ua-bluetooth-address"><span class="secno">3.4.2. </span><span class="content">The UA’s Bluetooth address</span><a class="self-link" href="#ua-bluetooth-address"></a></h4> <p><em>This section is non-normative.</em></p> <p>In BR/EDR mode, or in LE mode during active scanning without the <a data-link-type="dfn" href="#privacy-feature" id="ref-for-privacy-feature">Privacy Feature</a>, the UA broadcasts its persistent ID to any nearby Bluetooth radio. This makes it easy to scatter hostile devices in an area and track the UA. As of 2014-08, few or no platforms document that they implement the <a data-link-type="dfn" href="#privacy-feature" id="ref-for-privacy-feature①">Privacy Feature</a>, so despite this spec recommending it, few UAs are likely to use it. This spec does <a href="#requestDevice-user-gesture">require a user gesture</a> for a website to trigger a scan, which reduces the frequency of scans some, but it would still be better for more platforms to expose the <a data-link-type="dfn" href="#privacy-feature" id="ref-for-privacy-feature②">Privacy Feature</a>.</p> <h3 class="heading settled" data-level="3.5" id="availability-fingerprint"><span class="secno">3.5. </span><span class="content">Exposing Bluetooth availability</span><a class="self-link" href="#availability-fingerprint"></a></h3> <p><em>This section is non-normative.</em></p> <p><code>navigator.bluetooth.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability">getAvailability()</a></code></code> exposes whether a Bluetooth radio is available on the user’s system, regardless of whether it is powered on or not. The availability is also affected if the user has configured the UA to block Web Bluetooth. Some users might consider this private, although it’s hard to imagine the damage that would result from revealing it. This information also increases the UA’s <a data-link-type="dfn" href="https://w3c.github.io/fingerprinting-guidance/#dfn-fingerprinting-surface" id="ref-for-dfn-fingerprinting-surface">fingerprinting surface</a> by a bit. This function returns a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects">Promise</a></code>, so UAs have the option of asking the user what value they want to return, but we expect the increased risk to be small enough that UAs will choose not to prompt.</p> <h2 class="heading settled" data-level="4" id="device-discovery"><span class="secno">4. </span><span class="content">Device Discovery</span><a class="self-link" href="#device-discovery"></a></h2> <pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-bluetoothdatafilterinit"><code><c- g>BluetoothDataFilterInit</c-></code></dfn> { <a data-link-type="idl-name" href="https://webidl.spec.whatwg.org/#BufferSource" id="ref-for-BufferSource"><c- n>BufferSource</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDataFilterInit" data-dfn-type="dict-member" data-export data-type="BufferSource " id="dom-bluetoothdatafilterinit-dataprefix"><code><c- g>dataPrefix</c-></code></dfn>; <a data-link-type="idl-name" href="https://webidl.spec.whatwg.org/#BufferSource" id="ref-for-BufferSource①"><c- n>BufferSource</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDataFilterInit" data-dfn-type="dict-member" data-export data-type="BufferSource " id="dom-bluetoothdatafilterinit-mask"><code><c- g>mask</c-></code></dfn>; }; <c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-bluetoothmanufacturerdatafilterinit"><code><c- g>BluetoothManufacturerDataFilterInit</c-></code></dfn> : <a data-link-type="idl-name" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit"><c- n>BluetoothDataFilterInit</c-></a> { <c- b>required</c-> [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#EnforceRange" id="ref-for-EnforceRange"><c- g>EnforceRange</c-></a>] <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short" id="ref-for-idl-unsigned-short"><c- b>unsigned</c-> <c- b>short</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothManufacturerDataFilterInit" data-dfn-type="dict-member" data-export data-type="[EnforceRange] unsigned short " id="dom-bluetoothmanufacturerdatafilterinit-companyidentifier"><code><c- g>companyIdentifier</c-></code></dfn>; }; <c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-bluetoothservicedatafilterinit"><code><c- g>BluetoothServiceDataFilterInit</c-></code></dfn> : <a data-link-type="idl-name" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit①"><c- n>BluetoothDataFilterInit</c-></a> { <c- b>required</c-> <a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid"><c- n>BluetoothServiceUUID</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothServiceDataFilterInit" data-dfn-type="dict-member" data-export data-type="BluetoothServiceUUID " id="dom-bluetoothservicedatafilterinit-service"><code><c- g>service</c-></code></dfn>; }; <c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-bluetoothlescanfilterinit"><code><c- g>BluetoothLEScanFilterInit</c-></code></dfn> { <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid①"><c- n>BluetoothServiceUUID</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothServiceUUID> " href="#dom-bluetoothlescanfilterinit-services" id="ref-for-dom-bluetoothlescanfilterinit-services"><c- g>services</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="DOMString " href="#dom-bluetoothlescanfilterinit-name" id="ref-for-dom-bluetoothlescanfilterinit-name"><c- g>name</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString①"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="DOMString " href="#dom-bluetoothlescanfilterinit-nameprefix" id="ref-for-dom-bluetoothlescanfilterinit-nameprefix"><c- g>namePrefix</c-></a>; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence①"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#dictdef-bluetoothmanufacturerdatafilterinit" id="ref-for-dictdef-bluetoothmanufacturerdatafilterinit"><c- n>BluetoothManufacturerDataFilterInit</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothManufacturerDataFilterInit> " href="#dom-bluetoothlescanfilterinit-manufacturerdata" id="ref-for-dom-bluetoothlescanfilterinit-manufacturerdata"><c- g>manufacturerData</c-></a>; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence②"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#dictdef-bluetoothservicedatafilterinit" id="ref-for-dictdef-bluetoothservicedatafilterinit"><c- n>BluetoothServiceDataFilterInit</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothServiceDataFilterInit> " href="#dom-bluetoothlescanfilterinit-servicedata" id="ref-for-dom-bluetoothlescanfilterinit-servicedata"><c- g>serviceData</c-></a>; }; <c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-requestdeviceoptions"><code><c- g>RequestDeviceOptions</c-></code></dfn> { <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence③"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit"><c- n>BluetoothLEScanFilterInit</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothLEScanFilterInit> " href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters"><c- g>filters</c-></a>; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence④"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit①"><c- n>BluetoothLEScanFilterInit</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothLEScanFilterInit> " href="#dom-requestdeviceoptions-exclusionfilters" id="ref-for-dom-requestdeviceoptions-exclusionfilters"><c- g>exclusionFilters</c-></a>; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence⑤"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid②"><c- n>BluetoothServiceUUID</c-></a>> <a class="idl-code" data-default="[]" data-link-type="dict-member" data-type="sequence<BluetoothServiceUUID> " href="#dom-requestdeviceoptions-optionalservices" id="ref-for-dom-requestdeviceoptions-optionalservices"><c- g>optionalServices</c-></a> = []; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence⑥"><c- b>sequence</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short" id="ref-for-idl-unsigned-short①"><c- b>unsigned</c-> <c- b>short</c-></a>> <a class="idl-code" data-default="[]" data-link-type="dict-member" data-type="sequence<unsigned short> " href="#dom-requestdeviceoptions-optionalmanufacturerdata" id="ref-for-dom-requestdeviceoptions-optionalmanufacturerdata"><c- g>optionalManufacturerData</c-></a> = []; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean"><c- b>boolean</c-></a> <a class="idl-code" data-default="false" data-link-type="dict-member" data-type="boolean " href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices"><c- g>acceptAllDevices</c-></a> = <c- b>false</c->; }; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetooth"><code><c- g>Bluetooth</c-></code></dfn> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget"><c- n>EventTarget</c-></a> { <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean①"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability①"><c- g>getAvailability</c-></a>(); <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler"><c- n>EventHandler</c-></a> <dfn class="idl-code" data-dfn-for="Bluetooth" data-dfn-type="attribute" data-export data-type="EventHandler" id="dom-bluetooth-onavailabilitychanged"><code><c- g>onavailabilitychanged</c-></code><a class="self-link" href="#dom-bluetooth-onavailabilitychanged"></a></dfn>; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject" id="ref-for-SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice"><c- n>BluetoothDevice</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice?" href="#dom-bluetooth-referringdevice" id="ref-for-dom-bluetooth-referringdevice"><c- g>referringDevice</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise①"><c- b>Promise</c-></a>&lt;<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence⑦"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice①"><c- n>BluetoothDevice</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-bluetooth-getdevices" id="ref-for-dom-bluetooth-getdevices"><c- g>getDevices</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise②"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice②"><c- n>BluetoothDevice</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice②"><c- g>requestDevice</c-></a>(<c- b>optional</c-> <a data-link-type="idl-name" href="#dictdef-requestdeviceoptions" id="ref-for-dictdef-requestdeviceoptions"><c- n>RequestDeviceOptions</c-></a> <dfn class="idl-code" data-dfn-for="Bluetooth/requestDevice(options), Bluetooth/requestDevice()" data-dfn-type="argument" data-export id="dom-bluetooth-requestdevice-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-bluetooth-requestdevice-options-options"></a></dfn> = {}); }; <a data-link-type="idl-name" href="#bluetooth" id="ref-for-bluetooth"><c- n>Bluetooth</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#bluetoothdeviceeventhandlers" id="ref-for-bluetoothdeviceeventhandlers"><c- n>BluetoothDeviceEventHandlers</c-></a>; <a data-link-type="idl-name" href="#bluetooth" id="ref-for-bluetooth①"><c- n>Bluetooth</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#characteristiceventhandlers" id="ref-for-characteristiceventhandlers"><c- n>CharacteristicEventHandlers</c-></a>; <a data-link-type="idl-name" href="#bluetooth" id="ref-for-bluetooth②"><c- n>Bluetooth</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#serviceeventhandlers" id="ref-for-serviceeventhandlers"><c- n>ServiceEventHandlers</c-></a>; </pre> <div class="note no-marker" role="note"> <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth③">Bluetooth</a></code> members</div> Note: <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability②">getAvailability()</a></code> informs the page whether Bluetooth is available at all. An adapter that’s disabled through software should count as available. Changes in availability, for example when the user physically attaches or detaches an adapter, are reported through the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetooth-availabilitychanged" id="ref-for-eventdef-bluetooth-availabilitychanged">availabilitychanged</a></code> event. <p class="unstable"> <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-referringdevice" id="ref-for-dom-bluetooth-referringdevice①">referringDevice</a></code> gives access to the device from which the user opened this page, if any. For example, an <a href="https://developers.google.com/beacons/eddystone">Eddystone</a> beacon might advertise a URL, which the UA allows the user to open. A <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③">BluetoothDevice</a></code> representing the beacon would be available through <code>navigator.bluetooth.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-referringdevice" id="ref-for-dom-bluetooth-referringdevice②">referringDevice</a></code></code>. </p> <p class="unstable"> <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-getdevices" id="ref-for-dom-bluetooth-getdevices①">getDevices()</a></code> enables the page to retrieve Bluetooth devices that the user has granted access to. </p> <p><code class="idl"><a data-link-type="idl" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice③">requestDevice(options)</a></code> asks the user to grant this origin access to a device that <a data-link-type="dfn" href="#matches-a-filter" id="ref-for-matches-a-filter">matches any filter</a> in <code>options.<dfn class="dfn-paneled idl-code" data-dfn-for="RequestDeviceOptions" data-dfn-type="dict-member" data-export id="dom-requestdeviceoptions-filters"><code>filters</code></dfn></code> but does not <a data-link-type="dfn" href="#matches-a-filter" id="ref-for-matches-a-filter①">match any filter</a> in <code>options.<dfn class="dfn-paneled idl-code" data-dfn-for="RequestDeviceOptions" data-dfn-type="dict-member" data-export id="dom-requestdeviceoptions-exclusionfilters"><code>exclusionFilters</code></dfn></code>. To <a data-link-type="dfn" href="#matches-a-filter" id="ref-for-matches-a-filter②">match a filter</a>, the device has to:</p> <ul> <li data-md> <p>support <em>all</em> the GATT service UUIDs in the <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothLEScanFilterInit" data-dfn-type="dict-member" data-export id="dom-bluetoothlescanfilterinit-services"><code>services</code></dfn> list if that member is present,</p> <li data-md> <p>have a name equal to <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothLEScanFilterInit" data-dfn-type="dict-member" data-export id="dom-bluetoothlescanfilterinit-name"><code>name</code></dfn> if that member is present,</p> <li data-md> <p>have a name starting with <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothLEScanFilterInit" data-dfn-type="dict-member" data-export id="dom-bluetoothlescanfilterinit-nameprefix"><code>namePrefix</code></dfn> if that member is present,</p> <li data-md> <p>advertise <a data-link-type="dfn" href="#manufacturer-specific-data" id="ref-for-manufacturer-specific-data">manufacturer specific data</a> matching all of the values in <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothLEScanFilterInit" data-dfn-type="dict-member" data-export id="dom-bluetoothlescanfilterinit-manufacturerdata"><code>manufacturerData</code></dfn> if that member is present, and</p> <li data-md> <div class="unstable"> advertise <a data-link-type="dfn" href="#service-data" id="ref-for-service-data">service data</a> matching all of the values in <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothLEScanFilterInit" data-dfn-type="dict-member" data-export id="dom-bluetoothlescanfilterinit-servicedata"><code>serviceData</code></dfn> if that member is present.</div> </ul> <p data-link-for-hint="BluetoothDataFilterInit"> Both <a data-link-type="dfn" href="#manufacturer-specific-data" id="ref-for-manufacturer-specific-data①">Manufacturer Specific Data</a> and <a data-link-type="dfn" href="#service-data" id="ref-for-service-data①">Service Data</a> map a key to an array of bytes. <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit②">BluetoothDataFilterInit</a></code> filters these arrays. An array matches if it has a <var>prefix</var> such that <code><var>prefix</var> &amp; <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask">mask</a></code></code> is equal to <code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-dataprefix" id="ref-for-dom-bluetoothdatafilterinit-dataprefix">dataPrefix</a></code> &amp; <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask①">mask</a></code></code>. </p> <p>Note that if a device changes its behavior significantly when it connects, for example by not advertising its identifying manufacturer data anymore and instead having the client discover some identifying GATT services, the website may need to include filters for both behaviors.</p> <p>In rare cases, a device may not advertise enough distinguishing information to let a site filter out uninteresting devices. In those cases, a site can set <dfn class="dfn-paneled idl-code" data-dfn-for="RequestDeviceOptions" data-dfn-type="dict-member" data-export id="dom-requestdeviceoptions-acceptalldevices"><code>acceptAllDevices</code></dfn> to <code>true</code> and omit all <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters①">filters</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-exclusionfilters" id="ref-for-dom-requestdeviceoptions-exclusionfilters①">exclusionFilters</a></code>. This puts the burden of selecting the right device entirely on the site’s users. If a site uses <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices①">acceptAllDevices</a></code>, it will only be able to use services listed in <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-optionalservices" id="ref-for-dom-requestdeviceoptions-optionalservices①">optionalServices</a></code>.</p> <p>After the user selects a device to pair with this origin, the origin is allowed to access any service whose UUID was listed in the <code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-services" id="ref-for-dom-bluetoothlescanfilterinit-services①">services</a></code> list in any element of <code>options.filters</code> or in <code>options.<dfn class="dfn-paneled idl-code" data-dfn-for="RequestDeviceOptions" data-dfn-type="dict-member" data-export id="dom-requestdeviceoptions-optionalservices"><code>optionalServices</code></dfn></code>. The origin is also allowed to access any manufacturer data from manufacturer codes defined in <code>options.<dfn class="dfn-paneled idl-code" data-dfn-for="RequestDeviceOptions" data-dfn-type="dict-member" data-export id="dom-requestdeviceoptions-optionalmanufacturerdata"><code>optionalManufacturerData</code></dfn></code> from the device’s advertisement data.</p> <p>This implies that if developers filter just by name, they must use <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-optionalservices" id="ref-for-dom-requestdeviceoptions-optionalservices②">optionalServices</a></code> to get access to any services.</p> </div> <div class="example" id="example-filter-by-services"> <a class="self-link" href="#example-filter-by-services"></a> Say the UA is close to the following devices: <table> <tbody> <tr> <th>Device <th>Advertised Services <tr> <td>D1 <td>A, B, C, D <tr> <td>D2 <td>A, B, E <tr> <td>D3 <td>C, D <tr> <td>D4 <td>E <tr> <td>D5 <td><i>&lt;none></i> </table> <p>If the website calls</p> <pre class="highlight">navigator<c- p>.</c->bluetooth<c- p>.</c->requestDevice<c- p>({</c-> filters<c- o>:</c-> <c- p>[</c-> <c- p>{</c->services<c- o>:</c-> <c- p>[</c->A<c- p>,</c-> B<c- p>]}</c-> <c- p>]</c-> <c- p>});</c-> </pre> <p>the user will be shown a dialog containing devices D1 and D2. If the user selects D1, the website will not be able to access services C or D. If the user selects D2, the website will not be able to access service E.</p> <p>On the other hand, if the website calls</p> <pre class="highlight">navigator<c- p>.</c->bluetooth<c- p>.</c->requestDevice<c- p>({</c-> filters<c- o>:</c-> <c- p>[</c-> <c- p>{</c->services<c- o>:</c-> <c- p>[</c->A<c- p>,</c-> B<c- p>]},</c-> <c- p>{</c->services<c- o>:</c-> <c- p>[</c->C<c- p>,</c-> D<c- p>]}</c-> <c- p>]</c-> <c- p>});</c-> </pre> <p>the dialog will contain devices D1, D2, and D3, and if the user selects D1, the website will be able to access services A, B, C, and D.</p> <p>If the website then calls</p> <pre class="highlight">navigator<c- p>.</c->bluetooth<c- p>.</c->getDevices<c- p>();</c-> </pre> <p>the resulting <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects①">Promise</a></code> will resolve into an array containing device D1, and the website will be able to access services A, B, C, and D.</p> <p>The <code>optionalServices</code> list doesn’t add any devices to the dialog the user sees, but it does affect which services the website can use from the device the user picks.</p> <pre class="highlight">navigator<c- p>.</c->bluetooth<c- p>.</c->requestDevice<c- p>({</c-> filters<c- o>:</c-> <c- p>[</c-> <c- p>{</c->services<c- o>:</c-> <c- p>[</c->A<c- p>,</c-> B<c- p>]}</c-> <c- p>],</c-> optionalServices<c- o>:</c-> <c- p>[</c->E<c- p>]</c-> <c- p>});</c-> </pre> <p>Shows a dialog containing D1 and D2, but not D4, since D4 doesn’t contain the required services. If the user selects D2, unlike in the first example, the website will be able to access services A, B, and E.</p> <p>If the website calls</p> <pre class="highlight">navigator<c- p>.</c->bluetooth<c- p>.</c->getDevices<c- p>();</c-> </pre> <p>again, then the resulting <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects②">Promise</a></code> will resolve into an array containing the devices D1 and D2. The A, B, C, and D services will be accessible on device D1, while A, B, and E services will be accessible on device D2.</p> <p>The allowed services also apply if the device changes after the user grants access. For example, if the user selects D1 in the previous <code>requestDevice()</code> call, and D1 later adds a new E service, that will fire the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceadded" id="ref-for-eventdef-bluetoothremotegattservice-serviceadded">serviceadded</a></code> event, and the web page will be able to access service E.</p> </div> <div class="example" id="example-filter-by-name"> <a class="self-link" href="#example-filter-by-name"></a> Say the devices in the <a href="#example-filter-by-services">previous example</a> also advertise names as follows: <table> <tbody> <tr> <th>Device <th>Advertised Device Name <tr> <td>D1 <td>First De… <tr> <td>D2 <td><i>&lt;none></i> <tr> <td>D3 <td>Device Third <tr> <td>D4 <td>Device Fourth <tr> <td>D5 <td>Unique Name </table> <p>The following table shows which devices the user can select between for several values of <var>filters</var> passed to <code>navigator.bluetooth.requestDevice({filters: <var>filters</var>})</code>.</p> <table> <tbody> <tr> <th><var>filters</var> <th>Devices <th>Notes <tr> <td> <pre class="highlight"><c- p>[{</c->name<c- o>:</c-> <c- u>"Unique Name"</c-><c- p>}]</c-> </pre> <td>D5 <td> <tr> <td> <pre class="highlight"><c- p>[{</c->namePrefix<c- o>:</c-> <c- u>"Device"</c-><c- p>}]</c-> </pre> <td>D3, D4 <td> <tr> <td> <pre class="highlight"><c- p>[{</c->name<c- o>:</c-> <c- u>"First De"</c-><c- p>},</c-> <c- p>{</c->name<c- o>:</c-> <c- u>"First Device"</c-><c- p>}]</c-> </pre> <td><i>&lt;none></i> <td> D1 only advertises a prefix of its name, so trying to match its whole name fails. <tr> <td> <pre class="highlight"><c- p>[{</c->namePrefix<c- o>:</c-> <c- u>"First"</c-><c- p>},</c-> <c- p>{</c->name<c- o>:</c-> <c- u>"Unique Name"</c-><c- p>}]</c-> </pre> <td>D1, D5 <td> <tr> <td> <pre class="highlight"><c- p>[{</c->services<c- o>:</c-> <c- p>[</c->C<c- p>],</c-> namePrefix<c- o>:</c-> <c- u>"Device"</c-><c- p>},</c-> <c- p>{</c->name<c- o>:</c-> <c- u>"Unique Name"</c-><c- p>}]</c-> </pre> <td>D3, D5 <td> </table> <p>The following table shows which devices the user can select between for several values of <var>filters</var> and <var>exclusionFilters</var> passed to <code>navigator.bluetooth.requestDevice({filters: <var>filters</var>, exclusionFilters: <var>exclusionFilters</var>})</code>.</p> <table> <tbody> <tr> <th><var>filters</var> <th><var>exclusionFilters</var> <th>Devices <tr> <td> <pre class="highlight"><c- p>[{</c->namePrefix<c- o>:</c-> <c- u>"Device"</c-><c- p>}]</c-> <c- c1>// D3, D4</c-> </pre> <td> <pre class="highlight"><c- p>[{</c->name<c- o>:</c-> <c- u>"Device Third"</c-><c- p>}]</c-> <c- c1>// D3</c-> </pre> <td>D4 <tr> <td> <pre class="highlight"><c- p>[{</c->namePrefix<c- o>:</c-> <c- u>"Device"</c-><c- p>}]</c-> <c- c1>// D3, D4</c-> </pre> <td> <pre class="highlight"><c- p>[{</c->namePrefix<c- o>:</c-> <c- u>"Device F"</c-><c- p>}]</c-> <c- c1>// D4</c-> </pre> <td>D3 <tr> <td> <pre class="highlight"><c- p>[{</c->services<c- o>:</c-> <c- p>[</c->C<c- p>]},</c-> <c- c1>// D1, D3</c-> <c- p>{</c->namePrefix<c- o>:</c-> <c- u>"Device"</c-><c- p>}]</c-> <c- c1>// D3, D4</c-> </pre> <td> <pre class="highlight"><c- p>[{</c->services<c- o>:</c-> <c- p>[</c->A<c- p>]},</c-> <c- c1>// D1</c-> <c- p>{</c->name<c- o>:</c-> <c- u>"Device Fourth"</c-><c- p>}]</c-> <c- c1>// D4</c-> </pre> <td>D3 </table> </div> <div class="example" id="example-filter-by-manufacturer-service-data"> <a class="self-link" href="#example-filter-by-manufacturer-service-data"></a> Say the devices in the <a href="#example-filter-by-services">previous example</a> also advertise manufacturer or service data as follows: <table> <tbody> <tr> <th>Device <th>Manufacturer Data <th>Service Data <tr> <td>D1 <td>17: 01 02 03 <td> <tr> <td>D2 <td> <td>A: 01 02 03 </table> <p>The following table shows which devices the user can select between for several values of <var>filters</var> passed to <code>navigator.bluetooth.requestDevice({filters: <var>filters</var>})</code>.</p> <table> <tbody> <tr> <th><var>filters</var> <th>Devices <tr> <td> <pre class="highlight"><c- p>[{</c-> manufacturerData<c- o>:</c-> <c- p>[{</c-> companyIdentifier<c- o>:</c-> <c- mf>17</c-> <c- p>}]</c-> <c- p>}]</c-> </pre> <td>D1 <tr> <td> <pre class="highlight"><c- p>[{</c-> serviceData<c- o>:</c-> <c- p>[{</c-> service<c- o>:</c-> <c- u>"A"</c-> <c- p>}]</c-> <c- p>}]</c-> </pre> <td>D2 <tr> <td> <pre class="highlight"><c- p>[</c-> <c- p>{</c-> manufacturerData<c- o>:</c-> <c- p>[{</c-> companyIdentifier<c- o>:</c-> <c- mf>17</c-> <c- p>}]</c-> <c- p>},</c-> <c- p>{</c-> serviceData<c- o>:</c-> <c- p>[{</c-> service<c- o>:</c-> <c- u>"A"</c-> <c- p>}]</c-> <c- p>},</c-> <c- p>]</c-> </pre> <td>D1, D2 <tr> <td> <pre class="highlight"><c- p>[</c-> <c- p>{</c-> manufacturerData<c- o>:</c-> <c- p>[{</c-> companyIdentifier<c- o>:</c-> <c- mf>17</c-> <c- p>}],</c-> serviceData<c- o>:</c-> <c- p>[{</c-> service<c- o>:</c-> <c- u>"A"</c-> <c- p>}],</c-> <c- p>},</c-> <c- p>]</c-> </pre> <td><i>&lt;none></i> <tr> <td> <pre class="highlight"><c- p>[</c-> <c- p>{</c-> manufacturerData<c- o>:</c-> <c- p>[</c-> <c- p>{</c-> companyIdentifier<c- o>:</c-> <c- mf>17</c-><c- p>,</c-> dataPrefix<c- o>:</c-> <c- ow>new</c-> Uint8Array<c- p>([</c-><c- mf>1</c-><c- p>,</c-> <c- mf>2</c-><c- p>,</c-> <c- mf>3</c-><c- p>])</c-> <c- p>},</c-> <c- p>],</c-> <c- p>},</c-> <c- p>]</c-> </pre> <td>D1 <tr> <td> <pre class="highlight"><c- p>[</c-> <c- p>{</c-> manufacturerData<c- o>:</c-> <c- p>[</c-> <c- p>{</c-> companyIdentifier<c- o>:</c-> <c- mf>17</c-><c- p>,</c-> dataPrefix<c- o>:</c-> <c- ow>new</c-> Uint8Array<c- p>([</c-><c- mf>1</c-><c- p>,</c-> <c- mf>2</c-><c- p>,</c-> <c- mf>3</c-><c- p>,</c-> <c- mf>4</c-><c- p>])</c-> <c- p>},</c-> <c- p>],</c-> <c- p>},</c-> <c- p>]</c-> </pre> <td><i>&lt;none></i> <tr> <td> <pre class="highlight"><c- p>[</c-> <c- p>{</c-> manufacturerData<c- o>:</c-> <c- p>[</c-> <c- p>{</c-> companyIdentifier<c- o>:</c-> <c- mf>17</c-><c- p>,</c-> dataPrefix<c- o>:</c-> <c- ow>new</c-> Uint8Array<c- p>([</c-><c- mf>1</c-><c- p>])</c-> <c- p>},</c-> <c- p>],</c-> <c- p>},</c-> <c- p>]</c-> </pre> <td>D1 <tr> <td> <pre class="highlight"><c- p>[</c-> <c- p>{</c-> manufacturerData<c- o>:</c-> <c- p>[</c-> <c- p>{</c-> companyIdentifier<c- o>:</c-> <c- mf>17</c-><c- p>,</c-> dataPrefix<c- o>:</c-> <c- ow>new</c-> Uint8Array<c- p>([</c-><c- mh>0x91</c-><c- p>,</c-> <c- mh>0xAA</c-><c- p>]),</c-> mask<c- o>:</c-> <c- ow>new</c-> Uint8Array<c- p>([</c-><c- mh>0x0f</c-><c- p>,</c-> <c- mh>0x57</c-><c- p>]),</c-> <c- p>},</c-> <c- p>],</c-> <c- p>},</c-> <c- p>]</c-> </pre> <td>D1 <tr> <td> <pre class="highlight"><c- p>[</c-> <c- p>{</c-> manufacturerData<c- o>:</c-> <c- p>[</c-> <c- p>{</c-> companyIdentifier<c- o>:</c-> <c- mf>17</c-> <c- p>},</c-> <c- p>{</c-> companyIdentifier<c- o>:</c-> <c- mf>18</c-> <c- p>},</c-> <c- p>]</c-> <c- p>}</c-> <c- p>]</c-> </pre> <td><i>&lt;none></i> </table> </div> <div class="example" data-link-for-hint="RequestDeviceOptions" id="example-disallowed-filters"> <a class="self-link" href="#example-disallowed-filters"></a> Filters that either accept or reject all possible devices cause <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror">TypeError</a></code>s. To accept all devices, use <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices②">acceptAllDevices</a></code> instead. <table> <tbody> <tr> <th>Call <th>Notes <tr> <td> <pre class="highlight">requestDevice<c- p>({})</c-> </pre> <td>Invalid: An absent list of filters doesn’t accept any devices. <tr> <td> <pre class="highlight">requestDevice<c- p>({</c->filters<c- o>:</c-><c- p>[]})</c-> </pre> <td>Invalid: An empty list of filters doesn’t accept any devices. <tr> <td> <pre class="highlight">requestDevice<c- p>({</c->filters<c- o>:</c-><c- p>[{}]})</c-> </pre> <td> Invalid: An empty filter accepts all devices, and so isn’t allowed either. <tr> <td> <pre class="highlight">requestDevice<c- p>({</c-> acceptAllDevices<c- o>:</c-><c- kc>true</c-> <c- p>})</c-> </pre> <td> Valid: Explicitly accept all devices with <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices③">acceptAllDevices</a></code>. <tr> <td> <pre class="highlight">requestDevice<c- p>({</c-> filters<c- o>:</c-> <c- p>[...],</c-> acceptAllDevices<c- o>:</c-><c- kc>true</c-> <c- p>})</c-> </pre> <td>Invalid: <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices④">acceptAllDevices</a></code> would override any <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters②">filters</a></code>. <tr> <td> <pre class="highlight">requestDevice<c- p>({</c-> exclusionFilters<c- o>:</c-> <c- p>[...],</c-> acceptAllDevices<c- o>:</c-><c- kc>true</c-> <c- p>})</c-> </pre> <td>Invalid: <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices⑤">acceptAllDevices</a></code> would override any <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-exclusionfilters" id="ref-for-dom-requestdeviceoptions-exclusionfilters②">exclusionFilters</a></code>. <tr> <td> <pre class="highlight">requestDevice<c- p>({</c-> exclusionFilters<c- o>:</c-> <c- p>[...]</c-> <c- p>})</c-> </pre> <td>Invalid: <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-exclusionfilters" id="ref-for-dom-requestdeviceoptions-exclusionfilters③">exclusionFilters</a></code> require <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters③">filters</a></code>. <tr> <td> <pre class="highlight">requestDevice<c- p>({</c-> filters<c- o>:</c-> <c- p>[...],</c-> exclusionFilters<c- o>:</c-> <c- p>[]</c-> <c- p>})</c-> </pre> <td> Invalid: <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-exclusionfilters" id="ref-for-dom-requestdeviceoptions-exclusionfilters④">exclusionFilters</a></code> must be non-empty to exclude devices. <tr> <td> <pre class="highlight">requestDevice<c- p>({</c-> filters<c- o>:</c-> <c- p>[{</c->namePrefix<c- o>:</c-> <c- u>""</c-><c- p>}]</c-> <c- p>})</c-> </pre> <td> Invalid: <code>namePrefix</code>, if present, must be non-empty to filter devices. <tr> <td> <pre class="highlight">requestDevice<c- p>({</c-> filters<c- o>:</c-> <c- p>[{</c->manufacturerData<c- o>:</c-> <c- p>[]}]</c-> <c- p>})</c-> </pre> <td> Invalid: <code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-manufacturerdata" id="ref-for-dom-bluetoothlescanfilterinit-manufacturerdata①">manufacturerData</a></code>, if present, must be non-empty to filter devices. <tr> <td> <pre class="highlight">requestDevice<c- p>({</c-> filters<c- o>:</c-> <c- p>[{</c->serviceData<c- o>:</c-> <c- p>[]}]</c-> <c- p>})</c-> </pre> <td> Invalid: <code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-servicedata" id="ref-for-dom-bluetoothlescanfilterinit-servicedata①">serviceData</a></code>, if present, must be non-empty to filter devices. </table> </div> <p>Instances of <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth④">Bluetooth</a></code> are created with the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots">internal slots</a> described in the following table:</p> <table> <tbody> <tr> <th><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots①">Internal Slot</a> <th>Initial Value <th>Description (non-normative) <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="attribute" data-export id="dom-bluetooth-deviceinstancemap-slot"><code>[[deviceInstanceMap]]</code></dfn> <td> An empty map from <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device">Bluetooth device</a>s to <code><code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice④">BluetoothDevice</a></code></code> instances. <td> Ensures only one <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice⑤">BluetoothDevice</a></code> instance represents each <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①">Bluetooth device</a> inside a single global object. <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="attribute" data-export id="dom-bluetooth-attributeinstancemap-slot"><code>[[attributeInstanceMap]]</code></dfn> <td> An empty map from <a data-link-type="dfn" href="#bluetooth-cache-bluetooth-cache" id="ref-for-bluetooth-cache-bluetooth-cache">Bluetooth cache</a> entries to <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects③">Promise</a></code>s. <td> The <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects④">Promise</a></code>s resolve to either <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice">BluetoothRemoteGATTService</a></code>, <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①">BluetoothRemoteGATTCharacteristic</a></code>, or <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor">BluetoothRemoteGATTDescriptor</a></code> instances. <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="attribute" data-export id="dom-bluetooth-referringdevice-slot"><code>[[referringDevice]]</code></dfn> <td> <code>null</code> <td> Set to a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice⑥">BluetoothDevice</a></code> while <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#initialise-the-document-object" id="ref-for-initialise-the-document-object">initializing the <code>Document</code> object</a> if the <code>Document</code> was opened from the device. </table> <div class="unstable"> Getting <code>navigator.bluetooth.<dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="attribute" data-export id="dom-bluetooth-referringdevice"><code>referringDevice</code></dfn></code> must return <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-referringdevice-slot" id="ref-for-dom-bluetooth-referringdevice-slot">[[referringDevice]]</a></code>. <div class="algorithm" data-algorithm="initializing referringDevice"> Some UAs may allow the user to cause a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#browsing-context" id="ref-for-browsing-context">browsing context</a> to <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate" id="ref-for-navigate">navigate</a> in response to a <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device②">Bluetooth device</a>. <div class="note" role="note"> Note: For example, if an <a href="https://developers.google.com/beacons/eddystone">Eddystone</a> beacon advertises a URL, the UA may allow the user to navigate to this URL. </div> <p>If this happens, then as part of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#initialise-the-document-object" id="ref-for-initialise-the-document-object①">initializing the <code>Document</code> object</a>, the UA MUST run the following steps:</p> <ol> <li data-md> <p>Let <var>referringDevice</var> be the device that caused the navigation.</p> <li data-md> <p><a data-link-type="dfn" href="#get-the-bluetoothdevice-representing" id="ref-for-get-the-bluetoothdevice-representing">Get the <code>BluetoothDevice</code> representing</a> <var>referringDevice</var> inside <code>navigator.bluetooth</code>, and let <var>referringDeviceObj</var> be the result.</p> <li data-md> <p>If the previous step threw an exception, abort these steps.</p> <div class="note" role="note"> Note: This means the UA didn’t infer that the user intended to grant the current <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms">realm</a> access to <var>referringDevice</var>. For example, the user might have denied GATT access globally. </div> <li data-md> <p>Set <code>navigator.bluetooth.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-referringdevice-slot" id="ref-for-dom-bluetooth-referringdevice-slot①">[[referringDevice]]</a></code></code> to <var>referringDeviceObj</var>.</p> </ol> </div> </div> <div class="algorithm" data-algorithm="matching Bluetooth device with a filter"> A <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device③">Bluetooth device</a> <var>device</var> <dfn class="dfn-paneled" data-dfn-type="dfn" data-local-lt="match a filter|matches any filter" data-noexport id="matches-a-filter">matches a filter</dfn> <var>filter</var> if the following steps return <code>match</code>: <ol> <li data-md> <p>If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-name" id="ref-for-dom-bluetoothlescanfilterinit-name①">name</a></code></code> is present then, if <var>device</var>’s <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name①">Bluetooth Device Name</a> isn’t complete and equal to <code><var>filter</var>.name</code>, return <code>mismatch</code>.</p> <li data-md> <p>If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-nameprefix" id="ref-for-dom-bluetoothlescanfilterinit-nameprefix①">namePrefix</a></code></code> is present then if <var>device</var>’s <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name②">Bluetooth Device Name</a> isn’t present or doesn’t start with <code><var>filter</var>.namePrefix</code>, return <code>mismatch</code>.</p> <li data-md> <p>For each <var>uuid</var> in <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-services" id="ref-for-dom-bluetoothlescanfilterinit-services②">services</a></code></code>, if the UA has not received advertising data, an <a data-link-type="dfn" href="#extended-inquiry-response" id="ref-for-extended-inquiry-response">extended inquiry response</a>, or a service discovery response indicating that the device supports a primary (vs included) service with UUID <var>uuid</var>, return <code>mismatch</code>.</p> <li data-md> <p>For each <var>manufacturerData</var> in <code><var>filter</var>["<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-manufacturerdata" id="ref-for-dom-bluetoothlescanfilterinit-manufacturerdata②">manufacturerData</a></code>"]</code>, if <var>device</var> hasn’t advertised <a data-link-type="dfn" href="#manufacturer-specific-data" id="ref-for-manufacturer-specific-data②">manufacturer specific data</a> with a company identifier code equal to <code><var>manufacturerData</var>["<code class="idl"><a data-link-type="idl" href="#dom-bluetoothmanufacturerdatafilterinit-companyidentifier" id="ref-for-dom-bluetoothmanufacturerdatafilterinit-companyidentifier">companyIdentifier</a></code>"]</code> and with data that <a data-link-type="dfn" href="#bluetoothdatafilterinit-matches" id="ref-for-bluetoothdatafilterinit-matches">matches</a> <code><var>manufacturerData</var></code> return <code>mismatch</code>.</p> <li data-md> <p>For each <var>serviceData</var> in <code><var>filter</var>["<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-servicedata" id="ref-for-dom-bluetoothlescanfilterinit-servicedata②">serviceData</a></code>"]</code>, if <var>device</var> hasn’t advertised <a data-link-type="dfn" href="#service-data" id="ref-for-service-data②">service data</a> with a UUID whose 128-bit form is <code><var>serviceData</var>["<code class="idl"><a data-link-type="idl" href="#dom-bluetoothservicedatafilterinit-service" id="ref-for-dom-bluetoothservicedatafilterinit-service">service</a></code>"]</code> and with data that <a data-link-type="dfn" href="#bluetoothdatafilterinit-matches" id="ref-for-bluetoothdatafilterinit-matches①">matches</a> <code><var>serviceData</var></code> return <code>mismatch</code>.</p> <li data-md> <p>Return <code>match</code>.</p> </ol> </div> <div class="algorithm" data-algorithm="matching Bluetooth device data with a filter"> An array of bytes <var>data</var> <dfn class="dfn-paneled" data-dfn-for="BluetoothDataFilterInit" data-dfn-type="dfn" data-export id="bluetoothdatafilterinit-matches">matches</dfn> a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit③">BluetoothDataFilterInit</a></code> <var>filter</var> if the following steps return <code>match</code>. <div class="note" role="note"> Note: This algorithm assumes that <var>filter</var> has already been <a data-link-type="dfn" href="#bluetoothdatafilterinit-canonicalizing" id="ref-for-bluetoothdatafilterinit-canonicalizing">canonicalized</a>. </div> <ol> <li data-md> <p>Let <var>expectedPrefix</var> be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy">a copy of the bytes held</a> by <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-dataprefix" id="ref-for-dom-bluetoothdatafilterinit-dataprefix①">dataPrefix</a></code></code>.</p> <li data-md> <p>Let <var>mask</var> be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy①">a copy of the bytes held</a> by <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask②">mask</a></code></code>.</p> <li data-md> <p>If <var>data</var> has fewer bytes than <var>expectedPrefix</var>, return <code>mismatch</code>.</p> <li data-md> <p>For each <code>1</code> bit in <var>mask</var>, if the corresponding bit in <var>data</var> is not equal to the corresponding bit in <var>expectedPrefix</var>, return <code>mismatch</code>.</p> <li data-md> <p>Return <code>match</code>.</p> </ol> </div> <div class="algorithm" data-algorithm="a data filter is a strict subset of another data filter"> A <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit④">BluetoothDataFilterInit</a></code> <var>filter1</var> is a <dfn class="dfn-paneled" data-dfn-for="BluetoothDataFilterInit" data-dfn-type="dfn" data-export id="bluetoothdatafilterinit-strict-subset">strict subset</dfn> of a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit⑤">BluetoothDataFilterInit</a></code> <var>filter2</var> if the following steps return <code>true</code>: <ol> <li data-md> <p>If the length of <var>filter1</var> is less than the length of <var>filter2</var>, return <code>false</code>.</p> <li data-md> <p>Let <var>byteIndex</var> be <code>0</code>.</p> <li data-md> <p>While <var>byteIndex</var> is less than the length of <var>filter2</var>, do the following sub-steps:</p> <ol> <li data-md> <p>If <code><var>filter1</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask③">mask</a></code>[<var>byteIndex</var>] &amp; <var>filter2</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask④">mask</a></code>[<var>byteIndex</var>]</code> is not equal to <var>filter2</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask⑤">mask</a></code>[<var>byteIndex</var>], return <code>false</code>.</p> <li data-md> <p>If <code><var>filter1</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-dataprefix" id="ref-for-dom-bluetoothdatafilterinit-dataprefix②">dataPrefix</a></code>[<var>byteIndex</var>] &amp; <var>filter2</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask⑥">mask</a></code>[<var>byteIndex</var>]</code> it not equal to <code><var>filter2</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-dataprefix" id="ref-for-dom-bluetoothdatafilterinit-dataprefix③">dataPrefix</a></code>[<var>byteIndex</var>] &amp; <var>filter2</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask⑦">mask</a></code>[<var>byteIndex</var>]</code>, return <code>false</code>.</p> <li data-md> <p>Set <var>byteIndex</var> to <code><var>byteIndex</var> + 1</code>.</p> </ol> <li data-md> <p>Return <code>true</code>.</p> </ol> </div> <div class="note" role="note"> The list of Service UUIDs that a device advertises might not include all the UUIDs the device supports. The advertising data does specify whether this list is complete. If a website filters for a UUID that a nearby device supports but doesn’t advertise, that device might not be included in the list of devices presented to the user. The UA would need to connect to the device to discover the full list of supported services, which can impair radio performance and cause delays, so this spec doesn’t require it. </div> <div class="algorithm" data-algorithm="getDevice invocation"> To <code><dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="method" data-export id="dom-bluetooth-getdevices"><code>getDevices()</code></dfn></code> method, when invoked and given a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissionstorage" id="ref-for-dictdef-bluetoothpermissionstorage">BluetoothPermissionStorage</a></code> <var>storage</var>, MUST return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel">in parallel</a>: <ol> <li data-md> <p>If <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this">this</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global" id="ref-for-concept-relevant-global">relevant global object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-document-window" id="ref-for-concept-document-window">associated Document</a> is not <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/iframe-embed-object.html#allowed-to-use" id="ref-for-allowed-to-use">allowed to use</a> the <a data-link-type="dfn" href="https://w3c.github.io/webappsec-permissions-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature">policy-controlled feature</a> named "<a data-link-type="dfn" href="#policy-controlled-feature-bluetooth" id="ref-for-policy-controlled-feature-bluetooth">bluetooth</a>", <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>devices</var> be a new empty <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array-objects" id="ref-for-sec-array-objects">Array</a></code>.</p> <li data-md> <p>For each <var>allowedDevice</var> in <code><var>storage</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissionstorage-alloweddevices" id="ref-for-dom-bluetoothpermissionstorage-alloweddevices">allowedDevices</a></code></code>, add the <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice⑦">BluetoothDevice</a></code> object representing <var>allowedDevice</var>@<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot">[[device]]</a></code> to <var>devices</var>.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve">Resolve</a> <var>promise</var> with <var>devices</var>.</p> <div class="note unstable" role="note"> Note: The <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice⑧">BluetoothDevice</a></code>s in <var>devices</var> may not be in range of the Bluetooth radio. For a given <var>device</var> in <var>devices</var>, the <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchadvertisements" id="ref-for-dom-bluetoothdevice-watchadvertisements">watchAdvertisements()</a></code> method can be used to observe when <var>device</var> is in range and broadcasting advertisement packets. When an <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdeviceeventhandlers-advertisementreceived" id="ref-for-eventdef-bluetoothdeviceeventhandlers-advertisementreceived">advertisementreceived</a></code> event <var>event</var> is fired on a <var>device</var>, it may indicate that it is close enough for a connection to be established by calling <code><var>event</var>.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connect" id="ref-for-dom-bluetoothremotegattserver-connect①">connect()</a></code></code>. </div> </ol> </div> <div class="algorithm" data-algorithm="requestDevice invocation"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="method" data-export data-lt="requestDevice(options)|requestDevice()" id="dom-bluetooth-requestdevice"><code>requestDevice(<var>options</var>) </code></dfn></code> method, when invoked, MUST return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise①">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①">in parallel</a>: <ol> <li data-md> <p>If <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-exclusionfilters" id="ref-for-dom-requestdeviceoptions-exclusionfilters⑤">exclusionFilters</a></code></code> is present and <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters④">filters</a></code></code> is not present, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject①">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①">TypeError</a></code> and abort these steps.</p> <li data-md> <p>If <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters⑤">filters</a></code></code> is present and <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices⑥">acceptAllDevices</a></code></code> is <code>true</code>, or if <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters⑥">filters</a></code></code> is not present and <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices⑦">acceptAllDevices</a></code></code> is <code>false</code>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject②">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror②">TypeError</a></code> and abort these steps.</p> <div class="note" role="note"> Note: This enforces that exactly one of <code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters⑦">filters</a></code> or <code><code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices⑧">acceptAllDevices</a></code>:true</code> is present. </div> <li data-md> <p><a data-link-type="dfn" href="#request-bluetooth-devices" id="ref-for-request-bluetooth-devices">Request Bluetooth devices</a>, passing <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-filters" id="ref-for-dom-requestdeviceoptions-filters⑧">filters</a></code></code> if <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-acceptalldevices" id="ref-for-dom-requestdeviceoptions-acceptalldevices⑨">acceptAllDevices</a></code></code> is <code>false</code> or <code>null</code> otherwise, passing <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-exclusionfilters" id="ref-for-dom-requestdeviceoptions-exclusionfilters⑥">exclusionFilters</a></code></code> if it exists or <code>null</code> otherwise, passing <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-optionalservices" id="ref-for-dom-requestdeviceoptions-optionalservices③">optionalServices</a></code></code>, and passing <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-requestdeviceoptions-optionalmanufacturerdata" id="ref-for-dom-requestdeviceoptions-optionalmanufacturerdata①">optionalManufacturerData</a></code></code>, and let <var>devices</var> be the result.</p> <li data-md> <p>If the previous step threw an exception, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject③">reject</a> <var>promise</var> with that exception and abort these steps.</p> <li data-md> <p>If <var>devices</var> is an empty sequence, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject④">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#notfounderror" id="ref-for-notfounderror">NotFoundError</a></code> and abort these steps.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve①">Resolve</a> <var>promise</var> with <code><var>devices</var>[0]</code>.</p> </ol> </div> <div class="algorithm" data-algorithm="requesting a Bluetooth device"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="request-bluetooth-devices">request Bluetooth devices</dfn>, given a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissionstorage" id="ref-for-dictdef-bluetoothpermissionstorage①">BluetoothPermissionStorage</a></code> <var>storage</var> and a sequence of <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit②">BluetoothLEScanFilterInit</a></code>s <var>filters</var>, which can be <code>null</code> to represent that all devices can match, a sequence of <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit③">BluetoothLEScanFilterInit</a></code>s <var>exclusionFilters</var>, which can be <code>null</code> if no exclusion filters have been set, a sequence of <code class="idl"><a data-link-type="idl" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid③">BluetoothServiceUUID</a></code>s <var>optionalServices</var>, and a sequence of <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-unsigned-short" id="ref-for-idl-unsigned-short②">unsigned short</a></code>s <var>optionalManufacturerData</var>, the UA MUST run the following steps: <div class="note" role="note"> Note: These steps can block, so uses of this algorithm must be <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②">in parallel</a>. </div> <div class="note" role="note"> Note: Calls to this algorithm will eventually be able to request multiple devices, but for now it only ever returns a single one. </div> <ol> <li data-md> <p>Let <var>global</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global" id="ref-for-concept-relevant-global①">relevant global object</a> for <var>storage</var>.</p> <li data-md> <p>Let <var>document</var> be <var>global</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-document-window" id="ref-for-concept-document-window①">associated Document</a>.</p> <li data-md> <p>If <var>document</var> is not <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/iframe-embed-object.html#allowed-to-use" id="ref-for-allowed-to-use①">allowed to use</a> the <a data-link-type="dfn" href="https://w3c.github.io/webappsec-permissions-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature①">policy-controlled feature</a> named "<a data-link-type="dfn" href="#policy-controlled-feature-bluetooth" id="ref-for-policy-controlled-feature-bluetooth①">bluetooth</a>", throw a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror①">SecurityError</a></code> and abort these steps.</p> <li data-md> <p id="requestDevice-user-gesture">Check that the algorithm is triggered while its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global" id="ref-for-concept-relevant-global②">relevant global object</a> has a <a href="https://html.spec.whatwg.org/#tracking-user-activation"> transient activation</a>, otherwise throw a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror②">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>In order to convert the arguments from service names and aliases to just <a data-link-type="dfn" href="#uuid" id="ref-for-uuid">UUID</a>s, do the following sub-steps:</p> <ol> <li data-md> <p>If <code><var>filters</var> !== null &amp;&amp; <var>filters</var>.length === 0</code>, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror③">TypeError</a></code> and abort these steps.</p> <li data-md> <p>If <code><var>exclusionFilters</var> !== null &amp;&amp; <var>exclusionFilters</var>.length === 0</code>, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror④">TypeError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>uuidFilters</var> be a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array-objects" id="ref-for-sec-array-objects①">Array</a></code>, <var>uuidExclusionFilters</var> be a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array-objects" id="ref-for-sec-array-objects②">Array</a></code>, and <var>requiredServiceUUIDs</var> be a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-set-objects" id="ref-for-sec-set-objects">Set</a></code>.</p> <li data-md> <p>If <var>filters</var> is <code>null</code>, then set <var>requiredServiceUUIDs</var> to the set of all UUIDs.</p> <li data-md> <p>If <var>filters</var> isn’t <code>null</code>, then for each <var>filter</var> in <var>filters</var>, do the following steps:</p> <ol> <li data-md> <p>Let <var>canonicalFilter</var> be the result of <a data-link-type="dfn" href="#bluetoothlescanfilterinit-canonicalizing" id="ref-for-bluetoothlescanfilterinit-canonicalizing">canonicalizing</a> <var>filter</var>.</p> <li data-md> <p>Append <var>canonicalFilter</var> to <var>uuidFilters</var>.</p> <li data-md> <p>Add the contents of <code><var>canonicalFilter</var>.services</code> to <var>requiredServiceUUIDs</var>.</p> </ol> <li data-md> <p>If <var>exclusionFilters</var> isn’t <code>null</code>, then for each <var>exclusionFilter</var> in <var>exclusionFilters</var>, do the following steps:</p> <ol> <li data-md> <p>Let <var>canonicalExclusionFilter</var> be the result of <a data-link-type="dfn" href="#bluetoothlescanfilterinit-canonicalizing" id="ref-for-bluetoothlescanfilterinit-canonicalizing①">canonicalizing</a> <var>exclusionFilter</var>.</p> <li data-md> <p>Append <var>canonicalExclusionFilter</var> to <var>uuidExclusionFilters</var>.</p> </ol> <li data-md> <p>Let <var>optionalServiceUUIDs</var> be <code><code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array.prototype.map" id="ref-for-sec-array.prototype.map">Array.prototype.map</a></code>.call(<var>optionalServices</var>, <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice">BluetoothUUID.getService</a></code>)</code>.</p> <li data-md> <p>If any of the <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①">BluetoothUUID.getService()</a></code> calls threw an exception, throw that exception and abort these steps.</p> <li data-md> <p>Remove from <var>optionalServiceUUIDs</var> any UUIDs that are <a data-link-type="dfn" href="#blocklisted" id="ref-for-blocklisted">blocklisted</a>.</p> </ol> <li data-md> <p>Let <var>descriptor</var> be</p> <pre class="highlight"><c- p>{</c-> name<c- o>:</c-> <c- u>"bluetooth"</c-><c- p>,</c-> filters<c- o>:</c-> <var>uuidFilters</var> optionalServices<c- o>:</c-> <var>optionalServiceUUIDs</var><c- p>,</c-> optionalManufacturerData<c- o>:</c-> <var>optionalManufacturerData</var> acceptAllDevices<c- o>:</c-> <var>filters</var> <c- o>!==</c-> <c- kc>null</c-><c- p>,</c-> <c- p>}</c-> </pre> <li data-md> <p>Let <var>state</var> be <var>descriptor</var>’s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-permission-state" id="ref-for-dfn-permission-state">permission state</a>.</p> <div class="note" role="note"> Note: <var>state</var> will be "<code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied">denied</a></code>" in <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#non-secure-context" id="ref-for-non-secure-context">non-secure contexts</a> because powerful features can’t be used in <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#non-secure-context" id="ref-for-non-secure-context①">non-secure contexts</a>. </div> <li data-md> <p>If <var>state</var> is "<code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied①">denied</a></code>", return <code>[]</code> and abort these steps.</p> <li data-md> <p>If the UA can prove that no devices could possibly be found in the next step, for example because there is no Bluetooth adapter with which to scan, or because the filters can’t be matched by any possible advertising packet, the UA MAY return <code>[]</code> and abort these steps.</p> <li data-md> <p>Let <var>scanResult</var> be the result of invoking <a data-link-type="dfn" href="#scan-for-devices" id="ref-for-scan-for-devices">scan for devices</a> with <var>global</var> and <var>requiredServiceUUIDs</var>.</p> <li data-md> <p>If <var>filters</var> isn’t <code>null</code>, do the following sub-steps:</p> <ol> <li data-md> <p>Remove devices from <var>scanResult</var> if they do not <a data-link-type="dfn" href="#matches-a-filter" id="ref-for-matches-a-filter③">match a filter</a> in <var>uuidFilters</var>.</p> <li data-md> <p>If <var>exclusionFilters</var> isn’t <code>null</code>, remove devices from <var>scanResult</var> if they <a data-link-type="dfn" href="#matches-a-filter" id="ref-for-matches-a-filter④">match a filter</a> in <var>uuidExclusionFilters</var>.</p> </ol> <li data-md> <p>Let <var>navigable</var> be <var>document</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#navigable" id="ref-for-navigable">navigable</a>.</p> <li data-md> <p>Let <var>promptId</var> be a new unique opaque string.</p> </ol> <p class="issue" id="issue-65779758"><a class="self-link" href="#issue-65779758"></a> In practice, the device list is dynamically updated while a prompt is open. The spec text currently does not reflect that but this event might be emitted multiple times with the same <code>promptId</code> and the fresh device list. See https://github.com/WebBluetoothCG/web-bluetooth/issues/621.</p> <ol> <li data-md> <p><a data-link-type="dfn" href="#trigger-a-prompt-updated-event" id="ref-for-trigger-a-prompt-updated-event">Trigger a prompt updated event</a> given <var>navigable</var>, <var>promptId</var>, and <var>scanResult</var>.</p> <li data-md> <p id="requestDevice-prompt">Even if <var>scanResult</var> is empty, <a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-prompt-the-user-to-choose" id="ref-for-dfn-prompt-the-user-to-choose">prompt the user to choose</a> one of the devices in <var>scanResult</var>, associated with <var>descriptor</var>, and let <var>device</var> be the result. </p> <p>The UA MAY allow the user to select a nearby device that does not match <var>uuidFilters</var>.</p> <div class="note" role="note"> Note: The UA should show the user the human-readable name of each device. If this name is not available because, for example, the UA’s Bluetooth system doesn’t support privacy-enabled scans, the UA should allow the user to indicate interest and then perform a privacy-disabled scan to retrieve the name. </div> <li data-md> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-remove" id="ref-for-map-remove">Remove</a> <a data-link-type="dfn" href="#map-of-navigables-to-device-prompts" id="ref-for-map-of-navigables-to-device-prompts">map of navigables to device prompts</a>[<var>navigable</var>’s <a data-link-type="dfn" href="https://w3c.github.io/webdriver-bidi/#navigable-id" id="ref-for-navigable-id">navigable id</a>].</p> <li data-md> <p>The UA MAY <a data-link-type="dfn" href="#add-device-to-storage" id="ref-for-add-device-to-storage">add <var>device</var> to <var>storage</var></a>.</p> <div class="note" role="note"> Note: Choosing a <var>device</var> probably indicates that the user intends that device to appear in the <code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissionstorage-alloweddevices" id="ref-for-dom-bluetoothpermissionstorage-alloweddevices①">allowedDevices</a></code> list of <a class="idl-code" data-link-type="permission" href="#permissiondef-bluetooth" id="ref-for-permissiondef-bluetooth">"bluetooth"</a>’s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-extra-permission-data" id="ref-for-dfn-extra-permission-data">extra permission data</a> for at least the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object">current settings object</a>, for its <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-mayusegatt" id="ref-for-dom-allowedbluetoothdevice-mayusegatt">mayUseGATT</a></code> field to be <code>true</code>, for all the services in the union of <var>requiredServiceUUIDs</var> and <var>optionalServiceUUIDs</var> to appear in its <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices">allowedServices</a></code> list, in addition to any services that were already there, and for the manufacturer codes in <var>optionalManufacturerData</var> to appear in its <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedmanufacturerdata" id="ref-for-dom-allowedbluetoothdevice-allowedmanufacturerdata">allowedManufacturerData</a></code> list. </div> <li data-md> <p>If <var>device</var> is "<code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied②">denied</a></code>", return <code>[]</code> and abort these steps.</p> <li data-md> <p>The UA MAY <a data-link-type="dfn" href="#populate-the-bluetooth-cache" id="ref-for-populate-the-bluetooth-cache">populate the Bluetooth cache</a> with all Services inside <var>device</var>. Ignore any errors from this step.</p> <li data-md> <p><a data-link-type="dfn" href="#get-the-bluetoothdevice-representing" id="ref-for-get-the-bluetoothdevice-representing①">Get the <code>BluetoothDevice</code> representing</a> <var>device</var> inside <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this①">this</a>, propagating any exception, and let <var>deviceObj</var> be the result.</p> <li data-md> <p>Return <code>[<var>deviceObj</var>]</code>.</p> </ol> </div> <div class="algorithm" data-algorithm="canonicalizing an LE scan filter"> The result of <dfn class="dfn-paneled" data-dfn-for="BluetoothLEScanFilterInit" data-dfn-type="dfn" data-export id="bluetoothlescanfilterinit-canonicalizing">canonicalizing</dfn> the <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit④">BluetoothLEScanFilterInit</a></code> <var>filter</var>, is the <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit⑤">BluetoothLEScanFilterInit</a></code> returned from the following steps: <ol> <li data-md> <p>If none of <var>filter</var>’s members is present, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror⑤">TypeError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>canonicalizedFilter</var> be <code>{}</code>.</p> <li data-md> <p>If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-services" id="ref-for-dom-bluetoothlescanfilterinit-services③">services</a></code></code> is present, do the following sub-steps:</p> <ol> <li data-md> <p>If <code><var>filter</var>.services.length === 0</code>, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror⑥">TypeError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>services</var> be <code><code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array.prototype.map" id="ref-for-sec-array.prototype.map①">Array.prototype.map</a></code>.call(<var>filter</var>.services, <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice②">BluetoothUUID.getService</a></code>)</code>.</p> <li data-md> <p>If any of the <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice③">BluetoothUUID.getService()</a></code> calls threw an exception, throw that exception and abort these steps.</p> <li data-md> <p>If any service in <var>services</var> is <a data-link-type="dfn" href="#blocklisted" id="ref-for-blocklisted①">blocklisted</a>, throw a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror③">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>Set <code><var>canonicalizedFilter</var>.services</code> to <var>services</var>.</p> </ol> <li data-md> <p>If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-name" id="ref-for-dom-bluetoothlescanfilterinit-name②">name</a></code></code> is present, do the following sub-steps.</p> <ol> <li data-md> <p>If the <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-encode" id="ref-for-utf-8-encode">UTF-8 encoding</a> of <code><var>filter</var>.name</code> is more than 248 bytes long, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror⑦">TypeError</a></code> and abort these steps.</p> <div class="note" role="note"> Note: 248 is the maximum number of UTF-8 code units in a <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name③">Bluetooth Device Name</a>. </div> <li data-md> <p>Set <code><var>canonicalizedFilter</var>.name</code> to <code><var>filter</var>.name</code>.</p> </ol> <li data-md> <p>If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-nameprefix" id="ref-for-dom-bluetoothlescanfilterinit-nameprefix②">namePrefix</a></code></code> is present, do the following sub-steps.</p> <ol> <li data-md> <p>If <code><var>filter</var>.namePrefix.length === 0</code> or if the <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-encode" id="ref-for-utf-8-encode①">UTF-8 encoding</a> of <code><var>filter</var>.namePrefix</code> is more than 248 bytes long, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror⑧">TypeError</a></code> and abort these steps.</p> <div class="note" role="note"> Note: 248 is the maximum number of UTF-8 code units in a <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name④">Bluetooth Device Name</a>. </div> <li data-md> <p>Set <code><var>canonicalizedFilter</var>.namePrefix</code> to <code><var>filter</var>.namePrefix</code>.</p> </ol> <li data-md> <p>Set <code><var>canonicalizedFilter</var>["manufacturerData"]</code> to <code>[]</code>.</p> <li data-md> <p>If <code><var>filter</var>["<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-manufacturerdata" id="ref-for-dom-bluetoothlescanfilterinit-manufacturerdata③">manufacturerData</a></code>"]</code> is present and <code><var>filter</var>["manufacturerData"].length === 0</code>, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror⑨">TypeError</a></code> and abort these steps.</p> <li data-md> <p>For each <var>manufacturerData</var> in <code><var>filter</var>["<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-manufacturerdata" id="ref-for-dom-bluetoothlescanfilterinit-manufacturerdata④">manufacturerData</a></code>"]</code>, do the following sub-steps:</p> <ol> <li data-md> <p>If <var>manufacturerData</var> is a <a data-link-type="dfn" href="#blocklisted-manufacturer-data-filter" id="ref-for-blocklisted-manufacturer-data-filter">blocklisted manufacturer data filter</a>, throw a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror④">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>If there exists an object <var>existing</var> in <code><var>canonicalizedFilter</var>["manufacturerData"]</code> where <code><var>existing</var>["companyIdentifier"] === <var>manufacturerData</var>["<code class="idl"><a data-link-type="idl" href="#dom-bluetoothmanufacturerdatafilterinit-companyidentifier" id="ref-for-dom-bluetoothmanufacturerdatafilterinit-companyidentifier①">companyIdentifier</a></code>"]</code>, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①⓪">TypeError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>canonicalizedManufacturerDataFilter</var> be the result of <a data-link-type="dfn" href="#bluetoothdatafilterinit-canonicalizing" id="ref-for-bluetoothdatafilterinit-canonicalizing①">canonicalizing</a> <var>manufacturerData</var>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#dfn-convert-idl-to-javascript-value" id="ref-for-dfn-convert-idl-to-javascript-value">converted to an ECMAScript value</a>. If this throws an exception, propagate that exception and abort these steps.</p> <li data-md> <p>Set <code><var>canonicalizedManufacturerDataFilter</var>["companyIdentifier"]</code> to <code><var>manufacturerData</var>["<code class="idl"><a data-link-type="idl" href="#dom-bluetoothmanufacturerdatafilterinit-companyidentifier" id="ref-for-dom-bluetoothmanufacturerdatafilterinit-companyidentifier②">companyIdentifier</a></code>"]</code>.</p> <li data-md> <p>Append <var>canonicalizedManufacturerDataFilter</var> to <code><var>canonicalizedFilter</var>["manufacturerData"]</code>.</p> </ol> <li data-md> <p>Set <code><var>canonicalizedFilter</var>.serviceData</code> to <code>[]</code>.</p> <li data-md> <p>If <code><var>filter</var>["<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-servicedata" id="ref-for-dom-bluetoothlescanfilterinit-servicedata③">serviceData</a></code>"]</code> is present and <code><var>filter</var>["serviceData"].length === 0</code>, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①①">TypeError</a></code> and abort these steps.</p> <li data-md> <p>For each <var>serviceData</var> in <code><var>filter</var>["<code class="idl"><a data-link-type="idl" href="#dom-bluetoothlescanfilterinit-servicedata" id="ref-for-dom-bluetoothlescanfilterinit-servicedata④">serviceData</a></code>"]</code>, do the following sub-steps:</p> <ol> <li data-md> <p>Let <var>service</var> be <code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice④">BluetoothUUID.getService</a></code>(<var>serviceData</var>["<code class="idl"><a data-link-type="idl" href="#dom-bluetoothservicedatafilterinit-service" id="ref-for-dom-bluetoothservicedatafilterinit-service①">service</a></code>"])</code>. If this throws an exception, propagate that exception and abort these steps.</p> <li data-md> <p>If <var>service</var> is <a data-link-type="dfn" href="#blocklisted" id="ref-for-blocklisted②">blocklisted</a>, throw a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror⑤">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>canonicalizedServiceDataFilter</var> be the result of <a data-link-type="dfn" href="#bluetoothdatafilterinit-canonicalizing" id="ref-for-bluetoothdatafilterinit-canonicalizing②">canonicalizing</a> <var>serviceData</var>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#dfn-convert-idl-to-javascript-value" id="ref-for-dfn-convert-idl-to-javascript-value①">converted to an ECMAScript value</a>. If this throws an exception, propagate that exception and abort these steps.</p> <li data-md> <p>Set <code><var>canonicalizedServiceDataFilter</var>["service"]</code> to <var>service</var>.</p> <li data-md> <p>Append <var>canonicalizedServiceDataFilter</var> to <code><var>canonicalizedFilter</var>["serviceData"]</code>.</p> </ol> <li data-md> <p>Return <var>canonicalizedFilter</var>.</p> </ol> </div> <div class="algorithm" data-algorithm="canonicalizing a data filter"> The result of <dfn class="dfn-paneled" data-dfn-for="BluetoothDataFilterInit" data-dfn-type="dfn" data-export id="bluetoothdatafilterinit-canonicalizing">canonicalizing</dfn> the <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit⑥">BluetoothDataFilterInit</a></code> <var>filter</var>, is the <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit⑦">BluetoothDataFilterInit</a></code> returned from the following steps: <ol> <li data-md> <p>If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-dataprefix" id="ref-for-dom-bluetoothdatafilterinit-dataprefix④">dataPrefix</a></code></code> is not present, let <var>dataPrefix</var> be an empty sequence of bytes. Otherwise, do the following sub-steps:</p> <ol> <li data-md> <p>Let <var>dataPrefix</var> be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy②">a copy of the bytes held</a> by <code><var>filter</var>.dataPrefix</code>.</p> <li data-md> <p>If the length of <var>dataPrefix</var> is zero, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①②">TypeError</a></code> and abort these steps.</p> </ol> <li data-md> <p>If <code><var>filter</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask⑧">mask</a></code></code> is present, let <var>mask</var> be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy③">a copy of the bytes held</a> by <code><var>filter</var>.mask</code>. Otherwise, let <var>mask</var> be a sequence of <code>0xFF</code> bytes the same length as <var>dataPrefix</var>.</p> <li data-md> <p>If <var>mask</var> is not the same length as <var>dataPrefix</var>, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①③">TypeError</a></code> and abort these steps.</p> <li data-md> <p>Return <code>{dataPrefix: new Uint8Array(|dataPrefix|), mask: new Uint8Array(|mask|)}</code>.</p> </ol> </div> <div class="algorithm" data-algorithm="scanning for Bluetooth devices"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="scan-for-devices">scan for devices</dfn> with parameters <var>global</var> and an optional <var>set of <a data-link-type="dfn" href="#service" id="ref-for-service①">Service</a> UUIDs</var>, defaulting to the set of all UUIDs, the UA MUST perform the following steps: <ol> <li data-md> <p>If the UA has scanned for devices recently with a set of UUIDs that was a superset of the UUIDs for the current scan, then the UA MAY return the result of that scan and abort these steps.</p> <p class="issue" id="issue-2f91a41d"><a class="self-link" href="#issue-2f91a41d"></a> TODO: Nail down the amount of time.</p> <li data-md> <p>Let <var>nearbyDevices</var> be a set of <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device④">Bluetooth device</a>s, initially equal to the set of devices that are connected (have an <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer">ATT Bearer</a>) to the UA.</p> <li data-md> <p>Let <var>topLevelTraversable</var> be the <var>global</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#window-navigable" id="ref-for-window-navigable">navigable</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#nav-top" id="ref-for-nav-top">top-level traversable</a>.</p> <li data-md> <p>Let <var>simulatedBluetoothDevices</var> be an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list">list</a>.</p> <li data-md> <p>If <var>topLevelTraversable</var> has a <a data-link-type="dfn" href="#simulated-bluetooth-adapter" id="ref-for-simulated-bluetooth-adapter">simulated Bluetooth adapter</a>, let <var>simulatedBluetoothDevices</var> be the result of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-getting-the-values" id="ref-for-map-getting-the-values">getting the values</a> of its <a data-link-type="dfn" href="#simulated-bluetooth-device-mapping" id="ref-for-simulated-bluetooth-device-mapping">simulated Bluetooth device mapping</a>.</p> <p class="issue" id="issue-a6bf84e6"><a class="self-link" href="#issue-a6bf84e6"></a> Support asynchronous device discovery.</p> <li data-md> <p>If the UA supports the LE transport, perform the <a data-link-type="dfn" href="#general-discovery-procedure" id="ref-for-general-discovery-procedure">General Discovery Procedure</a>, except that the UA may include devices that have no <a data-link-type="dfn" href="#discoverable-mode" id="ref-for-discoverable-mode">Discoverable Mode</a> flag set, and add the discovered <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device⑤">Bluetooth device</a>s to <var>nearbyDevices</var>. The UA SHOULD enable the <a data-link-type="dfn" href="#privacy-feature" id="ref-for-privacy-feature③">Privacy Feature</a>.</p> <p class="issue" id="issue-b71bd84d"><a class="self-link" href="#issue-b71bd84d"></a> Both <a data-link-type="dfn" href="#passive-scanning" id="ref-for-passive-scanning">passive scanning</a> and the <a data-link-type="dfn" href="#privacy-feature" id="ref-for-privacy-feature④">Privacy Feature</a> avoid leaking the unique, immutable device ID. We ought to require UAs to use either one, but none of the OS APIs appear to expose either. Bluetooth also makes it hard to use <a data-link-type="dfn" href="#passive-scanning" id="ref-for-passive-scanning①">passive scanning</a> since it doesn’t require <a data-link-type="dfn" href="#central" id="ref-for-central③">Central</a> devices to support the <a data-link-type="dfn" href="#observation-procedure" id="ref-for-observation-procedure">Observation Procedure</a>.</p> <li data-md> <p>If the UA supports the BR/EDR transport, perform the <a data-link-type="dfn" href="#device-discovery-procedure" id="ref-for-device-discovery-procedure">Device Discovery Procedure</a> and add the discovered <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device⑥">Bluetooth device</a>s to <var>nearbyDevices</var>.</p> <p class="issue" id="issue-9bb159fd"><a class="self-link" href="#issue-9bb159fd"></a> All forms of BR/EDR inquiry/discovery appear to leak the unique, immutable device address.</p> <li data-md> <p>Let <var>result</var> be a set of <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device⑦">Bluetooth device</a>s, initially empty.</p> <li data-md> <p>For each <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device⑧">Bluetooth device</a> <var>device</var> in <var>nearbyDevices</var> and <var>simulatedBluetoothDevices</var>, do the following sub-steps:</p> <ol> <li data-md> <p>If <var>device</var>’s <a data-link-type="dfn" href="#supported-physical-transports" id="ref-for-supported-physical-transports">supported physical transports</a> include LE and its <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name⑤">Bluetooth Device Name</a> is partial or absent, the UA SHOULD perform the <a data-link-type="dfn" href="#name-discovery-procedure" id="ref-for-name-discovery-procedure">Name Discovery Procedure</a> to acquire a complete name.</p> <li data-md> <p>If <var>device</var>’s advertised <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type">Service UUIDs</a> have a non-empty intersection with the <var>set of <a data-link-type="dfn" href="#service" id="ref-for-service②">Service</a> UUIDs</var>, add <var>device</var> to <var>result</var> and abort these sub-steps.</p> <div class="note" role="note"> Note: For BR/EDR devices, there is no way to distinguish GATT from non-GATT services in the <a data-link-type="dfn" href="#extended-inquiry-response" id="ref-for-extended-inquiry-response①">Extended Inquiry Response</a>. If a site filters to the UUID of a non-GATT service, the user may be able to select a device for the result of <code>requestDevice</code> that this API provides no way to interact with. </div> <li data-md> <p>The UA MAY connect to <var>device</var> and <a data-link-type="dfn" href="#populate-the-bluetooth-cache" id="ref-for-populate-the-bluetooth-cache①">populate the Bluetooth cache</a> with all Services whose UUIDs are in the <var>set of <a data-link-type="dfn" href="#service" id="ref-for-service③">Service</a> UUIDs</var>. If <var>device</var>’s <a data-link-type="dfn" href="#supported-physical-transports" id="ref-for-supported-physical-transports①">supported physical transports</a> include BR/EDR, then in addition to the standard GATT procedures, the UA MAY use the Service Discovery Protocol (<a data-link-type="dfn" href="#searching-for-services" id="ref-for-searching-for-services">Searching for Services</a>) when populating the cache.</p> <div class="note" id="note-extra-discovery" role="note"> <a class="self-link" href="#note-extra-discovery"></a> Note: Connecting to every nearby device to discover services costs power and can slow down other use of the Bluetooth radio. UAs should only discover extra services on a device if they have some reason to expect that device to be interesting. <p>UAs should also help developers avoid relying on this extra discovery behavior. For example, say a developer has previously connected to a device, so the UA knows the device’s full set of supported services. If this developer then filters using a non-advertised UUID, the dialog they see may include this device, even if the filter would likely exclude the device on users' machines. The UA could provide a developer option to warn when this happens or to include only advertised services in matching filters.</p> </div> <li data-md> <p>If the <a data-link-type="dfn" href="#bluetooth-cache-bluetooth-cache" id="ref-for-bluetooth-cache-bluetooth-cache①">Bluetooth cache</a> contains known-present Services inside <var>device</var> with UUIDs in the <var>set of <a data-link-type="dfn" href="#service" id="ref-for-service④">Service</a> UUIDs</var>, the UA MAY add <var>device</var> to <var>result</var>.</p> </ol> <li data-md> <p>Return <var>result</var> from the scan.</p> </ol> </div> <p class="issue" id="issue-ad5723d8"><a class="self-link" href="#issue-ad5723d8"></a> We need a way for a site to register to receive an event when an interesting device comes within range.</p> <div class="algorithm" data-algorithm="add Bluetooth device to storage"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="add device to storage" data-noexport id="add-device-to-storage">add an allowed <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device⑨">Bluetooth device</a></dfn> <var>device</var> to <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissionstorage" id="ref-for-dictdef-bluetoothpermissionstorage②">BluetoothPermissionStorage</a></code> <var>storage</var> given a set of <var>requiredServiceUUIDs</var> and a set of <var>optionalServiceUUIDs</var>, the UA MUST run the following steps: <ol> <li data-md> <p>Let <var>grantedServiceUUIDs</var> be a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-set-objects" id="ref-for-sec-set-objects①">Set</a></code>.</p> <li data-md> <p>Add the contents of <var>requiredServiceUUIDs</var> to <var>grantedServiceUUIDs</var>.</p> <li data-md> <p>Add the contents of <var>optionalServiceUUIDs</var> to <var>grantedServiceUUIDs</var>.</p> <li data-md> <p>Search for an element <var>allowedDevice</var> in <code><var>storage</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissionstorage-alloweddevices" id="ref-for-dom-bluetoothpermissionstorage-alloweddevices②">allowedDevices</a></code></code> where <var>device</var> is equal to <code><var>allowedDevice</var>@<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot①">[[device]]</a></code></code>. If one is found, perform the following sub-steps:</p> <ol> <li data-md> <p>Add the contents of <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices①">allowedServices</a></code></code> to <var>grantedServiceUUIDs</var>.</p> </ol> <p>If one is not found, perform the following sub-steps:</p> <ol> <li data-md> <p>Let <var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-deviceid" id="ref-for-dom-allowedbluetoothdevice-deviceid">deviceId</a></code> be a unique ID to the extent that the UA can determine that two Bluetooth connections are the same device and to the extent that the <a href="#note-device-id-tracking">user wants to expose that fact to script</a>.</p> </ol> <li data-md> <p>Set <var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices②">allowedServices</a></code> to <var>grantedServiceUUIDs</var>.</p> <li data-md> <p>Set <var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-mayusegatt" id="ref-for-dom-allowedbluetoothdevice-mayusegatt①">mayUseGATT</a></code> to <code>true</code>.</p> </ol> </div> <div class="unstable"> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="remove device from storage" data-noexport id="remove-device-from-storage">remove an allowed <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①⓪">Bluetooth device</a></dfn> <var>device</var>, given a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissionstorage" id="ref-for-dictdef-bluetoothpermissionstorage③">BluetoothPermissionStorage</a></code> <var>storage</var>, the UA MUST run the following steps:</p> <ol> <li data-md> <p>Search for an element <var>allowedDevice</var> in <code><var>storage</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissionstorage-alloweddevices" id="ref-for-dom-bluetoothpermissionstorage-alloweddevices③">allowedDevices</a></code></code> where <var>device</var> is equal to <code><var>allowedDevice</var>@<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot②">[[device]]</a></code></code>. If no such element exists, abort these steps.</p> <li data-md> <p>Remove <var>allowedDevice</var> from <code><var>storage</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissionstorage-alloweddevices" id="ref-for-dom-bluetoothpermissionstorage-alloweddevices④">allowedDevices</a></code></code>.</p> </ol> </div> <div class="unstable"> <h3 class="heading settled" data-level="4.1" id="permission-api-integration"><span class="secno">4.1. </span><span class="content">Permission API Integration</span><a class="self-link" href="#permission-api-integration"></a></h3> <p>The <a data-link-type="biblio" href="#biblio-permissions" title="Permissions">[permissions]</a> API provides a uniform way for websites to query which permissions they have.</p> <div class="example" id="example-permission-api-query"> <a class="self-link" href="#example-permission-api-query"></a> Once a site has been granted access to a set of devices, it can use <code class="highlight">navigator<c- p>.</c->permissions<c- p>.</c-><code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissions-query" id="ref-for-dom-permissions-query">query</a></code><c- p>({</c-><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name">name</a><c- o>:</c-> <c- u>"bluetooth"</c-><c- p>,</c-> <c- p>...})</c-></code> to retrieve those devices after a reload. <pre class="highlight">navigator<c- p>.</c->permissions<c- p>.</c-><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissions-query" id="ref-for-dom-permissions-query①">query</a><c- p>({</c-> name<c- o>:</c-> <c- u>"bluetooth"</c-><c- p>,</c-> deviceId<c- o>:</c-> sessionStorage<c- p>.</c->lastDevice<c- p>,</c-> <c- p>}).</c->then<c- p>(</c->result <c- p>=></c-> <c- p>{</c-> <c- k>if</c-> <c- p>(</c->result<c- p>.</c-><a data-link-type="idl" href="#dom-bluetoothpermissionresult-devices" id="ref-for-dom-bluetoothpermissionresult-devices">devices</a><c- p>.</c->length <c- o>==</c-> <c- mf>1</c-><c- p>)</c-> <c- p>{</c-> <c- k>return</c-> result<c- p>.</c->devices<c- p>[</c-><c- mf>0</c-><c- p>];</c-> <c- p>}</c-> <c- k>else</c-> <c- p>{</c-> <c- k>throw</c-> <c- ow>new</c-> <a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-DOMException" id="ref-for-idl-DOMException">DOMException</a><c- p>(</c-><c- u>"Lost permission"</c-><c- p>,</c-> <c- u>"NotFoundError"</c-><c- p>);</c-> <c- p>}</c-> <c- p>}).</c->then<c- p>(...);</c-> </pre> </div> <p>The Web Bluetooth API is a <a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-powerful-feature" id="ref-for-dfn-powerful-feature">powerful feature</a> that is identified by the <a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-name" id="ref-for-dfn-name">name</a> <dfn class="dfn-paneled idl-code" data-dfn-type="permission" data-export id="permissiondef-bluetooth"><code>"bluetooth"</code></dfn>. Its permission-related algorithms and types are defined as follows:</p> <dl> <dt><a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-permission-descriptor-type" id="ref-for-dfn-permission-descriptor-type">permission descriptor type</a> <dd> <pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-bluetoothpermissiondescriptor"><code><c- g>BluetoothPermissionDescriptor</c-></code></dfn> : <a data-link-type="idl-name" href="https://w3c.github.io/permissions/#dom-permissiondescriptor" id="ref-for-dom-permissiondescriptor"><c- n>PermissionDescriptor</c-></a> { <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString②"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothPermissionDescriptor" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-bluetoothpermissiondescriptor-deviceid"><code><c- g>deviceId</c-></code><a class="self-link" href="#dom-bluetoothpermissiondescriptor-deviceid"></a></dfn>; // These match RequestDeviceOptions. <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence⑧"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit⑥"><c- n>BluetoothLEScanFilterInit</c-></a>> <dfn class="idl-code" data-dfn-for="BluetoothPermissionDescriptor" data-dfn-type="dict-member" data-export data-type="sequence<BluetoothLEScanFilterInit> " id="dom-bluetoothpermissiondescriptor-filters"><code><c- g>filters</c-></code><a class="self-link" href="#dom-bluetoothpermissiondescriptor-filters"></a></dfn>; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence⑨"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid④"><c- n>BluetoothServiceUUID</c-></a>> <dfn class="idl-code" data-default="[]" data-dfn-for="BluetoothPermissionDescriptor" data-dfn-type="dict-member" data-export data-type="sequence<BluetoothServiceUUID> " id="dom-bluetoothpermissiondescriptor-optionalservices"><code><c- g>optionalServices</c-></code><a class="self-link" href="#dom-bluetoothpermissiondescriptor-optionalservices"></a></dfn> = []; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence①⓪"><c- b>sequence</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short" id="ref-for-idl-unsigned-short③"><c- b>unsigned</c-> <c- b>short</c-></a>> <dfn class="idl-code" data-default="[]" data-dfn-for="BluetoothPermissionDescriptor" data-dfn-type="dict-member" data-export data-type="sequence<unsigned short> " id="dom-bluetoothpermissiondescriptor-optionalmanufacturerdata"><code><c- g>optionalManufacturerData</c-></code><a class="self-link" href="#dom-bluetoothpermissiondescriptor-optionalmanufacturerdata"></a></dfn> = []; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean②"><c- b>boolean</c-></a> <dfn class="idl-code" data-default="false" data-dfn-for="BluetoothPermissionDescriptor" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-bluetoothpermissiondescriptor-acceptalldevices"><code><c- g>acceptAllDevices</c-></code><a class="self-link" href="#dom-bluetoothpermissiondescriptor-acceptalldevices"></a></dfn> = <c- b>false</c->; }; </pre> <dt><a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-extra-permission-data-type" id="ref-for-dfn-extra-permission-data-type">extra permission data type</a> <dd> <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissionstorage" id="ref-for-dictdef-bluetoothpermissionstorage④">BluetoothPermissionStorage</a></code>, defined as: <pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-allowedbluetoothdevice"><code><c- g>AllowedBluetoothDevice</c-></code></dfn> { <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString③"><c- b>DOMString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="AllowedBluetoothDevice" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-allowedbluetoothdevice-deviceid"><code><c- g>deviceId</c-></code></dfn>; <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean③"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="AllowedBluetoothDevice" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-allowedbluetoothdevice-mayusegatt"><code><c- g>mayUseGATT</c-></code></dfn>; // An allowedServices of "all" means all services are allowed. <c- b>required</c-> (<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString④"><c- b>DOMString</c-></a> <c- b>or</c-> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence①①"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid"><c- n>UUID</c-></a>>) <dfn class="dfn-paneled idl-code" data-dfn-for="AllowedBluetoothDevice" data-dfn-type="dict-member" data-export data-type="(DOMString or sequence<UUID>) " id="dom-allowedbluetoothdevice-allowedservices"><code><c- g>allowedServices</c-></code></dfn>; <c- b>required</c-> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence①②"><c- b>sequence</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short" id="ref-for-idl-unsigned-short④"><c- b>unsigned</c-> <c- b>short</c-></a>> <dfn class="dfn-paneled idl-code" data-dfn-for="AllowedBluetoothDevice" data-dfn-type="dict-member" data-export data-type="sequence<unsigned short> " id="dom-allowedbluetoothdevice-allowedmanufacturerdata"><code><c- g>allowedManufacturerData</c-></code></dfn>; }; <c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-bluetoothpermissionstorage"><code><c- g>BluetoothPermissionStorage</c-></code></dfn> { <c- b>required</c-> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence①③"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#dictdef-allowedbluetoothdevice" id="ref-for-dictdef-allowedbluetoothdevice"><c- n>AllowedBluetoothDevice</c-></a>> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothPermissionStorage" data-dfn-type="dict-member" data-export data-type="sequence<AllowedBluetoothDevice> " id="dom-bluetoothpermissionstorage-alloweddevices"><code><c- g>allowedDevices</c-></code></dfn>; }; </pre> <p><code class="idl"><a data-link-type="idl" href="#dictdef-allowedbluetoothdevice" id="ref-for-dictdef-allowedbluetoothdevice①">AllowedBluetoothDevice</a></code> instances have an <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots②">internal slot</a> <dfn class="dfn-paneled idl-code" data-dfn-for="AllowedBluetoothDevice" data-dfn-type="attribute" data-export id="dom-allowedbluetoothdevice-device-slot"><code>[[device]]</code></dfn> that holds a <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①①">Bluetooth device</a>.</p> <dt><a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-extra-permission-data-constraints" id="ref-for-dfn-extra-permission-data-constraints">extra permission data constraints</a> <dd> Distinct elements of <code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissionstorage-alloweddevices" id="ref-for-dom-bluetoothpermissionstorage-alloweddevices⑤">allowedDevices</a></code> must have different <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot③">[[device]]</a></code>s and different <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-deviceid" id="ref-for-dom-allowedbluetoothdevice-deviceid①">deviceId</a></code>s. <p>If <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-mayusegatt" id="ref-for-dom-allowedbluetoothdevice-mayusegatt②">mayUseGATT</a></code> is <code>false</code>, <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices③">allowedServices</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedmanufacturerdata" id="ref-for-dom-allowedbluetoothdevice-allowedmanufacturerdata①">allowedManufacturerData</a></code> must both be <code>[]</code>.</p> <div class="note" id="note-device-id-tracking" role="note"> <a class="self-link" href="#note-device-id-tracking"></a> Note: A <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-deviceid" id="ref-for-dom-allowedbluetoothdevice-deviceid②">deviceId</a></code> allows a site to track that a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice⑨">BluetoothDevice</a></code> instance seen at one time represents the same device as another <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice①⓪">BluetoothDevice</a></code> instance seen at another time, possibly in a different <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms①">realm</a>. UAs should consider whether their user intends that tracking to happen or not-happen when returning <a class="idl-code" data-link-type="permission" href="#permissiondef-bluetooth" id="ref-for-permissiondef-bluetooth①">"bluetooth"</a>’s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-extra-permission-data" id="ref-for-dfn-extra-permission-data①">extra permission data</a>. <p>For example, users generally don’t intend two different origins to know that they’re interacting with the same device, and they generally don’t intend unique identifiers to persist after they’ve cleared an origin’s cookies.</p> </div> <dt><a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-permission-result-type" id="ref-for-dfn-permission-result-type">permission result type</a> <dd> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed①"><c- g>Exposed</c-></a>=<c- n>Window</c->] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetoothpermissionresult"><code><c- g>BluetoothPermissionResult</c-></code></dfn> : <a data-link-type="idl-name" href="https://w3c.github.io/permissions/#dom-permissionstatus" id="ref-for-dom-permissionstatus"><c- n>PermissionStatus</c-></a> { <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-frozen-array" id="ref-for-idl-frozen-array"><c- b>FrozenArray</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice①①"><c- n>BluetoothDevice</c-></a>> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothPermissionResult" data-dfn-type="attribute" data-export data-type="FrozenArray<BluetoothDevice>" id="dom-bluetoothpermissionresult-devices"><code><c- g>devices</c-></code></dfn>; }; </pre> <dt><a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-permission-query-algorithm" id="ref-for-dfn-permission-query-algorithm">permission query algorithm</a> <dd class="algorithm" data-algorithm="permission query"> To <dfn data-dfn-type="dfn" data-export id="query-the-bluetooth-permission">query the "bluetooth" permission<a class="self-link" href="#query-the-bluetooth-permission"></a></dfn> with a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissiondescriptor" id="ref-for-dictdef-bluetoothpermissiondescriptor">BluetoothPermissionDescriptor</a></code> <var>desc</var> and a <code class="idl"><a data-link-type="idl" href="#bluetoothpermissionresult" id="ref-for-bluetoothpermissionresult">BluetoothPermissionResult</a></code> <var>status</var>, the UA must: <ol> <li data-md> <p>Let <var>global</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global" id="ref-for-concept-relevant-global③">relevant global object</a> for <var>status</var>.</p> <li data-md> <p>Set <code><var>status</var>.<code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissionstatus-state" id="ref-for-dom-permissionstatus-state">state</a></code></code> to <var>desc</var>’s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-permission-state" id="ref-for-dfn-permission-state①">permission state</a>.</p> <li data-md> <p>If <code><var>status</var>.<code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissionstatus-state" id="ref-for-dom-permissionstatus-state①">state</a></code></code> is "<code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied③">denied</a></code>", set <code><var>status</var>.devices</code> to an empty <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-frozen-array" id="ref-for-idl-frozen-array①">FrozenArray</a></code> and abort these steps.</p> <li data-md> <p>Let <var>matchingDevices</var> be a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array-objects" id="ref-for-sec-array-objects③">Array</a></code>.</p> <li data-md> <p>Let <var>storage</var>, a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissionstorage" id="ref-for-dictdef-bluetoothpermissionstorage⑤">BluetoothPermissionStorage</a></code>, be <a class="idl-code" data-link-type="permission" href="#permissiondef-bluetooth" id="ref-for-permissiondef-bluetooth②">"bluetooth"</a>’s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-extra-permission-data" id="ref-for-dfn-extra-permission-data②">extra permission data</a> for the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object①">current settings object</a>.</p> <li data-md> <p>For each <var>allowedDevice</var> in <code><var>storage</var>.allowedDevices</code>, run the following sub-steps:</p> <ol> <li data-md> <p>If <code><var>desc</var>.deviceId</code> is set and <code><var>allowedDevice</var>.deviceId != <var>desc</var>.deviceId</code>, continue to the next <var>allowedDevice</var>.</p> <li data-md> <p>If <code><var>desc</var>.filters</code> is set, do the following sub-steps:</p> <ol> <li data-md> <p>Replace each filter in <code><var>desc</var>.filters</code> with the result of <a data-link-type="dfn" href="#bluetoothlescanfilterinit-canonicalizing" id="ref-for-bluetoothlescanfilterinit-canonicalizing②">canonicalizing</a> it. If any of these canonicalizations throws an error, return that error and abort these steps.</p> <li data-md> <p>If <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot④">[[device]]</a></code></code> does not <a data-link-type="dfn" href="#matches-a-filter" id="ref-for-matches-a-filter⑤">match a filter</a> in <code><var>desc</var>.filters</code>, continue to the next <var>allowedDevice</var>.</p> </ol> <li data-md> <p><a data-link-type="dfn" href="#get-the-bluetoothdevice-representing" id="ref-for-get-the-bluetoothdevice-representing②">Get the <code>BluetoothDevice</code> representing</a> <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot⑤">[[device]]</a></code></code> within <code><var>global</var>.navigator.bluetooth</code>, and add the result to <var>matchingDevices</var>.</p> </ol> <div class="note" role="note"> Note: The <code><var>desc</var>.optionalServices</code> and <code><var>desc</var>.optionalManufacturerData</code> fields do not affect the result. </div> <li data-md> <p>Set <code><var>status</var>.devices</code> to a new <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-frozen-array" id="ref-for-idl-frozen-array②">FrozenArray</a></code> whose contents are <var>matchingDevices</var>.</p> </ol> <dt><a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-permission-revocation-algorithm" id="ref-for-dfn-permission-revocation-algorithm">permission revocation algorithm</a> <dd class="algorithm" data-algorithm="permission revocation"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="revoke-bluetooth-access">revoke Bluetooth access</dfn> to devices the user no longer intends to expose, the UA MUST run the following steps: <ol> <li data-md> <p>Let <var>storage</var>, a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissionstorage" id="ref-for-dictdef-bluetoothpermissionstorage⑥">BluetoothPermissionStorage</a></code>, be <a class="idl-code" data-link-type="permission" href="#permissiondef-bluetooth" id="ref-for-permissiondef-bluetooth③">"bluetooth"</a>’s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-extra-permission-data" id="ref-for-dfn-extra-permission-data③">extra permission data</a> for the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object②">current settings object</a>.</p> <li data-md> <p>For each <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice①②">BluetoothDevice</a></code> instance <var>deviceObj</var> in the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#current-realm" id="ref-for-current-realm">current realm</a>, run the following sub-steps:</p> <ol> <li data-md> <p>If there is an <code class="idl"><a data-link-type="idl" href="#dictdef-allowedbluetoothdevice" id="ref-for-dictdef-allowedbluetoothdevice②">AllowedBluetoothDevice</a></code> <var>allowedDevice</var> in <code><var>storage</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissionstorage-alloweddevices" id="ref-for-dom-bluetoothpermissionstorage-alloweddevices⑥">allowedDevices</a></code></code> such that:</p> <ul> <li data-md> <p><code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot⑥">[[device]]</a></code></code> is the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device">same device</a> as <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot">[[representedDevice]]</a></code></code>, and</p> <li data-md> <p><code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-deviceid" id="ref-for-dom-allowedbluetoothdevice-deviceid③">deviceId</a></code> === <var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-id" id="ref-for-dom-bluetoothdevice-id">id</a></code></code>,</p> </ul> <p>then update <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot">[[allowedServices]]</a></code></code> to be <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices④">allowedServices</a></code></code>, and continue to the next <var>deviceObj</var>.</p> <li data-md> <p>Otherwise, detach <var>deviceObj</var> from its device by running the remaining steps.</p> <li data-md> <p>Call <code><var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-disconnect" id="ref-for-dom-bluetoothremotegattserver-disconnect">disconnect()</a></code></code>.</p> <div class="note" role="note"> Note: This fires a <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected" id="ref-for-eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected">gattserverdisconnected</a></code> event at <var>deviceObj</var>. </div> <li data-md> <p>Set <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①">[[representedDevice]]</a></code></code> to <code>null</code>.</p> </ol> </ol> </dl> </div> <h3 class="heading settled" data-level="4.2" id="availability"><span class="secno">4.2. </span><span class="content">Overall Bluetooth availability</span><a class="self-link" href="#availability"></a></h3> <p>The UA may be running on a computer that has no Bluetooth radio. <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice④">requestDevice()</a></code> handles this by failing to discover any devices, which results in a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#notfounderror" id="ref-for-notfounderror①">NotFoundError</a></code>, but websites may be able to handle it more gracefully.</p> <div class="example" id="example-getavailability"> <a class="self-link" href="#example-getavailability"></a> To show Bluetooth UI only to users who have a Bluetooth adapter: <pre class="highlight"><c- a>const</c-> bluetoothUI <c- o>=</c-> document<c- p>.</c->querySelector<c- p>(</c-><c- t>'#bluetoothUI'</c-><c- p>);</c-> navigator<c- p>.</c->bluetooth<c- p>.</c-><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability③">getAvailability<c- p>()</c-></a><c- p>.</c->then<c- p>(</c->isAvailable <c- p>=></c-> <c- p>{</c-> bluetoothUI<c- p>.</c->hidden <c- o>=</c-> <c- o>!</c->isAvailable<c- p>;</c-> <c- p>});</c-> navigator<c- p>.</c->bluetooth<c- p>.</c->addEventListener<c- p>(</c-><c- t>'</c-><a data-link-type="idl" href="#eventdef-bluetooth-availabilitychanged" id="ref-for-eventdef-bluetooth-availabilitychanged①"><c- t>availabilitychanged</c-></a><c- t>'</c-><c- p>,</c-> e <c- p>=></c-> <c- p>{</c-> bluetoothUI<c- p>.</c->hidden <c- o>=</c-> <c- o>!</c->e<c- p>.</c->value<c- p>;</c-> <c- p>});</c-> </pre> </div> <div class="algorithm" data-algorithm="getAvailability()" data-algorithm-for="Bluetooth"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="method" data-export id="dom-bluetooth-getavailability"><code>getAvailability()</code></dfn></code> method, when invoked, MUST return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise②">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel③">in parallel</a>: <ol> <li data-md> <p>If <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this②">this</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global" id="ref-for-concept-relevant-global④">relevant global object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-document-window" id="ref-for-concept-document-window②">associated Document</a> is not <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/iframe-embed-object.html#allowed-to-use" id="ref-for-allowed-to-use②">allowed to use</a> the <a data-link-type="dfn" href="https://w3c.github.io/webappsec-permissions-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature②">policy-controlled feature</a> named "<a data-link-type="dfn" href="#policy-controlled-feature-bluetooth" id="ref-for-policy-controlled-feature-bluetooth②">bluetooth</a>", <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task">queue a task</a> to <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve②">resolve</a> <var>promise</var> with <code>false</code>, and abort these steps.</p> <li data-md> <p id="override-availability">If the user has configured the UA to return a particular answer from this function for the current origin, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①">queue a task</a> to <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve③">resolve</a> <var>promise</var> with the configured answer, and abort these steps.</p> <div class="note" role="note"> Note: If the Web Bluetooth permission has been blocked by the user, the UA may <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve④">resolve</a> <var>promise</var> with <code>false</code>. </div> <li data-md> <p>Let <var>simulatedBluetoothAdapter</var> be <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this③">this</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#window-navigable" id="ref-for-window-navigable①">navigable</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#nav-top" id="ref-for-nav-top①">top-level traversable</a>'s <a data-link-type="dfn" href="#simulated-bluetooth-adapter" id="ref-for-simulated-bluetooth-adapter①">simulated Bluetooth adapter</a>.</p> <li data-md> <p>If <var>simulatedBluetoothAdapter</var> is not empty,</p> <ol> <li data-md> <p>If <var>simulatedBluetoothAdapter</var>’s <a data-link-type="dfn" href="#adapter-state" id="ref-for-adapter-state">adapter state</a> is "absent", <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②">queue a task</a> to <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve⑤">resolve</a> <var>promise</var> with <code>false</code>.</p> <li data-md> <p>Otherwise, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task③">queue a task</a> to <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve⑥">resolve</a> <var>promise</var> with <code>true</code>.</p> <li data-md> <p>Abort these steps.</p> </ol> <li data-md> <p>If the UA is running on a system that has a Bluetooth radio <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task④">queue a task</a> to <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve⑦">resolve</a> <var>promise</var> with <code>true</code> regardless of the powered state of the Bluetooth radio.</p> <li data-md> <p>Otherwise, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑤">queue a task</a> to <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve⑧">resolve</a> <var>promise</var> with <code>false</code>.</p> <div class="note" role="note"> Note: The promise is resolved <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel④">in parallel</a> to let the UA call out to other systems to determine whether Bluetooth is available. </div> </ol> </div> <div class="example" id="example-getAvailability-PermissionStatus-onchange"> <a class="self-link" href="#example-getAvailability-PermissionStatus-onchange"></a> If the user has blocked the permission and the UA resolves the <code><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability④">getAvailability</a></code> promise with false, the following can be used to detect when Bluetooth is available again to show Bluetooth UI: <pre class="highlight"><c- a>function</c-> checkAvailability<c- p>()</c-> <c- p>{</c-> <c- a>const</c-> bluetoothUI <c- o>=</c-> document<c- p>.</c->querySelector<c- p>(</c-><c- t>'#bluetoothUI'</c-><c- p>);</c-> navigator<c- p>.</c->bluetooth<c- p>.</c-><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability⑤">getAvailability<c- p>()</c-></a><c- p>.</c->then<c- p>(</c->isAvailable <c- p>=></c-> <c- p>{</c-> bluetoothUI<c- p>.</c->hidden <c- o>=</c-> <c- o>!</c->isAvailable<c- p>;</c-> <c- p>});</c-> <c- p>}</c-> navigator<c- p>.</c->permissions<c- p>.</c-><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissions-query" id="ref-for-dom-permissions-query②">query</a><c- p>({</c->name<c- o>:</c-> <c- u>"bluetooth"</c-><c- p>}).</c->then<c- p>(</c->status <c- p>=></c-> <c- p>{</c-> <c- k>if</c-> <c- p>(</c->status<c- p>.</c->state <c- o>!==</c-> <c- t>'denied'</c-><c- p>)</c-> checkAvailability<c- p>();</c-> <c- c1>// Bluetooth is blocked, listen for change in PermissionStatus.</c-> status<c- p>.</c->onchange <c- o>=</c-> <c- p>()</c-> <c- p>=></c-> <c- p>{</c-> <c- k>if</c-> <c- p>(</c-><c- k>this</c-><c- p>.</c->state <c- o>!==</c-> <c- t>'denied'</c-><c- p>)</c-> checkAvailability<c- p>();</c-> <c- p>};</c-> <c- p>});</c-> </pre> </div> <div class="unstable algorithm" data-algorithm="availabilitychanged" id="availability-changed-algorithm"> If the UA becomes able or unable to use Bluetooth, for example because a radio was physically attached or detached, or the user has changed their <a href="#override-availability">configuration</a> for the answer returned from <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability⑥">getAvailability()</a></code>, the UA must <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑥">queue a task</a> on each <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#global-object" id="ref-for-global-object">global object</a> <var>global</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop">responsible event loop</a> to run the following steps: <ol> <li data-md> <p>Let <var>oldAvailability</var> be the value <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability⑦">getAvailability()</a></code> would have returned before the change.</p> <li data-md> <p>Let <var>newAvailability</var> be the value <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-getavailability" id="ref-for-dom-bluetooth-getavailability⑧">getAvailability()</a></code> would return after the change.</p> <li data-md> <p>If <var>oldAvailability</var> is not the same as <var>newAvailability</var>, <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire">fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetooth-availabilitychanged" id="ref-for-eventdef-bluetooth-availabilitychanged②">availabilitychanged</a></code> using the <code class="idl"><a data-link-type="idl" href="#valueevent" id="ref-for-valueevent">ValueEvent</a></code> interface at <code><var>global</var>.navigator.bluetooth</code> with its <code class="idl"><a data-link-type="idl" href="#dom-valueevent-value" id="ref-for-dom-valueevent-value">value</a></code> attribute initialized to <var>newAvailability</var>.</p> </ol> </div> <pre class="idl highlight def">[ <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed②"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext①"><c- g>SecureContext</c-></a> ] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="valueevent"><code><c- g>ValueEvent</c-></code></dfn> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event"><c- n>Event</c-></a> { <dfn class="idl-code" data-dfn-for="ValueEvent" data-dfn-type="constructor" data-export data-lt="ValueEvent(type, initDict)|constructor(type, initDict)|ValueEvent(type)|constructor(type)" id="dom-valueevent-valueevent"><code><c- g>constructor</c-></code><a class="self-link" href="#dom-valueevent-valueevent"></a></dfn>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString⑤"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="ValueEvent/ValueEvent(type, initDict), ValueEvent/constructor(type, initDict), ValueEvent/ValueEvent(type), ValueEvent/constructor(type)" data-dfn-type="argument" data-export id="dom-valueevent-valueevent-type-initdict-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-valueevent-valueevent-type-initdict-type"></a></dfn>, <c- b>optional</c-> <a data-link-type="idl-name" href="#dictdef-valueeventinit" id="ref-for-dictdef-valueeventinit"><c- n>ValueEventInit</c-></a> <dfn class="idl-code" data-dfn-for="ValueEvent/ValueEvent(type, initDict), ValueEvent/constructor(type, initDict), ValueEvent/ValueEvent(type), ValueEvent/constructor(type)" data-dfn-type="argument" data-export id="dom-valueevent-valueevent-type-initdict-initdict"><code><c- g>initDict</c-></code><a class="self-link" href="#dom-valueevent-valueevent-type-initdict-initdict"></a></dfn> = {}); <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-any" id="ref-for-idl-any"><c- b>any</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="any" href="#dom-valueevent-value" id="ref-for-dom-valueevent-value①"><c- g>value</c-></a>; }; <c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-valueeventinit"><code><c- g>ValueEventInit</c-></code></dfn> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit"><c- n>EventInit</c-></a> { <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-any" id="ref-for-idl-any①"><c- b>any</c-></a> <dfn class="idl-code" data-default="null" data-dfn-for="ValueEventInit" data-dfn-type="dict-member" data-export data-type="any " id="dom-valueeventinit-value"><code><c- g>value</c-></code><a class="self-link" href="#dom-valueeventinit-value"></a></dfn> = <c- b>null</c->; }; </pre> <p><code class="idl"><a data-link-type="idl" href="#valueevent" id="ref-for-valueevent①">ValueEvent</a></code> instances are constructed as specified in <a href="https://dom.spec.whatwg.org/#constructing-events"><cite>DOM</cite> § 2.5 Constructing events</a>.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ValueEvent" data-dfn-type="attribute" data-export id="dom-valueevent-value"><code>value</code></dfn> attribute must return the value it was initialized to.</p> <p class="issue" id="issue-565fd2fa"><a class="self-link" href="#issue-565fd2fa"></a> Such a generic event type belongs in <a data-link-type="biblio" href="#biblio-html" title="HTML Standard">[HTML]</a> or <a data-link-type="biblio" href="#biblio-dom" title="DOM Standard">[DOM]</a>, not here.</p> <h2 class="heading settled" data-level="5" id="device-representation"><span class="secno">5. </span><span class="content">Device Representation</span><a class="self-link" href="#device-representation"></a></h2> <p>The UA needs to track Bluetooth device properties at several levels: globally, per origin, and per <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#global-object" id="ref-for-global-object①">global object</a>.</p> <h3 class="heading settled" data-level="5.1" id="global-device-properties"><span class="secno">5.1. </span><span class="content">Global Bluetooth device properties</span><a class="self-link" href="#global-device-properties"></a></h3> <p>The physical Bluetooth device may be guaranteed to have some properties that the UA may not have received. Those properties are described as optional here.</p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="bluetooth-device">Bluetooth device</dfn> has the following properties. Optional properties are not present, and sequence and map properties are empty, unless/until described otherwise. Other properties have a default specified or are specified when a device is introduced.</p> <ul> <li data-md> <p>A set of <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="supported-physical-transports">supported physical transports</dfn>, including one or both of BR/EDR and LE. This set will generally be filled based on the transports over which the device was discovered and the <a data-link-type="dfn" href="#flags-data-type" id="ref-for-flags-data-type">Flags Data Type</a> in the <a data-link-type="dfn" href="#advertising-data" id="ref-for-advertising-data">Advertising Data</a> or <a data-link-type="dfn" href="#extended-inquiry-response" id="ref-for-extended-inquiry-response②">Extended Inquiry Response</a>.</p> <li data-md> <p>One or more of several kinds of 48-bit address: a <a data-link-type="dfn" href="#public-bluetooth-address" id="ref-for-public-bluetooth-address">Public Bluetooth Address</a>, a (random) <a data-link-type="dfn" href="#static-address" id="ref-for-static-address">Static Address</a>, and a resolvable or non-resolvable <a data-link-type="dfn" href="#private-address" id="ref-for-private-address①">Private Address</a>.</p> <li data-md> <p>An optional 128-bit <a data-link-type="dfn" href="#identity-resolving-key" id="ref-for-identity-resolving-key②">Identity Resolving Key</a>.</p> <li data-md> <p>An optional partial or complete <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name⑥">Bluetooth Device Name</a>. A device has a partial name when the <a data-link-type="dfn" href="https://www.bluetooth.com/specifications/assigned-numbers/#:~:text=Generic%20Access%20Profile" id="ref-for-:~:text=Generic%20Access%20Profile">Shortened Local Name</a> AD data was received, but the full name hasn’t been read yet. The <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name⑦">Bluetooth Device Name</a> is encoded as UTF-8 and converted to a DOMString using the <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom" id="ref-for-utf-8-decode-without-bom">utf-8 decode without BOM</a> algorithm.</p> <li data-md> <p>An optional <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer①">ATT Bearer</a>, over which all GATT communication happens. The <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer②">ATT Bearer</a> is created by procedures described in "Connection Establishment" under <a data-link-type="dfn" href="#gap-interoperability-requirements" id="ref-for-gap-interoperability-requirements">GAP Interoperability Requirements</a>. It is disconnected in ways <a data-link-type="biblio" href="#biblio-bluetooth42" title="BLUETOOTH SPECIFICATION Version 4.2">[BLUETOOTH42]</a> isn’t entirely clear about.</p> <li data-md> <p>A list of advertised <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type①">Service UUIDs</a> from the <a data-link-type="dfn" href="#advertising-data" id="ref-for-advertising-data①">Advertising Data</a> or <a data-link-type="dfn" href="#extended-inquiry-response" id="ref-for-extended-inquiry-response③">Extended Inquiry Response</a>.</p> <li data-md> <p>A hierarchy of GATT <a data-link-type="dfn" href="#attribute" id="ref-for-attribute">Attributes</a>.</p> </ul> <p>The UA SHOULD determine that two <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①②">Bluetooth device</a>s are the <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-local-lt="same device" id="same-bluetooth-device">same Bluetooth device</dfn> if and only if they have the same <a data-link-type="dfn" href="#public-bluetooth-address" id="ref-for-public-bluetooth-address①">Public Bluetooth Address</a>, <a data-link-type="dfn" href="#static-address" id="ref-for-static-address①">Static Address</a>, <a data-link-type="dfn" href="#private-address" id="ref-for-private-address②">Private Address</a>, or <a data-link-type="dfn" href="#identity-resolving-key" id="ref-for-identity-resolving-key③">Identity Resolving Key</a>, or if the <a data-link-type="dfn" href="#resolvable-private-address-resolution-procedure" id="ref-for-resolvable-private-address-resolution-procedure①">Resolvable Private Address Resolution Procedure</a> succeeds using one device’s IRK and the other’s Resolvable <a data-link-type="dfn" href="#private-address" id="ref-for-private-address③">Private Address</a>. However, because platform APIs don’t document how they determine device identity, the UA MAY use another procedure.</p> <h3 class="heading settled" data-level="5.2" id="bluetoothdevice-interface"><span class="secno">5.2. </span><span class="content">BluetoothDevice</span><a class="self-link" href="#bluetoothdevice-interface"></a></h3> <p>A <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice①③">BluetoothDevice</a></code> instance represents a <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①③">Bluetooth device</a> for a particular <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#global-object" id="ref-for-global-object②">global object</a> (or, equivalently, for a particular <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms②">Realm</a> or <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth⑤">Bluetooth</a></code> instance).</p> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed③"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext②"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetoothdevice"><code><c- g>BluetoothDevice</c-></code></dfn> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget①"><c- n>EventTarget</c-></a> { <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString⑥"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#dom-bluetoothdevice-id" id="ref-for-dom-bluetoothdevice-id①"><c- g>id</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString⑦"><c- b>DOMString</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString?" href="#dom-bluetoothdevice-name" id="ref-for-dom-bluetoothdevice-name"><c- g>name</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver"><c- n>BluetoothRemoteGATTServer</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothRemoteGATTServer?" href="#dom-bluetoothdevice-gatt" id="ref-for-dom-bluetoothdevice-gatt"><c- g>gatt</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise③"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined" id="ref-for-idl-undefined"><c- b>undefined</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothdevice-forget" id="ref-for-dom-bluetoothdevice-forget"><c- g>forget</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise④"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined" id="ref-for-idl-undefined①"><c- b>undefined</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothdevice-watchadvertisements" id="ref-for-dom-bluetoothdevice-watchadvertisements①"><c- g>watchAdvertisements</c-></a>( <c- b>optional</c-> <a data-link-type="idl-name" href="#dictdef-watchadvertisementsoptions" id="ref-for-dictdef-watchadvertisementsoptions"><c- n>WatchAdvertisementsOptions</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothDevice/watchAdvertisements(options), BluetoothDevice/watchAdvertisements()" data-dfn-type="argument" data-export id="dom-bluetoothdevice-watchadvertisements-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-bluetoothdevice-watchadvertisements-options-options"></a></dfn> = {}); <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean④"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements"><c- g>watchingAdvertisements</c-></a>; }; <a data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice①④"><c- n>BluetoothDevice</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#bluetoothdeviceeventhandlers" id="ref-for-bluetoothdeviceeventhandlers①"><c- n>BluetoothDeviceEventHandlers</c-></a>; <a data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice①⑤"><c- n>BluetoothDevice</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#characteristiceventhandlers" id="ref-for-characteristiceventhandlers①"><c- n>CharacteristicEventHandlers</c-></a>; <a data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice①⑥"><c- n>BluetoothDevice</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#serviceeventhandlers" id="ref-for-serviceeventhandlers①"><c- n>ServiceEventHandlers</c-></a>; <c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-watchadvertisementsoptions"><code><c- g>WatchAdvertisementsOptions</c-></code></dfn> { <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#abortsignal" id="ref-for-abortsignal"><c- n>AbortSignal</c-></a> <dfn class="idl-code" data-dfn-for="WatchAdvertisementsOptions" data-dfn-type="dict-member" data-export data-type="AbortSignal " id="dom-watchadvertisementsoptions-signal"><code><c- g>signal</c-></code><a class="self-link" href="#dom-watchadvertisementsoptions-signal"></a></dfn>; }; </pre> <div class="note no-marker" role="note"> <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice①⑦">BluetoothDevice</a></code> attributes</div> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-id"><code>id</code></dfn> uniquely identifies a device to the extent that the UA can determine that two Bluetooth connections are to the same device and to the extent that the user <a href="#note-device-id-tracking">wants to expose that fact to script</a>. <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-name"><code>name</code></dfn> is the human-readable name of the device.</p> <p><code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-gatt" id="ref-for-dom-bluetoothdevice-gatt①">gatt</a></code> provides a way to interact with this device’s GATT server if the site has permission to do so.</p> <p><code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-forget" id="ref-for-dom-bluetoothdevice-forget①">forget()</a></code> enables the page to revoke access to the device that the user has granted access to.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-watchingadvertisements"><code>watchingAdvertisements</code></dfn> is true if the UA is currently scanning for advertisements from this device and firing events for them.</p> </div> <p>Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice①⑧">BluetoothDevice</a></code> are created with the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots③">internal slots</a> described in the following table:</p> <table> <tbody> <tr> <th><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots④">Internal Slot</a> <th>Initial Value <th>Description (non-normative) <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-context-slot"><code>[[context]]</code></dfn> <td>&lt;always set in prose> <td> The <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth⑥">Bluetooth</a></code> object that returned this <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice①⑨">BluetoothDevice</a></code>. <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-representeddevice-slot"><code>[[representedDevice]]</code></dfn> <td>&lt;always set in prose> <td> The <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①④">Bluetooth device</a> this object represents, or <code>null</code> if access has been <a data-link-type="dfn" href="#revoke-bluetooth-access" id="ref-for-revoke-bluetooth-access①">revoked</a>. <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-gatt-slot"><code>[[gatt]]</code></dfn> <td> a new <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver①">BluetoothRemoteGATTServer</a></code> instance with its <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-device" id="ref-for-dom-bluetoothremotegattserver-device">device</a></code> attribute initialized to <code>this</code> and its <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected">connected</a></code> attribute initialized to <code>false</code>. <td> Does not change. <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-allowedservices-slot"><code>[[allowedServices]]</code></dfn> <td>&lt;always set in prose> <td> This device’s <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices⑤">allowedServices</a></code> list for this origin or <code>"all"</code> if all services are allowed. For example, a UA may grant an origin access to all services on a <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-referringdevice" id="ref-for-dom-bluetooth-referringdevice③">referringDevice</a></code> that advertised a URL on that origin. <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-allowedmanufacturerdata-slot"><code>[[allowedManufacturerData]]</code></dfn> <td>&lt;always set in prose> <td> This device’s <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedmanufacturerdata" id="ref-for-dom-allowedbluetoothdevice-allowedmanufacturerdata②">allowedManufacturerData</a></code> list for this origin. <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-watchadvertisementsstate-slot"><code>[[watchAdvertisementsState]]</code></dfn> <td><code>'not-watching'</code> <td> An string enumeration describing the current state of a <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchadvertisements" id="ref-for-dom-bluetoothdevice-watchadvertisements②">watchAdvertisements()</a></code> operation. The possible enumeration values are: <ul> <li data-md> <p><code>'not-watching'</code></p> <li data-md> <p><code>'pending-watch'</code></p> <li data-md> <p><code>'watching'</code></p> </ul> </table> <div class="algorithm" data-algorithm="get or create BluetoothDevice"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="get-the-bluetoothdevice-representing">get the <code>BluetoothDevice</code> representing</dfn> a <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①⑤">Bluetooth device</a> <var>device</var> inside a <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth⑦">Bluetooth</a></code> instance <var>context</var>, the UA MUST run the following steps: <ol> <li data-md> <p>Let <var>storage</var>, a <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissionstorage" id="ref-for-dictdef-bluetoothpermissionstorage⑦">BluetoothPermissionStorage</a></code>, be <a class="idl-code" data-link-type="permission" href="#permissiondef-bluetooth" id="ref-for-permissiondef-bluetooth④">"bluetooth"</a>’s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-extra-permission-data" id="ref-for-dfn-extra-permission-data④">extra permission data</a> for the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object③">current settings object</a>.</p> <li data-md> <p>Find the <var>allowedDevice</var> in <code><var>storage</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissionstorage-alloweddevices" id="ref-for-dom-bluetoothpermissionstorage-alloweddevices⑦">allowedDevices</a></code></code> with <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot⑦">[[device]]</a></code></code> the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device①">same device</a> as <var>device</var>. If there is no such object, throw a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror⑥">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>If there is no key in <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-deviceinstancemap-slot" id="ref-for-dom-bluetooth-deviceinstancemap-slot">[[deviceInstanceMap]]</a></code> that is the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device②">same device</a> as <var>device</var>, run the following sub-steps:</p> <ol> <li data-md> <p>Let <var>result</var> be a new instance of <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②⓪">BluetoothDevice</a></code>.</p> <li data-md> <p>Initialize all of <var>result</var>’s optional fields to <code>null</code>.</p> <li data-md> <p>Initialize <code><var>result</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-context-slot" id="ref-for-dom-bluetoothdevice-context-slot">[[context]]</a></code></code> to <var>context</var>.</p> <li data-md> <p>Initialize <code><var>result</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot②">[[representedDevice]]</a></code></code> to <var>device</var>.</p> <li data-md> <p>Initialize <code><var>result</var>.id</code> to <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-deviceid" id="ref-for-dom-allowedbluetoothdevice-deviceid④">deviceId</a></code></code>, and initialize <code><var>result</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot①">[[allowedServices]]</a></code></code> to <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices⑥">allowedServices</a></code></code>.</p> <li data-md> <p>If <var>device</var> has a partial or complete <a data-link-type="dfn" href="#bluetooth-device-name" id="ref-for-bluetooth-device-name⑧">Bluetooth Device Name</a>, set <code><var>result</var>.name</code> to that string.</p> <li data-md> <p>Initialize <code><var>result</var>.watchingAdvertisements</code> to <code>false</code>.</p> <li data-md> <p>Add a mapping from <var>device</var> to <var>result</var> in <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-deviceinstancemap-slot" id="ref-for-dom-bluetooth-deviceinstancemap-slot①">[[deviceInstanceMap]]</a></code>.</p> </ol> <li data-md> <p>Return the value in <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-deviceinstancemap-slot" id="ref-for-dom-bluetooth-deviceinstancemap-slot②">[[deviceInstanceMap]]</a></code> whose key is the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device③">same device</a> as <var>device</var>.</p> </ol> </div> <div class="algorithm" data-algorithm="get gatt attribute"> Getting the <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="attribute" data-export id="dom-bluetoothdevice-gatt"><code>gatt</code></dfn></code> attribute MUST perform the following steps: <ol> <li data-md> <p>If <a class="idl-code" data-link-type="permission" href="#permissiondef-bluetooth" id="ref-for-permissiondef-bluetooth⑤">"bluetooth"</a>’s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-extra-permission-data" id="ref-for-dfn-extra-permission-data⑤">extra permission data</a> for <code>this</code>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object">relevant settings object</a> has an <code class="idl"><a data-link-type="idl" href="#dictdef-allowedbluetoothdevice" id="ref-for-dictdef-allowedbluetoothdevice③">AllowedBluetoothDevice</a></code> <var>allowedDevice</var> in its <code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissionstorage-alloweddevices" id="ref-for-dom-bluetoothpermissionstorage-alloweddevices⑧">allowedDevices</a></code> list with <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-device-slot" id="ref-for-dom-allowedbluetoothdevice-device-slot⑧">[[device]]</a></code></code> the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device④">same device</a> as <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot③">[[representedDevice]]</a></code></code> and <code><var>allowedDevice</var>.<code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-mayusegatt" id="ref-for-dom-allowedbluetoothdevice-mayusegatt③">mayUseGATT</a></code></code> equal to <code>true</code>, return <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-gatt-slot" id="ref-for-dom-bluetoothdevice-gatt-slot">[[gatt]]</a></code></code>.</p> <li data-md> <p>Otherwise, return <code>null</code>.</p> </ol> </div> <div class="algorithm" data-algorithm="forget invocation"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="method" data-export id="dom-bluetoothdevice-forget"><code>forget()</code></dfn></code> method, when invoked, MUST return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise③">a new promise</a> <var>promise</var> and run the following steps: <ol> <li data-md> <p>Let <var>device</var> be the target <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②①">BluetoothDevice</a></code> object.</p> <li data-md> <p>Let <var>storage</var> be the <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothpermissionstorage" id="ref-for-dictdef-bluetoothpermissionstorage⑧">BluetoothPermissionStorage</a></code> object in the current script execution environment.</p> <li data-md> <p><a data-link-type="dfn" href="#remove-device-from-storage" id="ref-for-remove-device-from-storage">Remove <var>device</var> from storage</a> with <var>storage</var>.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve⑨">Resolve</a> <var>promise</var>.</p> </ol> </div> <p>A user agent has an associated <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="watch-advertisements-manager">watch advertisements manager</dfn> which is the result of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#starting-a-new-parallel-queue" id="ref-for-starting-a-new-parallel-queue">starting a new parallel queue</a>.</p> <div class="algorithm" data-algorithm="watchAdvertisements"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDevice" data-dfn-type="method" data-export data-lt="watchAdvertisements(options)|watchAdvertisements()" id="dom-bluetoothdevice-watchadvertisements"><code>watchAdvertisements(<var>options</var>)</code></dfn> </code> method, when invoked, MUST return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise④">a new promise</a> <var>promise</var> and run the following steps: <ol> <li data-md> <p>If <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#abortsignal" id="ref-for-abortsignal①">signal</a></code></code> is present, then perform the following sub-steps:</p> <ol> <li data-md> <p>If <code><var>options</var>.<code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#abortsignal" id="ref-for-abortsignal②">signal</a></code></code> is <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortsignal-aborted" id="ref-for-abortsignal-aborted">aborted</a>, then <a data-link-type="dfn" href="#abort-watchadvertisements" id="ref-for-abort-watchadvertisements">abort watchAdvertisements</a> with <code>this</code> and abort these steps.</p> <li data-md> <p><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortsignal-add" id="ref-for-abortsignal-add">Add the following abort steps</a> to <code> <var>options</var>.<code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#abortsignal" id="ref-for-abortsignal③">signal</a></code></code>:</p> <ol> <li data-md> <p><a data-link-type="dfn" href="#abort-watchadvertisements" id="ref-for-abort-watchadvertisements①">Abort watchAdvertisements</a> with <code>this</code>.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject⑤">Reject</a> <var>promise</var> with <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#aborterror" id="ref-for-aborterror">AbortError</a></code></p> </ol> </ol> <li data-md> <p>If <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchadvertisementsstate-slot" id="ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot">[[watchAdvertisementsState]]</a></code></code> is:</p> <dl class="switch"> <dt data-md><code>'not-watching'</code> <dd data-md> <ol> <li data-md> <p>Set <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchadvertisementsstate-slot" id="ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot①">[[watchAdvertisementsState]]</a></code></code> to <code>'pending-watch'</code>.</p> <li data-md> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#enqueue-the-following-steps" id="ref-for-enqueue-the-following-steps">Enqueue the following steps</a> to the <a data-link-type="dfn" href="#watch-advertisements-manager" id="ref-for-watch-advertisements-manager">watch advertisements manager</a>, but abort when <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchadvertisementsstate-slot" id="ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot②">[[watchAdvertisementsState]]</a></code></code> becomes <code>not-watching</code>:</p> <ol> <li data-md> <p>Ensure that the UA is scanning for this device’s advertisements. The UA SHOULD NOT filter out "duplicate" advertisements for the same device.</p> <li data-md> <p>If the UA fails to enable scanning, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑦">queue a task</a> to perform the following steps, and abort these steps:</p> <ol> <li data-md> <p>Set <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchadvertisementsstate-slot" id="ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot③">[[watchAdvertisementsState]]</a></code></code> to <code>'not-watching'</code>.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject⑥">Reject</a> <var>promise</var> with one of the following errors:</p> <dl class="switch"> <dt data-md>The UA doesn’t support scanning for advertisements <dd data-md> <p><code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#notsupportederror" id="ref-for-notsupportederror">NotSupportedError</a></code></p> <dt data-md>Bluetooth is turned off <dd data-md> <p><code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidstateerror" id="ref-for-invalidstateerror">InvalidStateError</a></code></p> <dt data-md>Other reasons <dd data-md> <p><code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#unknownerror" id="ref-for-unknownerror">UnknownError</a></code></p> </dl> </ol> <li data-md> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑧">Queue a task</a> to perform the following steps, but <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#abort-when" id="ref-for-abort-when">abort when</a> <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchadvertisementsstate-slot" id="ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot④">[[watchAdvertisementsState]]</a></code></code> becomes <code>not-watching</code>:</p> <ol> <li data-md> <p>Set <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchadvertisementsstate-slot" id="ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot⑤">[[watchAdvertisementsState]]</a></code></code> to <code>watching</code>.</p> <li data-md> <p>Set <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements①">watchingAdvertisements</a></code></code> to <code>true</code>.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve①⓪">Resolve</a> <var>promise</var> with <code>undefined</code>.</p> </ol> </ol> </ol> <dt data-md><code>'pending-watch'</code> <dd data-md> <ol> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject⑦">Reject</a> <var>promise</var> with <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidstateerror" id="ref-for-invalidstateerror①">InvalidStateError</a></code>.</p> </ol> <dt data-md><code>'watching'</code> <dd data-md> <ol> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve①①">Resolve</a> <var>promise</var> with <code>undefined</code>.</p> </ol> </dl> <li data-md> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#if-aborted" id="ref-for-if-aborted">If aborted</a>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject⑧">reject</a> <var>promise</var> with <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#aborterror" id="ref-for-aborterror①">AbortError</a></code>.</p> </ol> <p class="note" role="note"><span class="marker">Note:</span> Scanning costs power, so websites should avoid watching for advertisements unnecessarily, and should use their <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#abortcontroller" id="ref-for-abortcontroller">AbortController</a></code> to stop using power as soon as possible.</p> </div> <div class="algorithm" data-algorithm="abort watchAdvertisements"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="abort-watchadvertisements">abort <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchadvertisements" id="ref-for-dom-bluetoothdevice-watchadvertisements③">watchAdvertisements</a></code></dfn> for a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②②">BluetoothDevice</a></code> <var>device</var>, run these steps: <ol> <li data-md> <p>Set <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchadvertisementsstate-slot" id="ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot⑥">[[watchAdvertisementsState]]</a></code></code> to <code>'not-watching'</code>.</p> <li data-md> <p>Set <code><var>device</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements②">watchingAdvertisements</a></code></code> to <code>false</code>.</p> <li data-md> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#enqueue-the-following-steps" id="ref-for-enqueue-the-following-steps①">Enqueue the following steps</a> to <a data-link-type="dfn" href="#watch-advertisements-manager" id="ref-for-watch-advertisements-manager①">watch advertisements manager</a>:</p> <ol> <li data-md> <p>If no more <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②③">BluetoothDevice</a></code>s in the whole UA have <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements③">watchingAdvertisements</a></code> set to <code>true</code>, the UA SHOULD stop scanning for advertisements. Otherwise, if no more <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②④">BluetoothDevice</a></code>s representing the same device as <code>this</code> have <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements④">watchingAdvertisements</a></code> set to <code>true</code>, the UA SHOULD reconfigure the scan to avoid receiving reports for this device.</p> </ol> </ol> </div> <div class="algorithm" data-algorithm="abort all active watchAdvertisments"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="abort-all-active-watchadvertisements">abort all active <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchadvertisements" id="ref-for-dom-bluetoothdevice-watchadvertisements④">watchAdvertisements</a></code></dfn> operations, run these steps: <ol> <li data-md> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-iterate" id="ref-for-map-iterate">For each</a> <code><var>device</var></code> in <code><code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth⑧">Bluetooth</a></code>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-deviceinstancemap-slot" id="ref-for-dom-bluetooth-deviceinstancemap-slot③">[[deviceInstanceMap]]</a></code></code>, perform the following steps:</p> <ol> <li data-md> <p>If <code><var>device</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchadvertisementsstate-slot" id="ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot⑦">[[watchAdvertisementsState]]</a></code></code> is <code>pending-watch</code> or <code>watching</code>, run <a data-link-type="dfn" href="#abort-watchadvertisements" id="ref-for-abort-watchadvertisements②">abort watchAdvertisements</a> with <var>device</var>.</p> </ol> </ol> </div> <div> <h4 class="heading settled" data-level="5.2.1" id="handling-visibility-change"><span class="secno">5.2.1. </span><span class="content">Handling Visibility Change</span><a class="self-link" href="#handling-visibility-change"></a></h4> <p>Operations that initiate a scan for Bluetooth devices may only run in a visible <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document" id="ref-for-concept-document">document</a>. When <a data-link-type="dfn" href="https://www.w3.org/TR/page-visibility-2/#dom-visibilitystate" id="ref-for-dom-visibilitystate">visibility state</a> is no longer <code>"visible"</code>, scanning operations for that <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document" id="ref-for-concept-document①">document</a> need to be aborted.</p> <div class="algorithm" data-algorithm="handle visibility change"> When the user agent determines that the <a data-link-type="dfn" href="https://www.w3.org/TR/page-visibility-2/#dom-visibilitystate" id="ref-for-dom-visibilitystate①">visibility state</a> of the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-document-window" id="ref-for-concept-document-window③">associated <code>Document</code></a> of the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object④">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global" id="ref-for-concept-relevant-global⑤">relevant global object</a> changes, it must run these steps: <ol> <li data-md> <p>Let <code><var>document</var></code> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-document-window" id="ref-for-concept-document-window④">associated <code>Document</code></a> of the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object⑤">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global" id="ref-for-concept-relevant-global⑥">relevant global object</a>.</p> <li data-md> <p>If <code><var>document</var></code>’s <a data-link-type="dfn" href="https://www.w3.org/TR/page-visibility-2/#dom-visibilitystate" id="ref-for-dom-visibilitystate②">visibility state</a> is not <code>"visible"</code>, then <a data-link-type="dfn" href="#abort-all-active-watchadvertisements" id="ref-for-abort-all-active-watchadvertisements">abort all active watchAdvertisements</a> operations.</p> </ol> </div> </div> <div> <h4 class="heading settled" data-level="5.2.2" id="handling-full-activity-loss"><span class="secno">5.2.2. </span><span class="content">Handling Document Loss of Full Activity</span><a class="self-link" href="#handling-full-activity-loss"></a></h4> <p>Operations that initiate a scan for Bluetooth devices may only run in a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#fully-active" id="ref-for-fully-active">fully active</a> <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document" id="ref-for-concept-document②">document</a>. When <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#fully-active" id="ref-for-fully-active①">full activity</a> is lost, scanning operations for that <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document" id="ref-for-concept-document③">document</a> need to be aborted.</p> <div class="algorithm" data-algorithm="handle full activity loss"> When the user agent determines that a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-document-window" id="ref-for-concept-document-window⑤">associated <code>Document</code></a> of the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object⑥">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global" id="ref-for-concept-relevant-global⑦">relevant global object</a> is no longer <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#fully-active" id="ref-for-fully-active②">fully active</a>, it must run these steps: <ol> <li data-md> <p>Run <a data-link-type="dfn" href="#abort-all-active-watchadvertisements" id="ref-for-abort-all-active-watchadvertisements①">abort all active watchAdvertisements</a> operations.</p> </ol> </div> </div> <div> <h4 class="heading settled" data-level="5.2.3" id="advertising-events"><span class="secno">5.2.3. </span><span class="content">Responding to Advertising Events</span><a class="self-link" href="#advertising-events"></a></h4> <p>When an <a data-link-type="dfn" href="#advertising-event" id="ref-for-advertising-event">advertising event</a> arrives for a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②⑤">BluetoothDevice</a></code> with <code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements⑤">watchingAdvertisements</a></code> set, the UA delivers an "<code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdeviceeventhandlers-advertisementreceived" id="ref-for-eventdef-bluetoothdeviceeventhandlers-advertisementreceived①">advertisementreceived</a></code>" event.</p> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed④"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext③"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothmanufacturerdatamap" id="ref-for-bluetoothmanufacturerdatamap"><c- g>BluetoothManufacturerDataMap</c-></a> { <c- b>readonly</c-> <c- b>maplike</c->&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short" id="ref-for-idl-unsigned-short⑤"><c- b>unsigned</c-> <c- b>short</c-></a>, <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①"><c- b>DataView</c-></a>>; }; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed⑤"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext④"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothservicedatamap" id="ref-for-bluetoothservicedatamap"><c- g>BluetoothServiceDataMap</c-></a> { <c- b>readonly</c-> <c- b>maplike</c->&lt;<a data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid①"><c- n>UUID</c-></a>, <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor②"><c- b>DataView</c-></a>>; }; [ <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed⑥"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext⑤"><c- g>SecureContext</c-></a> ] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetoothadvertisingevent"><code><c- g>BluetoothAdvertisingEvent</c-></code></dfn> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event①"><c- n>Event</c-></a> { <a class="idl-code" data-link-type="constructor" href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent" id="ref-for-dom-bluetoothadvertisingevent-bluetoothadvertisingevent"><c- g>constructor</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString⑧"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEvent/BluetoothAdvertisingEvent(type, init), BluetoothAdvertisingEvent/constructor(type, init)" data-dfn-type="argument" data-export id="dom-bluetoothadvertisingevent-bluetoothadvertisingevent-type-init-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent-type-init-type"></a></dfn>, <a data-link-type="idl-name" href="#dictdef-bluetoothadvertisingeventinit" id="ref-for-dictdef-bluetoothadvertisingeventinit"><c- n>BluetoothAdvertisingEventInit</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEvent/BluetoothAdvertisingEvent(type, init), BluetoothAdvertisingEvent/constructor(type, init)" data-dfn-type="argument" data-export id="dom-bluetoothadvertisingevent-bluetoothadvertisingevent-type-init-init"><code><c- g>init</c-></code><a class="self-link" href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent-type-init-init"></a></dfn>); [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject" id="ref-for-SameObject①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice②⑥"><c- n>BluetoothDevice</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice" href="#dom-bluetoothadvertisingevent-device" id="ref-for-dom-bluetoothadvertisingevent-device"><c- g>device</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-frozen-array" id="ref-for-idl-frozen-array③"><c- b>FrozenArray</c-></a>&lt;<a data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid②"><c- n>UUID</c-></a>> <a class="idl-code" data-link-type="attribute" data-readonly data-type="FrozenArray<UUID>" href="#dom-bluetoothadvertisingevent-uuids" id="ref-for-dom-bluetoothadvertisingevent-uuids"><c- g>uuids</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString⑨"><c- b>DOMString</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString?" href="#dom-bluetoothadvertisingevent-name" id="ref-for-dom-bluetoothadvertisingevent-name"><c- g>name</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short" id="ref-for-idl-unsigned-short⑥"><c- b>unsigned</c-> <c- b>short</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned short?" href="#dom-bluetoothadvertisingevent-appearance" id="ref-for-dom-bluetoothadvertisingevent-appearance"><c- g>appearance</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-byte" id="ref-for-idl-byte"><c- b>byte</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="byte?" href="#dom-bluetoothadvertisingevent-txpower" id="ref-for-dom-bluetoothadvertisingevent-txpower"><c- g>txPower</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-byte" id="ref-for-idl-byte①"><c- b>byte</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="byte?" href="#dom-bluetoothadvertisingevent-rssi" id="ref-for-dom-bluetoothadvertisingevent-rssi"><c- g>rssi</c-></a>; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject" id="ref-for-SameObject②"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothmanufacturerdatamap" id="ref-for-bluetoothmanufacturerdatamap①"><c- n>BluetoothManufacturerDataMap</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothManufacturerDataMap" href="#dom-bluetoothadvertisingevent-manufacturerdata" id="ref-for-dom-bluetoothadvertisingevent-manufacturerdata"><c- g>manufacturerData</c-></a>; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject" id="ref-for-SameObject③"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothservicedatamap" id="ref-for-bluetoothservicedatamap①"><c- n>BluetoothServiceDataMap</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothServiceDataMap" href="#dom-bluetoothadvertisingevent-servicedata" id="ref-for-dom-bluetoothadvertisingevent-servicedata"><c- g>serviceData</c-></a>; }; <c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-bluetoothadvertisingeventinit"><code><c- g>BluetoothAdvertisingEventInit</c-></code></dfn> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit①"><c- n>EventInit</c-></a> { <c- b>required</c-> <a data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice②⑦"><c- n>BluetoothDevice</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="BluetoothDevice " id="dom-bluetoothadvertisingeventinit-device"><code><c- g>device</c-></code><a class="self-link" href="#dom-bluetoothadvertisingeventinit-device"></a></dfn>; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence①④"><c- b>sequence</c-></a>&lt;(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString①⓪"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long" id="ref-for-idl-unsigned-long"><c- b>unsigned</c-> <c- b>long</c-></a>)> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="sequence<(DOMString or unsigned long)> " id="dom-bluetoothadvertisingeventinit-uuids"><code><c- g>uuids</c-></code></dfn>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString①①"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-bluetoothadvertisingeventinit-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-bluetoothadvertisingeventinit-name"></a></dfn>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short" id="ref-for-idl-unsigned-short⑦"><c- b>unsigned</c-> <c- b>short</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="unsigned short " id="dom-bluetoothadvertisingeventinit-appearance"><code><c- g>appearance</c-></code><a class="self-link" href="#dom-bluetoothadvertisingeventinit-appearance"></a></dfn>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-byte" id="ref-for-idl-byte②"><c- b>byte</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="byte " id="dom-bluetoothadvertisingeventinit-txpower"><code><c- g>txPower</c-></code><a class="self-link" href="#dom-bluetoothadvertisingeventinit-txpower"></a></dfn>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-byte" id="ref-for-idl-byte③"><c- b>byte</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="byte " id="dom-bluetoothadvertisingeventinit-rssi"><code><c- g>rssi</c-></code><a class="self-link" href="#dom-bluetoothadvertisingeventinit-rssi"></a></dfn>; <a data-link-type="idl-name" href="#bluetoothmanufacturerdatamap" id="ref-for-bluetoothmanufacturerdatamap②"><c- n>BluetoothManufacturerDataMap</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="BluetoothManufacturerDataMap " id="dom-bluetoothadvertisingeventinit-manufacturerdata"><code><c- g>manufacturerData</c-></code></dfn>; <a data-link-type="idl-name" href="#bluetoothservicedatamap" id="ref-for-bluetoothservicedatamap②"><c- n>BluetoothServiceDataMap</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEventInit" data-dfn-type="dict-member" data-export data-type="BluetoothServiceDataMap " id="dom-bluetoothadvertisingeventinit-servicedata"><code><c- g>serviceData</c-></code></dfn>; }; </pre> <div class="note no-marker" data-link-for-hint="BluetoothAdvertisingEvent" role="note"> <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetoothadvertisingevent" id="ref-for-bluetoothadvertisingevent">BluetoothAdvertisingEvent</a></code> attributes</div> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-device"><code>device</code></dfn> is the <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②⑧">BluetoothDevice</a></code> that sent this advertisement. <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-uuids"><code>uuids</code></dfn> lists the Service UUIDs that this advertisement says <code class="idl"><a data-link-type="idl" href="#dom-bluetoothadvertisingevent-device" id="ref-for-dom-bluetoothadvertisingevent-device①">device</a></code>'s GATT server supports.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-name"><code>name</code></dfn> is <code class="idl"><a data-link-type="idl" href="#dom-bluetoothadvertisingevent-device" id="ref-for-dom-bluetoothadvertisingevent-device②">device</a></code>'s local name, or a prefix of it.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-appearance"><code>appearance</code></dfn> is an <a data-link-type="dfn" href="#appearance" id="ref-for-appearance">Appearance</a>, one of the values defined by the <code class="idl"><a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=gap.appearance" id="ref-for-:~:text=gap.appearance">gap.appearance</a></code> characteristic.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-txpower"><code>txPower</code></dfn> is the transmission power at which the device is broadcasting, measured in dBm. This is used to compute the path loss as <code>this.txPower - this.rssi</code>.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-rssi"><code>rssi</code></dfn> is the power at which the advertisement was received, measured in dBm. This is used to compute the path loss as <code>this.txPower - this.rssi</code>.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-manufacturerdata"><code>manufacturerData</code></dfn> maps <code>unsigned short</code> Company Identifier Codes to <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor③">DataView</a></code>s.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="attribute" data-export id="dom-bluetoothadvertisingevent-servicedata"><code>serviceData</code></dfn> maps <code class="idl"><a data-link-type="idl" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid③">UUID</a></code>s to <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor④">DataView</a></code>s.</p> </div> <div class="example" id="example-interpret-ibeacon"> <a class="self-link" href="#example-interpret-ibeacon"></a> To retrieve a device and read the iBeacon data out of it, a developer could use the following code. Note that this API currently doesn’t provide a way to request devices with certain manufacturer data, so the iBeacon will need to rotate its advertisements to include a known service in order for users to select this device in the <code>requestDevice</code> dialog. <pre class="highlight"><c- a>var</c-> known_service <c- o>=</c-> <c- u>"A service in the iBeacon’s GATT server"</c-><c- p>;</c-> <c- k>return</c-> navigator<c- p>.</c->bluetooth<c- p>.</c->requestDevice<c- p>({</c-> filters<c- o>:</c-> <c- p>[{</c->services<c- o>:</c-> <c- p>[</c->known_service<c- p>]}]</c-> <c- p>}).</c->then<c- p>(</c->device <c- p>=></c-> <c- p>{</c-> device<c- p>.</c->watchAdvertisements<c- p>();</c-> device<c- p>.</c->addEventListener<c- p>(</c-><c- t>'advertisementreceived'</c-><c- p>,</c-> interpretIBeacon<c- p>);</c-> <c- p>});</c-> <c- a>function</c-> interpretIBeacon<c- p>(</c->event<c- p>)</c-> <c- p>{</c-> <c- a>var</c-> rssi <c- o>=</c-> event<c- p>.</c->rssi<c- p>;</c-> <c- a>var</c-> appleData <c- o>=</c-> event<c- p>.</c->manufacturerData<c- p>.</c->get<c- p>(</c-><a href="https://www.bluetooth.org/en-us/specification/assigned-numbers/company-identifiers" title="Apple, Inc.&apos;s Company Identifier"><c- mh>0x004C</c-></a><c- p>);</c-> <c- k>if</c-> <c- p>(</c->appleData<c- p>.</c->byteLength <c- o>!=</c-> <c- mf>23</c-> <c- o>||</c-> appleData<c- p>.</c->getUint16<c- p>(</c-><c- mf>0</c-><c- p>,</c-> <c- kc>false</c-><c- p>)</c-> <c- o>!==</c-> <c- mh>0x0215</c-><c- p>)</c-> <c- p>{</c-> console<c- p>.</c->log<c- p>({</c->isBeacon<c- o>:</c-> <c- kc>false</c-><c- p>});</c-> <c- p>}</c-> <c- a>var</c-> uuidArray <c- o>=</c-> <c- ow>new</c-> Uint8Array<c- p>(</c->appleData<c- p>.</c->buffer<c- p>,</c-> <c- mf>2</c-><c- p>,</c-> <c- mf>16</c-><c- p>);</c-> <c- a>var</c-> major <c- o>=</c-> appleData<c- p>.</c->getUint16<c- p>(</c-><c- mf>18</c-><c- p>,</c-> <c- kc>false</c-><c- p>);</c-> <c- a>var</c-> minor <c- o>=</c-> appleData<c- p>.</c->getUint16<c- p>(</c-><c- mf>20</c-><c- p>,</c-> <c- kc>false</c-><c- p>);</c-> <c- a>var</c-> txPowerAt1m <c- o>=</c-> <c- o>-</c->appleData<c- p>.</c->getInt8<c- p>(</c-><c- mf>22</c-><c- p>);</c-> console<c- p>.</c->log<c- p>({</c-> isBeacon<c- o>:</c-> <c- kc>true</c-><c- p>,</c-> uuidArray<c- p>,</c-> major<c- p>,</c-> minor<c- p>,</c-> pathLossVs1m<c- o>:</c-> txPowerAt1m <c- o>-</c-> rssi<c- p>});</c-> <c- p>});</c-> </pre> <p>The format of iBeacon advertisements was derived from <a href="http://www.warski.org/blog/2014/01/how-ibeacons-work/">How do iBeacons work?</a> by Adam Warski.</p> </div> <div class="algorithm" data-algorithm="received advertising event" id="advertising-event-algorithm"> When the UA receives an <a data-link-type="dfn" href="#advertising-event" id="ref-for-advertising-event①">advertising event</a> (consisting of an advertising packet and an optional scan response), it MUST run the following steps: <ol> <li data-md> <p>Let <var>device</var> be the <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①⑥">Bluetooth device</a> that sent the advertising event.</p> <li data-md> <p>For each <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice②⑨">BluetoothDevice</a></code> <var>deviceObj</var> in the UA such that <var>device</var> is the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device⑤">same device</a> as <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot④">[[representedDevice]]</a></code></code>, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑨">queue a task</a> on <var>deviceObj</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object①">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop①">responsible event loop</a> to do the following sub-steps:</p> <ol> <li data-md> <p>If <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchingadvertisements" id="ref-for-dom-bluetoothdevice-watchingadvertisements⑥">watchingAdvertisements</a></code></code> is <code>false</code>, abort these sub-steps.</p> <li data-md> <p><a data-link-type="dfn" href="#fire-an-advertisementreceived-event" id="ref-for-fire-an-advertisementreceived-event">Fire an <code>advertisementreceived</code> event</a> for the advertising event at <var>deviceObj</var>.</p> </ol> </ol> </div> <div class="algorithm" data-algorithm="fire advertisementreceived event"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="fire-an-advertisementreceived-event">fire an <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdeviceeventhandlers-advertisementreceived" id="ref-for-eventdef-bluetoothdeviceeventhandlers-advertisementreceived②">advertisementreceived</a></code> event</dfn> for an advertising event <var>adv</var> at a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③⓪">BluetoothDevice</a></code> <var>deviceObj</var>, the UA MUST perform the following steps: <ol> <li data-md> <p>Let <var>event</var> be</p> <pre class="highlight"><c- p>{</c-> bubbles<c- o>:</c-> <c- kc>true</c-><c- p>,</c-> device<c- o>:</c-> <var>deviceObj</var><c- p>,</c-> uuids<c- o>:</c-> <c- p>[],</c-> manufacturerData<c- o>:</c-> <c- ow>new</c-> Map<c- p>(),</c-> serviceData<c- o>:</c-> <c- ow>new</c-> Map<c- p>()</c-> <c- p>}</c-> </pre> <li data-md> <p>If the <a data-link-type="dfn" href="#rssi" id="ref-for-rssi">received signal strength</a> is available for any packet in <var>adv</var>, set <code><var>event</var>.rssi</code> to this signal strength in dBm.</p> <li data-md> <p>For each <a data-link-type="dfn" href="#ad-structure" id="ref-for-ad-structure">AD structure</a> in <var>adv</var>’s advertising packet and scan response, select from the following steps depending on the AD type:</p> <dl class="switch"> <dt> Incomplete List of 16-bit <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type②">Service UUIDs</a> <dt> Complete List of 16-bit <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type③">Service UUIDs</a> <dt> Incomplete List of 32-bit <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type④">Service UUIDs</a> <dt> Complete List of 32-bit <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type⑤">Service UUIDs</a> <dt> Incomplete List of 128-bit <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type⑥">Service UUIDs</a> <dt> Complete List of 128-bit <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type⑦">Service UUIDs</a> <dd> For each <code><var>uuid</var></code> in the listed UUIDs, if it is in <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot②">[[allowedServices]]</a></code></code>, then append <code><var>uuid</var></code> to <code><var>event</var>.uuids</code>. <dt>Shortened <a data-link-type="dfn" href="#local-name-data-type" id="ref-for-local-name-data-type">Local Name</a> <dt>Complete <a data-link-type="dfn" href="#local-name-data-type" id="ref-for-local-name-data-type①">Local Name</a> <dd> <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom" id="ref-for-utf-8-decode-without-bom①">UTF-8 decode without BOM</a> the AD data and set <code><var>event</var>.name</code> to the result. <div class="note" role="note"> Note: We don’t expose whether the name is complete because existing APIs require reading the raw advertisement to get this information, and we want more evidence that it’s useful before adding a field to the API. </div> <dt><a data-link-type="dfn" href="#manufacturer-specific-data" id="ref-for-manufacturer-specific-data③">Manufacturer Specific Data</a> <dd> For each 16-bit Company Identifier Code <code><var>manufacturerCode</var></code>, if it is in <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedmanufacturerdata-slot" id="ref-for-dom-bluetoothdevice-allowedmanufacturerdata-slot">[[allowedManufacturerData]]</a></code></code>, and the manufacturer data is not a <a data-link-type="dfn" href="#blocklisted-manufacturer-data" id="ref-for-blocklisted-manufacturer-data">blocklisted manufacturer data</a> then add a mapping of <code><var>manufacturerCode</var></code> to an <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor">ArrayBuffer</a></code> containing the manufacturer-specific data to <code><var>event</var>.manufacturerData</code>. <dt><a data-link-type="dfn" href="#tx-power-level" id="ref-for-tx-power-level">TX Power Level</a> <dd> Set <code><var>event</var>.txPower</code> to the AD data. <dt><a data-link-type="dfn" href="#service-data" id="ref-for-service-data③">Service Data</a> - 16 bit UUID <dt><a data-link-type="dfn" href="#service-data" id="ref-for-service-data④">Service Data</a> - 32 bit UUID <dt><a data-link-type="dfn" href="#service-data" id="ref-for-service-data⑤">Service Data</a> - 128 bit UUID <dd> For each <a data-link-type="dfn" href="#uuid" id="ref-for-uuid①">UUID</a> <code><var>uuid</var></code> in the service data, if it is in <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot③">[[allowedServices]]</a></code></code>, then add a mapping of <var>uuid</var> to an <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor①">ArrayBuffer</a></code> containing the service data to <code><var>event</var>.serviceData</code>. <dt><a data-link-type="dfn" href="#appearance" id="ref-for-appearance①">Appearance</a> <dd> Set <code><var>event</var>.appearance</code> to the AD data. <dt>Otherwise <dd>Skip to the next AD structure. </dl> <li data-md> <p><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire①">Fire an event</a> named "<code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdeviceeventhandlers-advertisementreceived" id="ref-for-eventdef-bluetoothdeviceeventhandlers-advertisementreceived③">advertisementreceived</a></code>" using <code class="idl"><a data-link-type="idl" href="#bluetoothadvertisingevent" id="ref-for-bluetoothadvertisingevent①">BluetoothAdvertisingEvent</a></code> initialized with <var>event</var>), with its <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-event-istrusted" id="ref-for-dom-event-istrusted">isTrusted</a></code> attribute initialized to <code>true</code>, at <var>deviceObj</var>.</p> </ol> </div> <p>All fields in <code class="idl"><a data-link-type="idl" href="#bluetoothadvertisingevent" id="ref-for-bluetoothadvertisingevent②">BluetoothAdvertisingEvent</a></code> return the last value they were initialized or set to.</p> <div class="algorithm" data-algorithm="BluetoothAdvertisingEvent contructor"> The <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothAdvertisingEvent" data-dfn-type="constructor" data-export data-lt="BluetoothAdvertisingEvent(type, init)|constructor(type, init)" id="dom-bluetoothadvertisingevent-bluetoothadvertisingevent"><code>BluetoothAdvertisingEvent(type, init)</code></dfn> constructor MUST perform the following steps: <ol> <li data-md> <p>Let <var>event</var> be the result of running the steps from <a href="https://dom.spec.whatwg.org/#constructing-events"><cite>DOM</cite> § 2.5 Constructing events</a> except for the <code class="idl"><a data-link-type="idl" href="#dom-bluetoothadvertisingeventinit-uuids" id="ref-for-dom-bluetoothadvertisingeventinit-uuids">uuids</a></code>, <code class="idl"><a data-link-type="idl" href="#dom-bluetoothadvertisingeventinit-manufacturerdata" id="ref-for-dom-bluetoothadvertisingeventinit-manufacturerdata">manufacturerData</a></code>, and <code class="idl"><a data-link-type="idl" href="#dom-bluetoothadvertisingeventinit-servicedata" id="ref-for-dom-bluetoothadvertisingeventinit-servicedata">serviceData</a></code> members.</p> <li data-md> <p>If <code><var>init</var>.uuids</code> is set, initialize <code><var>event</var>.uuids</code> to a new <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-frozen-array" id="ref-for-idl-frozen-array④">FrozenArray</a></code> containing the elements of <code><var>init</var>.uuids.map( <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice⑤">BluetoothUUID.getService</a></code>)</code>. Otherwise initialize <code><var>event</var>.uuids</code> to an empty <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-frozen-array" id="ref-for-idl-frozen-array⑤">FrozenArray</a></code>.</p> <li data-md> <p>For each mapping in <code><var>init</var>.manufacturerData</code>:</p> <ol> <li data-md> <p>Let <var>code</var> be the key converted to an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-unsigned-short" id="ref-for-idl-unsigned-short⑧">unsigned short</a></code>.</p> <li data-md> <p>Let <var>value</var> be the value.</p> <li data-md> <p>If <var>value</var> is not a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#BufferSource" id="ref-for-BufferSource②">BufferSource</a></code>, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①④">TypeError</a></code>.</p> <li data-md> <p>Let <var>bytes</var> be a new <a data-link-type="dfn" href="#read-only-arraybuffer" id="ref-for-read-only-arraybuffer">read only ArrayBuffer</a> containing <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy④">a copy of the bytes held</a> by <var>value</var>.</p> <li data-md> <p>Add a mapping from <var>code</var> to <code>new DataView(<var>bytes</var>)</code> in <code><var>event</var>.manufacturerData.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothmanufacturerdatamap-backingmap-slot" id="ref-for-dom-bluetoothmanufacturerdatamap-backingmap-slot">[[BackingMap]]</a></code></code>.</p> </ol> <li data-md> <p>For each mapping in <code><var>init</var>.serviceData</code>:</p> <ol> <li data-md> <p>Let <var>key</var> be the key.</p> <li data-md> <p>Let <var>service</var> be the result of calling <code>BluetoothUUID.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice⑥">getService</a></code>(<var>key</var>).</code></p> <li data-md> <p>Let <var>value</var> be the value.</p> <li data-md> <p>If <var>value</var> is not a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#BufferSource" id="ref-for-BufferSource③">BufferSource</a></code>, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①⑤">TypeError</a></code>.</p> <li data-md> <p>Let <var>bytes</var> be a new <a data-link-type="dfn" href="#read-only-arraybuffer" id="ref-for-read-only-arraybuffer①">read only ArrayBuffer</a> containing <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy⑤">a copy of the bytes held</a> by <var>value</var>.</p> <li data-md> <p>Add a mapping from <var>service</var> to <code>new DataView(<var>bytes</var>)</code> in <code><var>event</var>.serviceData.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothservicedatamap-backingmap-slot" id="ref-for-dom-bluetoothservicedatamap-backingmap-slot">[[BackingMap]]</a></code></code>.</p> </ol> <li data-md> <p>Return <var>event</var>.</p> </ol> </div> <section> <h5 class="heading settled dfn-paneled idl-code" data-dfn-type="interface" data-export data-level="5.2.3.1" data-lt="BluetoothManufacturerDataMap" id="bluetoothmanufacturerdatamap"><span class="secno">5.2.3.1. </span><span class="content">BluetoothManufacturerDataMap</span><a class="self-link" href="#bluetoothmanufacturerdatamap" id="ref-for-bluetoothmanufacturerdatamap④"></a></h5> <p> Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothmanufacturerdatamap" id="ref-for-bluetoothmanufacturerdatamap③">BluetoothManufacturerDataMap</a></code> have a <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothManufacturerDataMap" data-dfn-type="attribute" data-export id="dom-bluetoothmanufacturerdatamap-backingmap-slot"><code>[[BackingMap]]</code></dfn> slot because they are <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#dfn-maplike" id="ref-for-dfn-maplike">maplike</a>, which maps manufacturer codes to the manufacturer’s data, converted to <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor⑤">DataView</a></code>s. </p> </section> <section> <h5 class="heading settled dfn-paneled idl-code" data-dfn-type="interface" data-export data-level="5.2.3.2" data-lt="BluetoothServiceDataMap" id="bluetoothservicedatamap"><span class="secno">5.2.3.2. </span><span class="content">BluetoothServiceDataMap</span><a class="self-link" href="#bluetoothservicedatamap" id="ref-for-bluetoothservicedatamap④"></a></h5> <p> Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothservicedatamap" id="ref-for-bluetoothservicedatamap③">BluetoothServiceDataMap</a></code> have a <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothServiceDataMap" data-dfn-type="attribute" data-export id="dom-bluetoothservicedatamap-backingmap-slot"><code>[[BackingMap]]</code></dfn> slot because they are <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#dfn-maplike" id="ref-for-dfn-maplike①">maplike</a>, which maps service UUIDs to the service’s data, converted to <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor⑥">DataView</a></code>s. </p> </section> </div> <h2 class="heading settled" data-level="6" id="gatt-interaction"><span class="secno">6. </span><span class="content">GATT Interaction</span><a class="self-link" href="#gatt-interaction"></a></h2> <h3 class="heading settled" data-level="6.1" id="information-model"><span class="secno">6.1. </span><span class="content">GATT Information Model</span><a class="self-link" href="#information-model"></a></h3> <div class="note" role="note"> The <a data-link-type="dfn" href="#gatt-profile-hierarchy" id="ref-for-gatt-profile-hierarchy">GATT Profile Hierarchy</a> describes how a <a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver②">GATT Server</a> contains a hierarchy of Profiles, Primary <a data-link-type="dfn" href="#service" id="ref-for-service⑤">Service</a>s, <a data-link-type="dfn" href="#included-service" id="ref-for-included-service">Included Service</a>s, <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic②">Characteristic</a>s, and <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor②">Descriptor</a>s. <p>Profiles are purely logical: the specification of a Profile describes the expected interactions between the other GATT entities the Profile contains, but it’s impossible to query which Profiles a device supports.</p> <p><a data-link-type="dfn" href="#gatt-client" id="ref-for-gatt-client">GATT Client</a>s can discover and interact with the Services, Characteristics, and Descriptors on a device using a set of <a data-link-type="dfn" href="#gatt-procedure" id="ref-for-gatt-procedure">GATT procedures</a>. This spec refers to Services, Characteristics, and Descriptors collectively as <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="attribute">Attribute</dfn>s. All Attributes have a type that’s identified by a <a data-link-type="dfn" href="#uuid" id="ref-for-uuid②">UUID</a>. Each Attribute also has a 16-bit <a data-link-type="dfn" href="#attribute-handle" id="ref-for-attribute-handle">Attribute Handle</a> that distinguishes it from other Attributes of the same type on the same <a data-link-type="dfn" href="#gatt-server" id="ref-for-gatt-server②">GATT Server</a>. Attributes are notionally ordered within their <a data-link-type="dfn" href="#gatt-server" id="ref-for-gatt-server③">GATT Server</a> by their <a data-link-type="dfn" href="#attribute-handle" id="ref-for-attribute-handle①">Attribute Handle</a>, but while platform interfaces provide attributes in some order, they do not guarantee that it’s consistent with the <a data-link-type="dfn" href="#attribute-handle" id="ref-for-attribute-handle②">Attribute Handle</a> order.</p> <p data-link-for-hint="BluetoothRemoteGATTService"> A <a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①">Service</a> contains a collection of <a data-link-type="idl" href="#dom-bluetoothremotegattservice-getincludedservice" id="ref-for-dom-bluetoothremotegattservice-getincludedservice">Included Service</a>s and <a data-link-type="idl" href="#dom-bluetoothremotegattservice-getcharacteristic" id="ref-for-dom-bluetoothremotegattservice-getcharacteristic③">Characteristic</a>s. The Included Services are references to other Services, and a single Service can be included by more than one other Service. Services are known as <a data-link-type="idl" href="#dom-bluetoothremotegattservice-isprimary" id="ref-for-dom-bluetoothremotegattservice-isprimary">Primary Services</a> if they appear directly under the <a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver③">GATT Server</a>, and Secondary Services if they’re only included by other Services, but Primary Services can also be included. </p> <p data-link-for-hint="BluetoothRemoteGATTCharacteristic"> A <a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②">Characteristic</a> contains a value, which is an array of bytes, and a collection of <a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-getdescriptor" id="ref-for-dom-bluetoothremotegattcharacteristic-getdescriptor">Descriptor</a>s. Depending on the <a data-link-type="idl" href="#bluetoothcharacteristicproperties" id="ref-for-bluetoothcharacteristicproperties">properties</a> of the Characteristic, a <a data-link-type="dfn" href="#gatt-client" id="ref-for-gatt-client①">GATT Client</a> can read or write its value, or register to be notified when the value changes. </p> <p>Finally, a <a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor①">Descriptor</a> contains a value (again an array of bytes) that describes or configures its <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic③">Characteristic</a>.</p> </div> <h4 class="heading settled" data-level="6.1.1" id="persistence"><span class="secno">6.1.1. </span><span class="content">Persistence across connections</span><a class="self-link" href="#persistence"></a></h4> <p>The Bluetooth <a data-link-type="dfn" href="#attribute-caching" id="ref-for-attribute-caching">Attribute Caching</a> system allows <a data-link-type="dfn" href="#bond" id="ref-for-bond">bonded</a> clients to save references to attributes from one connection to the next. Web Bluetooth treats websites as <em>not</em> <a data-link-type="dfn" href="#bond" id="ref-for-bond①">bonded</a> to devices they have permission to access: <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②">BluetoothRemoteGATTService</a></code>, <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic③">BluetoothRemoteGATTCharacteristic</a></code>, and <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor②">BluetoothRemoteGATTDescriptor</a></code> objects become invalid on <a href="#disconnection-events">disconnection</a>, and the site must retrieved them again when it re-connects.</p> <h4 class="heading settled" data-level="6.1.2" id="bluetooth-cache"><span class="secno">6.1.2. </span><span class="content">The Bluetooth cache</span><a class="self-link" href="#bluetooth-cache"></a></h4> <p>The UA MUST maintain a <dfn class="dfn-paneled" data-dfn-for="Bluetooth cache" data-dfn-type="dfn" data-noexport id="bluetooth-cache-bluetooth-cache">Bluetooth cache</dfn> 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 entry in the cache is either known-present, known-absent, or unknown. The cache MUST NOT contain two entries that are for the <a data-link-type="dfn" href="#same-attribute" id="ref-for-same-attribute">same attribute</a>. Each known-present entry in the cache is associated with an optional <code>Promise&lt;<code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice③">BluetoothRemoteGATTService</a></code>></code>, <code>Promise&lt;<code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic④">BluetoothRemoteGATTCharacteristic</a></code>></code>, or <code>Promise&lt;<code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor③">BluetoothRemoteGATTDescriptor</a></code>></code> instance for each <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth⑨">Bluetooth</a></code> instance.</p> <div class="note" role="note"> Note: For example, if a user calls the <code>serviceA.getCharacteristic(uuid1)</code> function with an initially empty <a data-link-type="dfn" href="#bluetooth-cache-bluetooth-cache" id="ref-for-bluetooth-cache-bluetooth-cache②">Bluetooth cache</a>, the UA uses the <a data-link-type="dfn" href="#discover-characteristics-by-uuid" id="ref-for-discover-characteristics-by-uuid">Discover Characteristics by UUID</a> procedure to fill the needed cache entries, and the UA ends the procedure early because it only needs one Characteristic to fulfil the returned <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects⑤">Promise</a></code>, then the first Characteristic with UUID <code>uuid1</code> inside <code>serviceA</code> is known-present, and any subsequent Characteristics with that UUID remain unknown. If the user later calls <code>serviceA.getCharacteristics(uuid1)</code>, the UA needs to resume or restart the <a data-link-type="dfn" href="#discover-characteristics-by-uuid" id="ref-for-discover-characteristics-by-uuid①">Discover Characteristics by UUID</a> procedure. If it turns out that <code>serviceA</code> only has one Characteristic with UUID <code>uuid1</code>, then the subsequent Characteristics become known-absent. </div> <p>The known-present entries in the <a data-link-type="dfn" href="#bluetooth-cache-bluetooth-cache" id="ref-for-bluetooth-cache-bluetooth-cache③">Bluetooth cache</a> 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 <a data-link-type="dfn" href="#attribute-handle" id="ref-for-attribute-handle③">Attribute Handle</a>s on the device, but UAs MAY use another order if the device’s order isn’t available.</p> <div class="algorithm" data-algorithm="populate Bluetooth cache"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="populate-the-bluetooth-cache">populate the Bluetooth cache</dfn> with entries matching some description, the UA MUST run the following steps. <div class="note" role="note"> Note: These steps can block, so uses of this algorithm must be <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑤">in parallel</a>. </div> <ol> <li data-md> <p>Attempt to make all matching entries in the cache either known-present or known-absent, using any sequence of <a data-link-type="dfn" href="#gatt-procedure" id="ref-for-gatt-procedure①">GATT procedures</a> that <a data-link-type="biblio" href="#biblio-bluetooth42" title="BLUETOOTH SPECIFICATION Version 4.2">[BLUETOOTH42]</a> specifies will return enough information. Handle errors as described in <a href="#error-handling">§ 6.7 Error handling</a>.</p> <li data-md> <p>If the previous step returns an error, return that error from this algorithm.</p> </ol> </div> <div class="algorithm" data-algorithm="query Bluetooth cache"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="query-the-bluetooth-cache">query the Bluetooth cache</dfn> in a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③①">BluetoothDevice</a></code> instance <var>deviceObj</var> for entries matching some description, the UA MUST return a <code><var>deviceObj</var>.gatt</code>-<a data-link-type="dfn" href="#connection-checking-wrapper" id="ref-for-connection-checking-wrapper">connection-checking wrapper</a> around <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise⑤">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑥">in parallel</a>: <ol> <li data-md> <p><a data-link-type="dfn" href="#populate-the-bluetooth-cache" id="ref-for-populate-the-bluetooth-cache②">Populate the Bluetooth cache</a> with entries matching the description.</p> <li data-md> <p>If the previous step returns an error, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject⑨">reject</a> <var>promise</var> with that error and abort these steps.</p> <li data-md> <p>Let <var>entries</var> be the sequence of known-present cache entries matching the description.</p> <li data-md> <p>Let <var>context</var> be <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-context-slot" id="ref-for-dom-bluetoothdevice-context-slot①">[[context]]</a></code></code>.</p> <li data-md> <p>Let <var>result</var> be a new sequence.</p> <li data-md> <p>For each <var>entry</var> in <var>entries</var>:</p> <ol> <li data-md> <p>If <var>entry</var> has no associated <code>Promise&lt;BluetoothGATT*></code> instance in <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-attributeinstancemap-slot" id="ref-for-dom-bluetooth-attributeinstancemap-slot">[[attributeInstanceMap]]</a></code>, <a data-link-type="dfn" href="#create-a-bluetoothremotegattservice-representing" id="ref-for-create-a-bluetoothremotegattservice-representing">create a <code>BluetoothRemoteGATTService</code> representing</a> <var>entry</var>, <a data-link-type="dfn" href="#create-a-bluetoothremotegattcharacteristic-representing" id="ref-for-create-a-bluetoothremotegattcharacteristic-representing">create a <code>BluetoothRemoteGATTCharacteristic</code> representing</a> <var>entry</var>, or <a data-link-type="dfn" href="#create-a-bluetoothremotegattdescriptor-representing" id="ref-for-create-a-bluetoothremotegattdescriptor-representing">create a <code>BluetoothRemoteGATTDescriptor</code> representing</a> <var>entry</var>, depending on whether <var>entry</var> is a Service, Characteristic, or Descriptor, and add a mapping from <var>entry</var> to the resulting <code>Promise</code> in <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-attributeinstancemap-slot" id="ref-for-dom-bluetooth-attributeinstancemap-slot①">[[attributeInstanceMap]]</a></code>.</p> <li data-md> <p>Append to <var>result</var> the <code>Promise&lt;BluetoothGATT*></code> instance associated with <var>entry</var> in <var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-attributeinstancemap-slot" id="ref-for-dom-bluetooth-attributeinstancemap-slot②">[[attributeInstanceMap]]</a></code>.</p> </ol> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve①②">Resolve</a> <var>promise</var> with the result of <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#wait-for-all" id="ref-for-wait-for-all">waiting for all</a> elements of <var>result</var>.</p> </ol> </div> <div class="algorithm" data-algorithm="represented properties"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="represented">Represented</dfn>(<var>obj</var>: Device or GATT Attribute) returns, depending on the type of <var>obj</var>: <dl class="switch"> <dt><code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③②">BluetoothDevice</a></code> <dd><code><var>obj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot⑤">[[representedDevice]]</a></code></code> <dt><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice④">BluetoothRemoteGATTService</a></code> <dd><code><var>obj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-representedservice-slot" id="ref-for-dom-bluetoothremotegattservice-representedservice-slot">[[representedService]]</a></code></code> <dt><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic⑤">BluetoothRemoteGATTCharacteristic</a></code> <dd><code><var>obj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot">[[representedCharacteristic]]</a></code></code> <dt><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor④">BluetoothRemoteGATTDescriptor</a></code> <dd><code><var>obj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot">[[representedDescriptor]]</a></code></code> </dl> </div> <h4 class="heading settled" data-level="6.1.3" id="navigating-bluetooth-hierarchy"><span class="secno">6.1.3. </span><span class="content">Navigating the Bluetooth Hierarchy</span><a class="self-link" href="#navigating-bluetooth-hierarchy"></a></h4> <div class="algorithm" data-algorithm="get GATT children"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="getgattchildren">GetGATTChildren</dfn>(<span class="argument-list"> <var>attribute</var>: GATT Attribute,<br> <var>single</var>: boolean,<br> <var>uuidCanonicalizer</var>: function,<br> <var>uuid</var>: optional <code>(DOMString or unsigned int)</code>,<br> <var>allowedUuids</var>: optional <code>("all" or Array&lt;DOMString>)</code>,<br> <var>child type</var>: GATT declaration type),</span><br> the UA MUST perform the following steps: <ol> <li data-md> <p>If <var>uuid</var> is present, set it to <var>uuidCanonicalizer</var>(<var>uuid</var>). If <var>uuidCanonicalizer</var> threw an exception, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with">a promise rejected with</a> that exception and abort these steps.</p> <li data-md> <p>If <var>uuid</var> is present and is <a data-link-type="dfn" href="#blocklisted" id="ref-for-blocklisted③">blocklisted</a>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror⑦">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>deviceObj</var> be, depending on the type of <var>attribute</var>:</p> <dl class="switch"> <dt><code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③③">BluetoothDevice</a></code> <dd><code><var>attribute</var></code> <dt><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice⑤">BluetoothRemoteGATTService</a></code> <dd><code><var>attribute</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-device" id="ref-for-dom-bluetoothremotegattservice-device">device</a></code></code> <dt><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic⑥">BluetoothRemoteGATTCharacteristic</a></code> <dd><code> <var>attribute</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-service" id="ref-for-dom-bluetoothremotegattcharacteristic-service">service</a></code>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-device" id="ref-for-dom-bluetoothremotegattservice-device①">device</a></code> </code> </dl> <li data-md> <p>If <code><var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected①">connected</a></code></code> is <code>false</code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with②">a promise rejected with</a> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror">NetworkError</a></code> and abort these steps.</p> <li data-md> <p>If <a data-link-type="dfn" href="#represented" id="ref-for-represented">Represented</a>(<var>attribute</var>) is <code>null</code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with③">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidstateerror" id="ref-for-invalidstateerror②">InvalidStateError</a></code> and abort these steps.</p> <p class="note" role="note"><span class="marker">Note:</span> This happens when a Service or Characteristic is removed from the device or invalidated by a disconnection, and then its object is used again.</p> <li data-md> <p><a data-link-type="dfn" href="#query-the-bluetooth-cache" id="ref-for-query-the-bluetooth-cache">Query the Bluetooth cache</a> in <code><var>deviceObj</var></code> for entries that:</p> <ul> <li data-md> <p>are within <a data-link-type="dfn" href="#represented" id="ref-for-represented①">Represented</a>(<var>attribute</var>),</p> <li data-md> <p>have a type described by <var>child type</var>,</p> <li data-md> <p>have a UUID that is not <a data-link-type="dfn" href="#blocklisted" id="ref-for-blocklisted④">blocklisted</a>,</p> <li data-md> <p>if <var>uuid</var> is present, have a UUID of <var>uuid</var>,</p> <li data-md> <p>if <var>allowedUuids</var> is present and not <code>"all"</code>, have a UUID in <var>allowedUuids</var>, and</p> <li data-md> <p>if the <var>single</var> flag is set, are the first of these.</p> </ul> <p>Let <var>promise</var> be the result.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#upon-fulfillment" id="ref-for-upon-fulfillment">Upon fulfillment</a> of <var>promise</var> with <var>result</var>, run the following steps:</p> <ul> <li data-md> <p>If <var>result</var> is empty, throw a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#notfounderror" id="ref-for-notfounderror②">NotFoundError</a></code>,</p> <p></p> <li data-md> <p>Otherwise, if the <var>single</var> flag is set, returns the first (only) element of <var>result</var>.</p> <li data-md> <p>Otherwise, return <var>result</var>.</p> </ul> </ol> </div> <h4 class="heading settled" data-level="6.1.4" id="identifying-attributes"><span class="secno">6.1.4. </span><span class="content">Identifying Services, Characteristics, and Descriptors</span><a class="self-link" href="#identifying-attributes"></a></h4> <p>When checking whether two Services, Characteristics, or Descriptors <var>a</var> and <var>b</var> are the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="same-attribute">same attribute</dfn>, the UA SHOULD determine that they are the same if <var>a</var> and <var>b</var> are inside the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device⑥">same device</a> and have the same <a data-link-type="dfn" href="#attribute-handle" id="ref-for-attribute-handle④">Attribute Handle</a>, but MAY use any algorithm it wants with the constraint that <var>a</var> and <var>b</var> MUST NOT be considered the <a data-link-type="dfn" href="#same-attribute" id="ref-for-same-attribute①">same attribute</a> if they fit any of the following conditions:</p> <ul> <li data-md> <p>They are not both Services, both Characteristics, or both Descriptors.</p> <li data-md> <p>They are both Services, but are not both primary or both secondary services.</p> <li data-md> <p>They have different UUIDs.</p> <li data-md> <p>Their parent Devices aren’t the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device⑦">same device</a> or their parent Services or Characteristics aren’t the <a data-link-type="dfn" href="#same-attribute" id="ref-for-same-attribute②">same attribute</a>.</p> </ul> <div class="note" role="note"> Note: This definition is loose because platform APIs expose their own notion of identity without documenting whether it’s based on <a data-link-type="dfn" href="#attribute-handle" id="ref-for-attribute-handle⑤">Attribute Handle</a> equality. </div> <div class="note" role="note"> Note: For two Javascript objects <var>x</var> and <var>y</var> representing Services, Characteristics, or Descriptors, <code><var>x</var> === <var>y</var></code> returns whether the objects represent the <a data-link-type="dfn" href="#same-attribute" id="ref-for-same-attribute③">same attribute</a>, because of how the <a data-link-type="dfn" href="#query-the-bluetooth-cache" id="ref-for-query-the-bluetooth-cache①">query the Bluetooth cache</a> algorithm creates and caches new objects. </div> <h3 class="heading settled" data-level="6.2" id="bluetoothgattremoteserver-interface"><span class="secno">6.2. </span><span class="content">BluetoothRemoteGATTServer</span><a class="self-link" href="#bluetoothgattremoteserver-interface"></a></h3> <p><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver④">BluetoothRemoteGATTServer</a></code> represents a <a data-link-type="dfn" href="#gatt-server" id="ref-for-gatt-server④">GATT Server</a> on a remote device.</p> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed⑦"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext⑥"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetoothremotegattserver"><code><c- g>BluetoothRemoteGATTServer</c-></code></dfn> { [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject" id="ref-for-SameObject④"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice③④"><c- n>BluetoothDevice</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice" href="#dom-bluetoothremotegattserver-device" id="ref-for-dom-bluetoothremotegattserver-device①"><c- g>device</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean⑤"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected②"><c- g>connected</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise⑤"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver⑤"><c- n>BluetoothRemoteGATTServer</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-connect" id="ref-for-dom-bluetoothremotegattserver-connect②"><c- g>connect</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined" id="ref-for-idl-undefined②"><c- b>undefined</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-disconnect" id="ref-for-dom-bluetoothremotegattserver-disconnect①"><c- g>disconnect</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise⑥"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice⑥"><c- n>BluetoothRemoteGATTService</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-getprimaryservice" id="ref-for-dom-bluetoothremotegattserver-getprimaryservice①"><c- g>getPrimaryService</c-></a>(<a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑤"><c- n>BluetoothServiceUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTServer/getPrimaryService(service)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattserver-getprimaryservice-service-service"><code><c- g>service</c-></code><a class="self-link" href="#dom-bluetoothremotegattserver-getprimaryservice-service-service"></a></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise⑦"><c- b>Promise</c-></a>&lt;<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence①⑤"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice⑦"><c- n>BluetoothRemoteGATTService</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-getprimaryservices" id="ref-for-dom-bluetoothremotegattserver-getprimaryservices"><c- g>getPrimaryServices</c-></a>(<c- b>optional</c-> <a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑥"><c- n>BluetoothServiceUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTServer/getPrimaryServices(service), BluetoothRemoteGATTServer/getPrimaryServices()" data-dfn-type="argument" data-export id="dom-bluetoothremotegattserver-getprimaryservices-service-service"><code><c- g>service</c-></code><a class="self-link" href="#dom-bluetoothremotegattserver-getprimaryservices-service-service"></a></dfn>); }; </pre> <div class="note no-marker" role="note"> <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver⑥">BluetoothRemoteGATTServer</a></code> attributes</div> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattserver-device"><code>device</code></dfn> is the device running this server. <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattserver-connected"><code>connected</code></dfn> is true while this instance is connected to <code>this.device</code>. It can be false while the UA is physically connected, for example when there are other connected <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver⑦">BluetoothRemoteGATTServer</a></code> instances for other <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#global-object" id="ref-for-global-object③">global object</a>s.</p> </div> <p>When no ECMAScript code can observe an instance of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver⑧">BluetoothRemoteGATTServer</a></code> <var>server</var> anymore, the UA SHOULD run <code><var>server</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-disconnect" id="ref-for-dom-bluetoothremotegattserver-disconnect②">disconnect()</a></code></code>.</p> <div class="note" role="note"> Note: Because <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③⑤">BluetoothDevice</a></code> instances are stored in <code>navigator.bluetooth.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-deviceinstancemap-slot" id="ref-for-dom-bluetooth-deviceinstancemap-slot④">[[deviceInstanceMap]]</a></code></code>, this can’t happen at least until navigation releases the global object or closing the tab or window destroys the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#browsing-context" id="ref-for-browsing-context①">browsing context</a>. </div> <div class="note" role="note"> Note: Disconnecting on garbage collection ensures that the UA doesn’t keep consuming resources on the remote device unnecessarily. </div> <p>Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver⑨">BluetoothRemoteGATTServer</a></code> are created with the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots⑤">internal slots</a> described in the following table:</p> <table class="data"> <tbody> <tr> <th><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots⑥">Internal Slot</a> <th>Initial Value <th>Description (non-normative) <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattserver-activealgorithms-slot"><code>[[activeAlgorithms]]</code></dfn> <td><code>new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-set-objects" id="ref-for-sec-set-objects②">Set</a></code>()</code> <td> Contains a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects⑥">Promise</a></code> corresponding to each algorithm using this server’s connection. <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-disconnect" id="ref-for-dom-bluetoothremotegattserver-disconnect③">disconnect()</a></code> empties this set so that the algorithm can tell whether its <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms③">realm</a> was ever disconnected while it was running. </table> <div class="algorithm" data-algorithm="BluetoothRemoteGATTServer connect"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="method" data-export id="dom-bluetoothremotegattserver-connect"><code>connect()</code></dfn></code> method, when invoked, MUST perform the following steps: <ol> <li data-md> <p>Let <var>promise</var> be <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise⑥">a new promise</a>.</p> <li data-md> <p>If <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot⑥">[[representedDevice]]</a></code></code> is <code>null</code>, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⓪">queue a task</a> to <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject①⓪">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror①">NetworkError</a></code>, return <var>promise</var>, and abort these steps.</p> <li data-md> <p>If the UA is currently using the Bluetooth system, it MAY <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①①">queue a task</a> to <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject①①">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror②">NetworkError</a></code>, return <var>promise</var>, and abort these steps.</p> <p class="issue" id="issue-f363405f"><a class="self-link" href="#issue-f363405f"></a> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror③">NetworkError</a></code>, but for now sites need to serialize their use of this API and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">[Issue #188]</a></p> <li data-md> <p>Add <var>promise</var> to <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot">[[activeAlgorithms]]</a></code></code>.</p> <li data-md> <p>Return <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑦">in parallel</a>:</p> <ol> <li data-md> <p>If <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot⑦">[[representedDevice]]</a></code></code> has no <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer③">ATT Bearer</a>, do the following sub-steps:</p> <ol> <li data-md> <p id="create-an-att-bearer">Attempt to create an <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer④">ATT Bearer</a> using the procedures described in "Connection Establishment" under <a data-link-type="dfn" href="#gap-interoperability-requirements" id="ref-for-gap-interoperability-requirements①">GAP Interoperability Requirements</a>. Abort this attempt if <var>promise</var> is removed from <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①">[[activeAlgorithms]]</a></code></code>.</p> <div class="note" role="note"> Note: These procedures can wait forever if a connectable advertisement isn’t received. The website should call <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-disconnect" id="ref-for-dom-bluetoothremotegattserver-disconnect④">disconnect()</a></code> if it no longer wants to connect. </div> <li data-md> <p>If this attempt was aborted because <var>promise</var> was removed from <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot②">[[activeAlgorithms]]</a></code></code>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject①②">reject</a> <var>promise</var> with an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#aborterror" id="ref-for-aborterror②">AbortError</a></code> and abort these steps.</p> <li data-md> <p>If this attempt failed for another reason, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject①③">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror④">NetworkError</a></code> and abort these steps.</p> <li data-md> <p>Use the <a data-link-type="dfn" href="#exchange-mtu" id="ref-for-exchange-mtu">Exchange MTU</a> procedure to negotiate the largest supported MTU. Ignore any errors from this step.</p> <li data-md> <p>The UA MAY attempt to bond with the remote device using the <a data-link-type="dfn" href="#br-edr-bonding-procedure" id="ref-for-br-edr-bonding-procedure">BR/EDR Bonding Procedure</a> or the <a data-link-type="dfn" href="#le-bonding-procedure" id="ref-for-le-bonding-procedure">LE Bonding Procedure</a>.</p> <p class="note" role="note"><span class="marker">Note:</span> We would normally prefer to give the website control over whether and when bonding happens, but the <a href="https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/AboutCoreBluetooth/Introduction.html">Core Bluetooth</a> platform API doesn’t provide a way for UAs to implement such a knob. Having a bond is more secure than not having one, so this specification allows the UA to opportunistically create one on platforms where that’s possible. This may cause a user-visible pairing dialog to appear when a connection is created, instead of when a restricted characteristic is accessed.</p> </ol> <li data-md> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①②">Queue a task</a> to perform the following sub-steps:</p> <ol> <li data-md> <p>If <var>promise</var> is not in <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot③">[[activeAlgorithms]]</a></code></code>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject①④">reject</a> <var>promise</var> with an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#aborterror" id="ref-for-aborterror③">AbortError</a></code>, <a data-link-type="dfn" href="#garbage-collect-the-connection" id="ref-for-garbage-collect-the-connection">garbage-collect the connection</a> of <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot⑧">[[representedDevice]]</a></code></code>, and abort these steps.</p> <li data-md> <p>Remove <var>promise</var> from <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot④">[[activeAlgorithms]]</a></code></code>.</p> <li data-md> <p>If <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot⑨">[[representedDevice]]</a></code></code> is <code>null</code>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject①⑤">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror⑤">NetworkError</a></code>, <a data-link-type="dfn" href="#garbage-collect-the-connection" id="ref-for-garbage-collect-the-connection①">garbage-collect the connection</a> of <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①⓪">[[representedDevice]]</a></code></code>, and abort these steps.</p> <li data-md> <p>Set <code>this.connected</code> to <code>true</code>.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve①③">Resolve</a> <var>promise</var> with <code>this</code>.</p> </ol> </ol> </ol> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTServer disconnect"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="method" data-export id="dom-bluetoothremotegattserver-disconnect"><code>disconnect()</code></dfn></code> method, when invoked, MUST perform the following steps: <ol> <li data-md> <p>Clear <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑤">[[activeAlgorithms]]</a></code></code> to abort any <a href="#create-an-att-bearer">active <code>connect()</code> calls</a>.</p> <li data-md> <p>If <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected③">connected</a></code></code> is <code>false</code>, abort these steps.</p> <li data-md> <p><a data-link-type="dfn" href="#clean-up-the-disconnected-device" id="ref-for-clean-up-the-disconnected-device">Clean up the disconnected device</a> <code>this.device</code>.</p> <li data-md> <p>Let <var>device</var> be <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①①">[[representedDevice]]</a></code></code>.</p> <li data-md> <p><a data-link-type="dfn" href="#garbage-collect-the-connection" id="ref-for-garbage-collect-the-connection②">Garbage-collect the connection</a> of <var>device</var>.</p> </ol> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTServer connection garbage collection"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="garbage-collect-the-connection">garbage-collect the connection</dfn> of a <var>device</var>, the UA must, do the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑧">in parallel</a>: <ol> <li data-md> <p>If systems that aren’t using this API, either inside or outside of the UA, are using the <var>device</var>’s <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer⑤">ATT Bearer</a>, abort this algorithm.</p> <li data-md> <p>For all <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③⑥">BluetoothDevice</a></code>s <code><var>deviceObj</var></code> in the whole UA:</p> <ol> <li data-md> <p>If <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①②">[[representedDevice]]</a></code></code> is not the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device⑧">same device</a> as <var>device</var>, continue to the next <var>deviceObj</var>.</p> <li data-md> <p>If <code><var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected④">connected</a></code></code> is <code>true</code>, abort this algorithm.</p> <li data-md> <p>If <code><var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑥">[[activeAlgorithms]]</a></code></code> contains the <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects⑦">Promise</a></code> of a call to <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connect" id="ref-for-dom-bluetoothremotegattserver-connect③">connect()</a></code>, abort this algorithm.</p> </ol> <li data-md> <p>Destroy <var>device</var>’s <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer⑥">ATT Bearer</a>.</p> </ol> </div> <div class="algorithm" data-algorithm="GATT connection watcher"> <div class="note" role="note"> Note: Algorithms need to fail if their <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver①⓪">BluetoothRemoteGATTServer</a></code> was disconnected while they were running, even if the UA stays connected the whole time and the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver①①">BluetoothRemoteGATTServer</a></code> is subsequently re-connected before they finish. We wrap the returned <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects⑧">Promise</a></code> to accomplish this. </div> <p>To create a <var>gattServer</var>-<dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="connection-checking-wrapper">connection-checking wrapper</dfn> around a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects⑨">Promise</a></code> <var>promise</var>, the UA MUST:</p> <ol> <li data-md> <p>If <code><var>gattServer</var>.connected</code> is <code>true</code>, add <var>promise</var> to <code><var>gattServer</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑦">[[activeAlgorithms]]</a></code></code>.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#dfn-perform-steps-once-promise-is-settled" id="ref-for-dfn-perform-steps-once-promise-is-settled">React</a> to <var>promise</var>:</p> <ul> <li data-md> <p>If <var>promise</var> was fulfilled with value <var>result</var>, then:</p> <ol> <li data-md> <p>If <var>promise</var> is in <code><var>gattServer</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑧">[[activeAlgorithms]]</a></code></code>, remove it and return <var>result</var>.</p> <li data-md> <p>Otherwise, throw a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror⑥">NetworkError</a></code>.</p> <div class="note" role="note"> Note: This error is thrown because <var>gattServer</var> was disconnected during the execution of the main algorithm. </div> </ol> <li data-md> <p>If <var>promise</var> was rejected with reason <var>error</var>, then:</p> <ol> <li data-md> <p>If <var>promise</var> is in <code><var>gattServer</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot⑨">[[activeAlgorithms]]</a></code></code>, remove it and throw <var>error</var>.</p> <li data-md> <p>Otherwise, throw a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror⑦">NetworkError</a></code>.</p> <div class="note" role="note"> Note: This error is thrown because <var>gattServer</var> was disconnected during the execution of the main algorithm. </div> </ol> </ul> </ol> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTServer getPrimaryService"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="method" data-export id="dom-bluetoothremotegattserver-getprimaryservice"><code>getPrimaryService(<var>service</var>)</code></dfn></code> method, when invoked, MUST perform the following steps: <ol> <li data-md> <p>If <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot④">[[allowedServices]]</a></code></code> is not <code>"all"</code> and <var>service</var> is not in <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot⑤">[[allowedServices]]</a></code></code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with④">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror⑧">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>Return <a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this.device</code>,<br> <i>single</i>=true,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice⑦">BluetoothUUID.getService</a></code>,<br> <i>uuid</i>=<code><var>service</var></code>,<br> <i>allowedUuids</i>=<code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot⑥">[[allowedServices]]</a></code></code>,<br> <i>child type</i>="GATT Primary Service")</span></p> </ol> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTServer getPrimaryServices"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTServer" data-dfn-type="method" data-export data-lt="getPrimaryServices(service)|getPrimaryServices()" id="dom-bluetoothremotegattserver-getprimaryservices"><code>getPrimaryServices(<var>service</var>)</code></dfn></code> method, when invoked, MUST perform the following steps: <ol> <li data-md> <p>If <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot⑦">[[allowedServices]]</a></code></code> is not <code>"all"</code>, and <var>service</var> is present and not in <code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot⑧">[[allowedServices]]</a></code></code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑤">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror⑨">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>Return <a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren①">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this.device</code>,<br> <i>single</i>=false,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice⑧">BluetoothUUID.getService</a></code>,<br> <i>uuid</i>=<code><var>service</var></code>,<br> <i>allowedUuids</i>=<code>this.device.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot⑨">[[allowedServices]]</a></code></code>,<br> <i>child type</i>="GATT Primary Service")</span></p> </ol> </div> <h3 class="heading settled" data-level="6.3" id="bluetoothgattservice-interface"><span class="secno">6.3. </span><span class="content">BluetoothRemoteGATTService</span><a class="self-link" href="#bluetoothgattservice-interface"></a></h3> <p><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice⑧">BluetoothRemoteGATTService</a></code> represents a GATT <a data-link-type="dfn" href="#service" id="ref-for-service⑥">Service</a>, a collection of characteristics and relationships to other services that encapsulate the behavior of part of a device.</p> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed⑧"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext⑦"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetoothremotegattservice"><code><c- g>BluetoothRemoteGATTService</c-></code></dfn> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget②"><c- n>EventTarget</c-></a> { [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject" id="ref-for-SameObject⑤"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothdevice" id="ref-for-bluetoothdevice③⑦"><c- n>BluetoothDevice</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice" href="#dom-bluetoothremotegattservice-device" id="ref-for-dom-bluetoothremotegattservice-device②"><c- g>device</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid④"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="UUID" href="#dom-bluetoothremotegattservice-uuid" id="ref-for-dom-bluetoothremotegattservice-uuid"><c- g>uuid</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean⑥"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-bluetoothremotegattservice-isprimary" id="ref-for-dom-bluetoothremotegattservice-isprimary①"><c- g>isPrimary</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise⑧"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic⑦"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getcharacteristic" id="ref-for-dom-bluetoothremotegattservice-getcharacteristic④"><c- g>getCharacteristic</c-></a>(<a data-link-type="idl-name" href="#typedefdef-bluetoothcharacteristicuuid" id="ref-for-typedefdef-bluetoothcharacteristicuuid"><c- n>BluetoothCharacteristicUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTService/getCharacteristic(characteristic)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattservice-getcharacteristic-characteristic-characteristic"><code><c- g>characteristic</c-></code><a class="self-link" href="#dom-bluetoothremotegattservice-getcharacteristic-characteristic-characteristic"></a></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise⑨"><c- b>Promise</c-></a>&lt;<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence①⑥"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic⑧"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getcharacteristics" id="ref-for-dom-bluetoothremotegattservice-getcharacteristics"><c- g>getCharacteristics</c-></a>(<c- b>optional</c-> <a data-link-type="idl-name" href="#typedefdef-bluetoothcharacteristicuuid" id="ref-for-typedefdef-bluetoothcharacteristicuuid①"><c- n>BluetoothCharacteristicUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTService/getCharacteristics(characteristic), BluetoothRemoteGATTService/getCharacteristics()" data-dfn-type="argument" data-export id="dom-bluetoothremotegattservice-getcharacteristics-characteristic-characteristic"><code><c- g>characteristic</c-></code><a class="self-link" href="#dom-bluetoothremotegattservice-getcharacteristics-characteristic-characteristic"></a></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise①⓪"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice⑨"><c- n>BluetoothRemoteGATTService</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getincludedservice" id="ref-for-dom-bluetoothremotegattservice-getincludedservice①"><c- g>getIncludedService</c-></a>(<a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑦"><c- n>BluetoothServiceUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTService/getIncludedService(service)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattservice-getincludedservice-service-service"><code><c- g>service</c-></code><a class="self-link" href="#dom-bluetoothremotegattservice-getincludedservice-service-service"></a></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise①①"><c- b>Promise</c-></a>&lt;<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence①⑦"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⓪"><c- n>BluetoothRemoteGATTService</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getincludedservices" id="ref-for-dom-bluetoothremotegattservice-getincludedservices"><c- g>getIncludedServices</c-></a>(<c- b>optional</c-> <a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑧"><c- n>BluetoothServiceUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTService/getIncludedServices(service), BluetoothRemoteGATTService/getIncludedServices()" data-dfn-type="argument" data-export id="dom-bluetoothremotegattservice-getincludedservices-service-service"><code><c- g>service</c-></code><a class="self-link" href="#dom-bluetoothremotegattservice-getincludedservices-service-service"></a></dfn>); }; <a data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①①"><c- n>BluetoothRemoteGATTService</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#characteristiceventhandlers" id="ref-for-characteristiceventhandlers②"><c- n>CharacteristicEventHandlers</c-></a>; <a data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①②"><c- n>BluetoothRemoteGATTService</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#serviceeventhandlers" id="ref-for-serviceeventhandlers②"><c- n>ServiceEventHandlers</c-></a>; </pre> <div class="note no-marker" role="note"> <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①③">BluetoothRemoteGATTService</a></code> attributes</div> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattservice-device"><code>device</code></dfn> is the <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③⑧">BluetoothDevice</a></code> representing the remote peripheral that the GATT service belongs to. <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattservice-uuid"><code>uuid</code></dfn> is the UUID of the service, e.g. <code>'0000180d-0000-1000-8000-00805f9b34fb'</code> for the <a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_services.txt#:~:text=heart_rate" id="ref-for-:~:text=heart_rate①">Heart Rate</a> service.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattservice-isprimary"><code>isPrimary</code></dfn> indicates whether the type of this service is primary or secondary.</p> </div> <p>Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①④">BluetoothRemoteGATTService</a></code> are created with the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots⑦">internal slots</a> described in the following table:</p> <table> <tbody> <tr> <th><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots⑧">Internal Slot</a> <th>Initial Value <th>Description (non-normative) <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattservice-representedservice-slot"><code>[[representedService]]</code></dfn> <td>&lt;always set in prose> <td> The <a data-link-type="dfn" href="#service" id="ref-for-service⑦">Service</a> this object represents, or <code>null</code> if the Service has been removed or otherwise invalidated. </table> <div class="algorithm" data-algorithm="BluetoothRemoteGATTService construction"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="create-a-bluetoothremotegattservice-representing">create a <code>BluetoothRemoteGATTService</code> representing</dfn> a Service <var>service</var>, the UA must return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise⑦">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑨">in parallel</a>. <ol> <li data-md> <p>Let <var>result</var> be a new instance of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⑤">BluetoothRemoteGATTService</a></code> with its <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-representedservice-slot" id="ref-for-dom-bluetoothremotegattservice-representedservice-slot①">[[representedService]]</a></code> slot initialized to <var>service</var>.</p> <li data-md> <p><a data-link-type="dfn" href="#get-the-bluetoothdevice-representing" id="ref-for-get-the-bluetoothdevice-representing③">Get the <code>BluetoothDevice</code> representing</a> the device in which <var>service</var> appears, and let <var>device</var> be the result.</p> <li data-md> <p>If the previous step threw an error, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject①⑥">reject</a> <var>promise</var> with that error and abort these steps.</p> <li data-md> <p>Initialize <code><var>result</var>.device</code> from <var>device</var>.</p> <li data-md> <p>Initialize <code><var>result</var>.uuid</code> from the UUID of <var>service</var>.</p> <li data-md> <p>If <var>service</var> is a Primary Service, initialize <code><var>result</var>.isPrimary</code> to true. Otherwise initialize <code><var>result</var>.isPrimary</code> to false.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve①④">Resolve</a> <var>promise</var> with <var>result</var>.</p> </ol> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTService getCharacteristic"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="method" data-export data-lt="getCharacteristic(characteristic)" id="dom-bluetoothremotegattservice-getcharacteristic"><code> getCharacteristic(<var>characteristic</var>)</code></dfn></code> method retrieves a <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic④">Characteristic</a> inside this Service. When invoked, it MUST return <blockquote> <p><a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren②">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this</code>,<br> <i>single</i>=true,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getcharacteristic" id="ref-for-dom-bluetoothuuid-getcharacteristic">BluetoothUUID.getCharacteristic</a></code>,<br> <i>uuid</i>=<code><var>characteristic</var></code>,<br> <i>allowedUuids</i>=<code>undefined</code>,<br> <i>child type</i>="GATT Characteristic")</span></p> </blockquote> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTService getCharacteristics"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="method" data-export data-lt="getCharacteristics(characteristic)|getCharacteristics()" id="dom-bluetoothremotegattservice-getcharacteristics"><code> getCharacteristics(<var>characteristic</var>)</code></dfn></code> method retrieves a list of <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic⑤">Characteristic</a>s inside this Service. When invoked, it MUST return <blockquote> <p><a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren③">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this</code>,<br> <i>single</i>=false,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getcharacteristic" id="ref-for-dom-bluetoothuuid-getcharacteristic①">BluetoothUUID.getCharacteristic</a></code>,<br> <i>uuid</i>=<code><var>characteristic</var></code>,<br> <i>allowedUuids</i>=<code>undefined</code>,<br> <i>child type</i>="GATT Characteristic")</span></p> </blockquote> </div> <div class="unstable algorithm" data-algorithm="BluetoothRemoteGATTService getIncludedService"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="method" data-export data-lt="getIncludedService(service)" id="dom-bluetoothremotegattservice-getincludedservice"><code> getIncludedService(<var>service</var>)</code></dfn></code> method retrieves an <a data-link-type="dfn" href="#included-service" id="ref-for-included-service①">Included Service</a> inside this Service. When invoked, it MUST return <blockquote> <p><a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren④">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this</code>,<br> <i>single</i>=true,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice⑨">BluetoothUUID.getService</a></code>,<br> <i>uuid</i>=<code><var>service</var></code>,<br> <i>allowedUuids</i>=<code>undefined</code>,<br> <i>child type</i>="GATT Included Service")</span></p> </blockquote> </div> <div class="unstable algorithm" data-algorithm="BluetoothRemoteGATTService getIncludedServices"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="method" data-export data-lt="getIncludedServices(service)|getIncludedServices()" id="dom-bluetoothremotegattservice-getincludedservices"><code> getIncludedServices(<var>service</var>)</code></dfn></code> method retrieves a list of <a data-link-type="dfn" href="#included-service" id="ref-for-included-service②">Included Service</a>s inside this Service. When invoked, it MUST return <blockquote> <p><a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren⑤">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this</code>,<br> <i>single</i>=false,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①⓪">BluetoothUUID.getService</a></code>,<br> <i>uuid</i>=<code><var>service</var></code>,<br> <i>allowedUuids</i>=<code>undefined</code>,<br> <i>child type</i>="GATT Included Service")</span></p> </blockquote> </div> <h3 class="heading settled" data-level="6.4" id="bluetoothgattcharacteristic-interface"><span class="secno">6.4. </span><span class="content">BluetoothRemoteGATTCharacteristic</span><a class="self-link" href="#bluetoothgattcharacteristic-interface"></a></h3> <p><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic⑨">BluetoothRemoteGATTCharacteristic</a></code> represents a GATT <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic⑥">Characteristic</a>, which is a basic data element that provides further information about a peripheral’s service.</p> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed⑨"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext⑧"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetoothremotegattcharacteristic"><code><c- g>BluetoothRemoteGATTCharacteristic</c-></code></dfn> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget③"><c- n>EventTarget</c-></a> { [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject" id="ref-for-SameObject⑥"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⑥"><c- n>BluetoothRemoteGATTService</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothRemoteGATTService" href="#dom-bluetoothremotegattcharacteristic-service" id="ref-for-dom-bluetoothremotegattcharacteristic-service①"><c- g>service</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑤"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="UUID" href="#dom-bluetoothremotegattcharacteristic-uuid" id="ref-for-dom-bluetoothremotegattcharacteristic-uuid"><c- g>uuid</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothcharacteristicproperties" id="ref-for-bluetoothcharacteristicproperties①"><c- n>BluetoothCharacteristicProperties</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothCharacteristicProperties" href="#dom-bluetoothremotegattcharacteristic-properties" id="ref-for-dom-bluetoothremotegattcharacteristic-properties"><c- g>properties</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor⑦"><c- b>DataView</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DataView?" href="#dom-bluetoothremotegattcharacteristic-value" id="ref-for-dom-bluetoothremotegattcharacteristic-value②"><c- g>value</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise①②"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor⑤"><c- n>BluetoothRemoteGATTDescriptor</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-getdescriptor" id="ref-for-dom-bluetoothremotegattcharacteristic-getdescriptor①"><c- g>getDescriptor</c-></a>(<a data-link-type="idl-name" href="#typedefdef-bluetoothdescriptoruuid" id="ref-for-typedefdef-bluetoothdescriptoruuid"><c- n>BluetoothDescriptorUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic/getDescriptor(descriptor)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattcharacteristic-getdescriptor-descriptor-descriptor"><code><c- g>descriptor</c-></code><a class="self-link" href="#dom-bluetoothremotegattcharacteristic-getdescriptor-descriptor-descriptor"></a></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise①③"><c- b>Promise</c-></a>&lt;<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence①⑧"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor⑥"><c- n>BluetoothRemoteGATTDescriptor</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-getdescriptors" id="ref-for-dom-bluetoothremotegattcharacteristic-getdescriptors"><c- g>getDescriptors</c-></a>(<c- b>optional</c-> <a data-link-type="idl-name" href="#typedefdef-bluetoothdescriptoruuid" id="ref-for-typedefdef-bluetoothdescriptoruuid①"><c- n>BluetoothDescriptorUUID</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic/getDescriptors(descriptor), BluetoothRemoteGATTCharacteristic/getDescriptors()" data-dfn-type="argument" data-export id="dom-bluetoothremotegattcharacteristic-getdescriptors-descriptor-descriptor"><code><c- g>descriptor</c-></code><a class="self-link" href="#dom-bluetoothremotegattcharacteristic-getdescriptors-descriptor-descriptor"></a></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise①④"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor⑧"><c- b>DataView</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-readvalue" id="ref-for-dom-bluetoothremotegattcharacteristic-readvalue①"><c- g>readValue</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise①⑤"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined" id="ref-for-idl-undefined③"><c- b>undefined</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-writevalue" id="ref-for-dom-bluetoothremotegattcharacteristic-writevalue①"><c- g>writeValue</c-></a>(<a data-link-type="idl-name" href="https://webidl.spec.whatwg.org/#BufferSource" id="ref-for-BufferSource④"><c- n>BufferSource</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic/writeValue(value)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattcharacteristic-writevalue-value-value"><code><c- g>value</c-></code><a class="self-link" href="#dom-bluetoothremotegattcharacteristic-writevalue-value-value"></a></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise①⑥"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined" id="ref-for-idl-undefined④"><c- b>undefined</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-writevaluewithresponse" id="ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithresponse"><c- g>writeValueWithResponse</c-></a>(<a data-link-type="idl-name" href="https://webidl.spec.whatwg.org/#BufferSource" id="ref-for-BufferSource⑤"><c- n>BufferSource</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic/writeValueWithResponse(value)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattcharacteristic-writevaluewithresponse-value-value"><code><c- g>value</c-></code><a class="self-link" href="#dom-bluetoothremotegattcharacteristic-writevaluewithresponse-value-value"></a></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise①⑦"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined" id="ref-for-idl-undefined⑤"><c- b>undefined</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse" id="ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse"><c- g>writeValueWithoutResponse</c-></a>(<a data-link-type="idl-name" href="https://webidl.spec.whatwg.org/#BufferSource" id="ref-for-BufferSource⑥"><c- n>BufferSource</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic/writeValueWithoutResponse(value)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse-value-value"><code><c- g>value</c-></code><a class="self-link" href="#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse-value-value"></a></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise①⑧"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⓪"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-startnotifications" id="ref-for-dom-bluetoothremotegattcharacteristic-startnotifications①"><c- g>startNotifications</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise①⑨"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①①"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-stopnotifications" id="ref-for-dom-bluetoothremotegattcharacteristic-stopnotifications"><c- g>stopNotifications</c-></a>(); }; <a data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①②"><c- n>BluetoothRemoteGATTCharacteristic</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#characteristiceventhandlers" id="ref-for-characteristiceventhandlers③"><c- n>CharacteristicEventHandlers</c-></a>; </pre> <div class="note no-marker" role="note"> <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①③">BluetoothRemoteGATTCharacteristic</a></code> attributes</div> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattcharacteristic-service"><code>service</code></dfn> is the GATT service this characteristic belongs to. <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattcharacteristic-uuid"><code>uuid</code></dfn> is the UUID of the characteristic, e.g. <code>'00002a37-0000-1000-8000-00805f9b34fb'</code> for the <a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=heart_rate_measurement" id="ref-for-:~:text=heart_rate_measurement②"> Heart Rate Measurement</a> characteristic.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattcharacteristic-properties"><code>properties</code></dfn> holds the properties of this characteristic.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattcharacteristic-value"><code>value</code></dfn> is the currently cached characteristic value. This value gets updated when the value of the characteristic is read or updated via a notification or indication.</p> </div> <p>Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①④">BluetoothRemoteGATTCharacteristic</a></code> are created with the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots⑨">internal slots</a> described in the following table:</p> <table> <tbody> <tr> <th><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots①⓪">Internal Slot</a> <th>Initial Value <th>Description (non-normative) <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot"><code>[[representedCharacteristic]]</code></dfn> <td>&lt;always set in prose> <td> The <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic⑦">Characteristic</a> this object represents, or <code>null</code> if the Characteristic has been removed or otherwise invalidated. </table> <div class="algorithm" data-algorithm="BluetoothRemoteGATTCharacteristic constructor"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="create a BluetoothRemoteGATTCharacteristic representing" data-noexport id="create-a-bluetoothremotegattcharacteristic-representing">create a <code>BluetoothRemoteGATTCharacteristic</code> representing</dfn> a Characteristic <var>characteristic</var>, the UA must return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise⑧">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①⓪">in parallel</a>. <ol> <li data-md> <p>Let <var>result</var> be a new instance of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⑤">BluetoothRemoteGATTCharacteristic</a></code> with its <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot①">[[representedCharacteristic]]</a></code> slot initialized to <var>characteristic</var>.</p> <li data-md> <p>Initialize <code><var>result</var>.service</code> from the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⑦">BluetoothRemoteGATTService</a></code> instance representing the Service in which <var>characteristic</var> appears.</p> <li data-md> <p>Initialize <code><var>result</var>.uuid</code> from the UUID of <var>characteristic</var>.</p> <li data-md> <p><a data-link-type="dfn" href="#create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic" id="ref-for-create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic">Create a <code>BluetoothCharacteristicProperties</code> instance from the Characteristic</a> <var>characteristic</var>, and let <var>propertiesPromise</var> be the result.</p> <li data-md> <p>Wait for <var>propertiesPromise</var> to settle.</p> <li data-md> <p>If <var>propertiesPromise</var> was rejected, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve①⑤">resolve</a> <var>promise</var> with <var>propertiesPromise</var> and abort these steps.</p> <li data-md> <p>Initialize <code><var>result</var>.properties</code> from the value <var>propertiesPromise</var> was fulfilled with.</p> <li data-md> <p>Initialize <code><var>result</var>.value</code> to <code>null</code>. The UA MAY initialize <code><var>result</var>.value</code> to a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor⑨">DataView</a></code> wrapping a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor②">ArrayBuffer</a></code> containing the most recently read value from <var>characteristic</var> if this value is available.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve①⑥">Resolve</a> <var>promise</var> with <var>result</var>.</p> </ol> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTCharacteristic getDescriptor"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export data-lt="getDescriptor(descriptor)" id="dom-bluetoothremotegattcharacteristic-getdescriptor"><code> getDescriptor(<var>descriptor</var>)</code></dfn></code> method retrieves a <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor③">Descriptor</a> inside this Characteristic. When invoked, it MUST return <blockquote> <p><a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren⑥">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this</code>,<br> <i>single</i>=true,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getdescriptor" id="ref-for-dom-bluetoothuuid-getdescriptor">BluetoothUUID.getDescriptor</a></code>,<br> <i>uuid</i>=<code><var>descriptor</var></code>,<br> <i>allowedUuids</i>=<code>undefined</code>,<br> <i>child type</i>="GATT Descriptor")</span></p> </blockquote> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTCharacteristic getDescriptors"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export data-lt="getDescriptors(descriptor)|getDescriptors()" id="dom-bluetoothremotegattcharacteristic-getdescriptors"><code> getDescriptors(<var>descriptor</var>)</code></dfn></code> method retrieves a list of <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor④">Descriptor</a>s inside this Characteristic. When invoked, it MUST return <blockquote> <p><a data-link-type="dfn" href="#getgattchildren" id="ref-for-getgattchildren⑦">GetGATTChildren</a>(<span class="argument-list"><i>attribute</i>=<code>this</code>,<br> <i>single</i>=false,<br> <i>uuidCanonicalizer</i>=<code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getdescriptor" id="ref-for-dom-bluetoothuuid-getdescriptor①">BluetoothUUID.getDescriptor</a></code>,<br> <i>uuid</i>=<code><var>descriptor</var></code>,<br> <i>allowedUuids</i>=<code>undefined</code>,<br> <i>child type</i>="GATT Descriptor")</span></p> </blockquote> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTCharacteristic readValue()"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export id="dom-bluetoothremotegattcharacteristic-readvalue"><code>readValue()</code></dfn> </code> method, when invoked, MUST run the following steps: <ol> <li data-md> <p>If <code>this.uuid</code> is <a data-link-type="dfn" href="#blocklisted-for-reads" id="ref-for-blocklisted-for-reads">blocklisted for reads</a>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑥">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror①⓪">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>If <code>this.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected⑤">connected</a></code> </code> is <code>false</code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑦">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror⑧">NetworkError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>characteristic</var> be <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot②">[[representedCharacteristic]]</a></code></code>.</p> <li data-md> <p>If <var>characteristic</var> is <code>null</code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑧">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidstateerror" id="ref-for-invalidstateerror③">InvalidStateError</a></code> and abort these steps.</p> <li data-md> <p>Return a <code>this.service.device.gatt</code>-<a data-link-type="dfn" href="#connection-checking-wrapper" id="ref-for-connection-checking-wrapper①">connection-checking wrapper</a> around <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise⑨">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①①">in parallel</a>:</p> <ol> <li data-md> <p>If the <code>Read</code> bit is not set in <var>characteristic</var>’s <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties">properties</a>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject①⑦">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#notsupportederror" id="ref-for-notsupportederror①">NotSupportedError</a></code> and abort these steps.</p> <li data-md> <p>If the UA is currently using the Bluetooth system, it MAY <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject①⑧">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror⑨">NetworkError</a></code> and abort these steps.</p> <p class="issue" id="issue-f363405f①"><a class="self-link" href="#issue-f363405f①"></a> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror①⓪">NetworkError</a></code>, but for now sites need to serialize their use of this API and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">[Issue #188]</a></p> <li data-md> <p>Use any combination of the sub-procedures in the <a data-link-type="dfn" href="#characteristic-value-read" id="ref-for-characteristic-value-read">Characteristic Value Read</a> procedure to retrieve the value of <var>characteristic</var>. Handle errors as described in <a href="#error-handling">§ 6.7 Error handling</a>.</p> <li data-md> <p>If the previous step returned an error, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject①⑨">reject</a> <var>promise</var> with that error and abort these steps.</p> <li data-md> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①③">Queue a task</a> to perform the following steps:</p> <ol> <li data-md> <p>If <var>promise</var> is not in <code> this.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①⓪">[[activeAlgorithms]]</a></code></code>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject②⓪">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror①①">NetworkError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>buffer</var> be an <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor③">ArrayBuffer</a></code> holding the retrieved value, and assign <code>new DataView(<var>buffer</var>)</code> to <code>this.value</code>.</p> <li data-md> <p><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire②">Fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged" id="ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged①">characteristicvaluechanged</a></code> with its <code>bubbles</code> attribute initialized to <code>true</code> at <code>this</code>.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve①⑦">Resolve</a> <var>promise</var> with <code>this.value</code>.</p> </ol> </ol> </ol> </div> <div class="algorithm" data-algorithm="Write Characteristic value"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="writecharacteristicvalue">WriteCharacteristicValue</dfn>(<span class="argument-list"> <var>this</var>: BluetoothRemoteGATTCharacteristic,<br> <var>value</var>: BufferSource,<br> <var>response</var>: string), </span><br> the UA MUST perform the following steps: <ol> <li data-md> <p>If <code><var>this</var>.uuid</code> is <a data-link-type="dfn" href="#blocklisted-for-writes" id="ref-for-blocklisted-for-writes">blocklisted for writes</a>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑨">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror①①">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>bytes</var> be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy⑥">a copy of the bytes held</a> by <code><var>value</var></code>.</p> <li data-md> <p>If <var>bytes</var> is more than 512 bytes long (the maximum length of an attribute value, per <a data-link-type="dfn" href="#long-attribute-values" id="ref-for-long-attribute-values">Long Attribute Values</a>) return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①⓪">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidmodificationerror" id="ref-for-invalidmodificationerror">InvalidModificationError</a></code> and abort these steps.</p> <li data-md> <p>If <code><var>this</var>.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected⑥">connected</a></code> </code> is <code>false</code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①①">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror①②">NetworkError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>characteristic</var> be <code><var>this</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot③">[[representedCharacteristic]]</a></code></code>.</p> <li data-md> <p>If <var>characteristic</var> is <code>null</code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①②">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidstateerror" id="ref-for-invalidstateerror④">InvalidStateError</a></code> and abort these steps.</p> <li data-md> <p>Return a <code><var>this</var>.service.device.gatt</code>- <a data-link-type="dfn" href="#connection-checking-wrapper" id="ref-for-connection-checking-wrapper②">connection-checking wrapper</a> around <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise①⓪">a new promise</a> <var>promise</var> and run the following steps in parallel.</p> <ol> <li data-md> <p class="assertion">Assert: <var>response</var> is one of "required", "never", or "optional".</p> <li data-md> <p>If the UA is currently using the Bluetooth system, it MAY <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject②①">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror①③">NetworkError</a></code> and abort these steps.</p> <p class="issue" id="issue-f363405f②"><a class="self-link" href="#issue-f363405f②"></a> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror①④">NetworkError</a></code>, but for now sites need to serialize their use of this API and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">[Issue #188]</a></p> <li data-md> <p>Write <var>bytes</var> to <var>characteristic</var> by performing the following steps:</p> <dl class="switch"> <dt>If <var>response</var> is "required" <dd> Use the <a data-link-type="dfn" href="#write-characteristic-value" id="ref-for-write-characteristic-value">Write Characteristic Value</a> procedure. <dt>If <var>response</var> is "never" <dd> Use the <a data-link-type="dfn" href="#write-without-response" id="ref-for-write-without-response">Write Without Response</a> procedure. <dt>Otherwise <dd> Use any combination of the sub-procedures in the <a data-link-type="dfn" href="#characteristic-value-write" id="ref-for-characteristic-value-write">Characteristic Value Write</a> procedure. </dl> Handle errors as described in <a href="#error-handling">§ 6.7 Error handling</a>. <li data-md> <p>If the previous step returned an error, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject②②">reject</a> <var>promise</var> with that error and abort these steps.</p> <li data-md> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①④">Queue a task</a> to perform the following steps:</p> <ol> <li data-md> <p>If <var>promise</var> is not in <code><var>this</var>.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①①">[[activeAlgorithms]]</a></code></code>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject②③">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror①⑤">NetworkError</a></code> and abort these steps.</p> <li data-md> <p>Set <code><var>this</var>.value</code> to a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①⓪">DataView</a></code> wrapping a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor④">ArrayBuffer</a></code> containing <var>bytes</var>.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve①⑧">Resolve</a> <var>promise</var> with <code>undefined</code>.</p> </ol> </ol> </ol> </div> <div class="deprecated algorithm" data-algorithm="BluetoothRemoteGATTCharacteristic writeValue"> <strong>Deprecated.</strong> Use <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-writevaluewithresponse" id="ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithresponse①">writeValueWithResponse()</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse" id="ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse①">writeValueWithoutResponse()</a></code> instead. <p>The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export data-lt="writeValue(value)" id="dom-bluetoothremotegattcharacteristic-writevalue"><code> writeValue(<var>value</var>)</code></dfn></code> method, when invoked, MUST return</p> <blockquote> <p><a data-link-type="dfn" href="#writecharacteristicvalue" id="ref-for-writecharacteristicvalue">WriteCharacteristicValue</a>(<span class="argument-list"> <i>this</i>=<code>this</code>,<br> <i>value</i>=<code><var>value</var></code>,<br> <i>response</i>="optional")</span></p> </blockquote> <p class="issue" id="issue-ea13fbb3"><a class="self-link" href="#issue-ea13fbb3"></a> This method is for backwards compatibility only. New implementations should not implement this method. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/238">[Issue #238]</a></p> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTCharacteristic writeValueWithResponse"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export data-lt="writeValueWithResponse(value)" id="dom-bluetoothremotegattcharacteristic-writevaluewithresponse"><code> writeValueWithResponse(<var>value</var>)</code></dfn></code> method, when invoked, MUST return <blockquote> <p><a data-link-type="dfn" href="#writecharacteristicvalue" id="ref-for-writecharacteristicvalue①">WriteCharacteristicValue</a>(<span class="argument-list"> <i>this</i>=<code>this</code>,<br> <i>value</i>=<code><var>value</var></code>,<br> <i>response</i>="required")</span></p> </blockquote> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTCharacteristic writeValueWithoutResponse"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export data-lt="writeValueWithoutResponse(value)" id="dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse"><code> writeValueWithoutResponse(<var>value</var>)</code></dfn></code> method, when invoked, MUST return <blockquote> <p><a data-link-type="dfn" href="#writecharacteristicvalue" id="ref-for-writecharacteristicvalue②">WriteCharacteristicValue</a>(<span class="argument-list"> <i>this</i>=<code>this</code>,<br> <i>value</i>=<code><var>value</var></code>,<br> <i>response</i>="never")</span></p> </blockquote> </div> <p>The UA MUST maintain a map from each known GATT <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic⑧">Characteristic</a> to a set of <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth①⓪">Bluetooth</a></code> objects known as the characteristic’s <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="active notification context set" data-noexport id="active-notification-context-set">active notification context set</dfn>.</p> <div class="note" role="note"> Note: The set for a given characteristic holds the <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth">navigator.bluetooth</a></code> objects for each <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms④">Realm</a> that has registered for notifications. All notifications become inactive when a device is disconnected. A site that wants to keep getting notifications after reconnecting needs to call <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-startnotifications" id="ref-for-dom-bluetoothremotegattcharacteristic-startnotifications②">startNotifications()</a></code> again, and there is an unavoidable risk that some notifications will be missed in the gap before <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-startnotifications" id="ref-for-dom-bluetoothremotegattcharacteristic-startnotifications③">startNotifications()</a></code> takes effect. </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTCharacteristic startNotifications"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export data-lt="startNotifications()" id="dom-bluetoothremotegattcharacteristic-startnotifications"><code> startNotifications()</code></dfn></code> method, when invoked, MUST return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise①①">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①②">in parallel</a>. See <a href="#notification-events">§ 6.6.4 Responding to Notifications and Indications</a> for details of receiving notifications. <ol> <li data-md> <p>If <code>this.uuid</code> is <a data-link-type="dfn" href="#blocklisted-for-reads" id="ref-for-blocklisted-for-reads①">blocklisted for reads</a>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject②④">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror①②">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>If <code>this.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected⑦">connected</a></code> </code> is <code>false</code>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject②⑤">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror①⑥">NetworkError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>characteristic</var> be <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot④">[[representedCharacteristic]]</a></code></code>.</p> <li data-md> <p>If <var>characteristic</var> is <code>null</code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①③">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidstateerror" id="ref-for-invalidstateerror⑤">InvalidStateError</a></code> and abort these steps.</p> <li data-md> <p>If neither of the <code>Notify</code> or <code>Indicate</code> bits are set in <var>characteristic</var>’s <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties①">properties</a>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject②⑥">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#notsupportederror" id="ref-for-notsupportederror②">NotSupportedError</a></code> and abort these steps.</p> <li data-md> <p>If <var>characteristic</var>’s <a data-link-type="dfn" href="#active-notification-context-set" id="ref-for-active-notification-context-set">active notification context set</a> contains <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth①">navigator.bluetooth</a></code>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve①⑨">resolve</a> <var>promise</var> with <code>this</code> and abort these steps.</p> <li data-md> <p>If the UA is currently using the Bluetooth system, it MAY <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject②⑦">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror①⑦">NetworkError</a></code> and abort these steps.</p> <p class="issue" id="issue-f363405f③"><a class="self-link" href="#issue-f363405f③"></a> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror①⑧">NetworkError</a></code>, but for now sites need to serialize their use of this API and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">[Issue #188]</a></p> <li data-md> <p>If the characteristic has a <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration">Client Characteristic Configuration</a> descriptor, use any of the <a data-link-type="dfn" href="#characteristic-descriptors" id="ref-for-characteristic-descriptors">Characteristic Descriptors</a> procedures to ensure that one of the <code>Notification</code> or <code>Indication</code> bits in <var>characteristic</var>’s <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration①">Client Characteristic Configuration</a> descriptor is set, matching the constraints in <var>characteristic</var>’s <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties②">properties</a>. The UA SHOULD avoid setting both bits, and MUST deduplicate <a href="#notification-events">value-change events</a> if both bits are set. Handle errors as described in <a href="#error-handling">§ 6.7 Error handling</a>.</p> <div class="note" role="note"> Note: Some devices have characteristics whose properties include the Notify or Indicate bit but that don’t have a <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration②">Client Characteristic Configuration</a> descriptor. These non-standard-compliant characteristics tend to send notifications or indications unconditionally, so this specification allows applications to simply subscribe to their messages. </div> <li data-md> <p>If the previous step returned an error, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject②⑧">reject</a> <var>promise</var> with that error and abort these steps.</p> <li data-md> <p>Add <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth②">navigator.bluetooth</a></code> to <var>characteristic</var>’s <a data-link-type="dfn" href="#active-notification-context-set" id="ref-for-active-notification-context-set①">active notification context set</a>.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve②⓪">Resolve</a> <var>promise</var> with <code>this</code>.</p> </ol> <div class="note" role="note"> Note: After notifications are enabled, the resulting <a href="#notification-events">value-change events</a> won’t be delivered until after the current <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint" id="ref-for-perform-a-microtask-checkpoint">microtask checkpoint</a>. This allows a developer to set up handlers in the <code>.then</code> handler of the result promise. </div> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTCharacteristic stopNotifications"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="method" data-export data-lt="stopNotifications()" id="dom-bluetoothremotegattcharacteristic-stopnotifications"><code> stopNotifications()</code></dfn></code> method, when invoked, MUST return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise①②">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①③">in parallel</a>: <ol> <li data-md> <p>Let <var>characteristic</var> be <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑤">[[representedCharacteristic]]</a></code></code>.</p> <li data-md> <p>If <var>characteristic</var> is <code>null</code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①④">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidstateerror" id="ref-for-invalidstateerror⑥">InvalidStateError</a></code> and abort these steps.</p> <li data-md> <p>If <var>characteristic</var>’s <a data-link-type="dfn" href="#active-notification-context-set" id="ref-for-active-notification-context-set②">active notification context set</a> contains <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth③">navigator.bluetooth</a></code>, remove it.</p> <li data-md> <p>If <var>characteristic</var>’s <a data-link-type="dfn" href="#active-notification-context-set" id="ref-for-active-notification-context-set③">active notification context set</a> became empty and the characteristic has a <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration③">Client Characteristic Configuration</a> descriptor, the UA SHOULD use any of the <a data-link-type="dfn" href="#characteristic-descriptors" id="ref-for-characteristic-descriptors①">Characteristic Descriptors</a> procedures to clear the <code>Notification</code> and <code>Indication</code> bits in <var>characteristic</var>’s <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration④">Client Characteristic Configuration</a> descriptor. </p> <p></p> <li data-md> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⑤">Queue a task</a> to <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve②①">resolve</a> <var>promise</var> with <code>this</code>.</p> </ol> <div class="note" role="note"> Note: Queuing a task to resolve the promise ensures that no <a href="#notification-events">value change events</a> due to notifications arrive after the promise resolves. </div> </div> <h4 class="heading settled" data-level="6.4.1" id="characteristicproperties-interface"><span class="secno">6.4.1. </span><span class="content">BluetoothCharacteristicProperties</span><a class="self-link" href="#characteristicproperties-interface"></a></h4> <p>Each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⑥">BluetoothRemoteGATTCharacteristic</a></code> exposes its <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties③">characteristic properties</a> through a <code class="idl"><a data-link-type="idl" href="#bluetoothcharacteristicproperties" id="ref-for-bluetoothcharacteristicproperties②">BluetoothCharacteristicProperties</a></code> object. These properties express what operations are valid on the characteristic.</p> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed①⓪"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext⑨"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetoothcharacteristicproperties"><code><c- g>BluetoothCharacteristicProperties</c-></code></dfn> { <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean⑦"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-broadcast"><code><c- g>broadcast</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-broadcast"></a></dfn>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean⑧"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-read"><code><c- g>read</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-read"></a></dfn>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean⑨"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-writewithoutresponse"><code><c- g>writeWithoutResponse</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-writewithoutresponse"></a></dfn>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean①⓪"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-write"><code><c- g>write</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-write"></a></dfn>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean①①"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-notify"><code><c- g>notify</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-notify"></a></dfn>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean①②"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-indicate"><code><c- g>indicate</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-indicate"></a></dfn>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean①③"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-authenticatedsignedwrites"><code><c- g>authenticatedSignedWrites</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-authenticatedsignedwrites"></a></dfn>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean①④"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-reliablewrite"><code><c- g>reliableWrite</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-reliablewrite"></a></dfn>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean①⑤"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothCharacteristicProperties" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-bluetoothcharacteristicproperties-writableauxiliaries"><code><c- g>writableAuxiliaries</c-></code><a class="self-link" href="#dom-bluetoothcharacteristicproperties-writableauxiliaries"></a></dfn>; }; </pre> <div class="algorithm" data-algorithm="BluetoothCharacteristicProperties constructor"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="create a BluetoothCharacteristicProperties instance from the Characteristic" data-noexport id="create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic">create a <code>BluetoothCharacteristicProperties</code> instance from the Characteristic</dfn> <var>characteristic</var>, the UA MUST return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise①③">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①④">in parallel</a>: <ol> <li data-md> <p>Let <var>propertiesObj</var> be a new instance of <code class="idl"><a data-link-type="idl" href="#bluetoothcharacteristicproperties" id="ref-for-bluetoothcharacteristicproperties③">BluetoothCharacteristicProperties</a></code>.</p> <li data-md> <p>Let <var>properties</var> be the <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties④">characteristic properties</a> of <var>characteristic</var>.</p> <li data-md> <p>Initialize the attributes of <var>propertiesObj</var> from the corresponding bits in <var>properties</var>:</p> <table> <tbody> <tr> <th>Attribute <th>Bit <tr> <td><code>broadcast</code> <td>Broadcast <tr> <td><code>read</code> <td>Read <tr> <td><code>writeWithoutResponse</code> <td>Write Without Response <tr> <td><code>write</code> <td>Write <tr> <td><code>notify</code> <td>Notify <tr> <td><code>indicate</code> <td>Indicate <tr> <td><code>authenticatedSignedWrites</code> <td>Authenticated Signed Writes </table> <li data-md> <p>If the Extended Properties bit of the <a data-link-type="dfn" href="#characteristic-properties" id="ref-for-characteristic-properties⑤">characteristic properties</a> is not set, initialize <code><var>propertiesObj</var>.reliableWrite</code> and <code><var>propertiesObj</var>.writableAuxiliaries</code> to <code>false</code>. Otherwise, run the following steps:</p> <ol> <li data-md> <p><a data-link-type="dfn" href="#characteristic-descriptor-discovery" id="ref-for-characteristic-descriptor-discovery">Discover</a> the <a data-link-type="dfn" href="#characteristic-extended-properties" id="ref-for-characteristic-extended-properties">Characteristic Extended Properties</a> descriptor for <var>characteristic</var> and <a data-link-type="dfn" href="#read-characteristic-descriptors" id="ref-for-read-characteristic-descriptors">read its value</a> into <var>extendedProperties</var>. Handle errors as described in <a href="#error-handling">§ 6.7 Error handling</a>.</p> <p class="issue" id="issue-997f7afd"><a class="self-link" href="#issue-997f7afd"></a> <a data-link-type="dfn" href="#characteristic-extended-properties" id="ref-for-characteristic-extended-properties①">Characteristic Extended Properties</a> isn’t clear whether the extended properties are immutable for a given Characteristic. If they are, the UA should be allowed to cache them.</p> <li data-md> <p>If the previous step returned an error, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject②⑨">reject</a> <var>promise</var> with that error and abort these steps.</p> <li data-md> <p>Initialize <code><var>propertiesObj</var>.reliableWrite</code> from the Reliable Write bit of <var>extendedProperties</var>.</p> <li data-md> <p>Initialize <code><var>propertiesObj</var>.writableAuxiliaries</code> from the Writable Auxiliaries bit of <var>extendedProperties</var>.</p> </ol> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve②②">Resolve</a> <var>promise</var> with <var>propertiesObj</var>.</p> </ol> </div> <h3 class="heading settled" data-level="6.5" id="bluetoothgattdescriptor-interface"><span class="secno">6.5. </span><span class="content">BluetoothRemoteGATTDescriptor</span><a class="self-link" href="#bluetoothgattdescriptor-interface"></a></h3> <p><code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor⑦">BluetoothRemoteGATTDescriptor</a></code> represents a GATT <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor⑤">Descriptor</a>, which provides further information about a <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic⑨">Characteristic</a>’s value.</p> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed①①"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext①⓪"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetoothremotegattdescriptor"><code><c- g>BluetoothRemoteGATTDescriptor</c-></code></dfn> { [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject" id="ref-for-SameObject⑦"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⑦"><c- n>BluetoothRemoteGATTCharacteristic</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothRemoteGATTCharacteristic" href="#dom-bluetoothremotegattdescriptor-characteristic" id="ref-for-dom-bluetoothremotegattdescriptor-characteristic"><c- g>characteristic</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑥"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="UUID" href="#dom-bluetoothremotegattdescriptor-uuid" id="ref-for-dom-bluetoothremotegattdescriptor-uuid"><c- g>uuid</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①①"><c- b>DataView</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DataView?" href="#dom-bluetoothremotegattdescriptor-value" id="ref-for-dom-bluetoothremotegattdescriptor-value"><c- g>value</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise②⓪"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①②"><c- b>DataView</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattdescriptor-readvalue" id="ref-for-dom-bluetoothremotegattdescriptor-readvalue"><c- g>readValue</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise②①"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined" id="ref-for-idl-undefined⑥"><c- b>undefined</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattdescriptor-writevalue" id="ref-for-dom-bluetoothremotegattdescriptor-writevalue"><c- g>writeValue</c-></a>(<a data-link-type="idl-name" href="https://webidl.spec.whatwg.org/#BufferSource" id="ref-for-BufferSource⑦"><c- n>BufferSource</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor/writeValue(value)" data-dfn-type="argument" data-export id="dom-bluetoothremotegattdescriptor-writevalue-value-value"><code><c- g>value</c-></code><a class="self-link" href="#dom-bluetoothremotegattdescriptor-writevalue-value-value"></a></dfn>); }; </pre> <div class="note no-marker" role="note"> <div class="marker">NOTE: <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor⑧">BluetoothRemoteGATTDescriptor</a></code> attributes</div> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattdescriptor-characteristic"><code>characteristic</code></dfn> is the GATT characteristic this descriptor belongs to. <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattdescriptor-uuid"><code>uuid</code></dfn> is the UUID of the characteristic descriptor, e.g. <code>'00002902-0000-1000-8000-00805f9b34fb'</code> for the <a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_descriptors.txt#:~:text=gatt.client_characteristic_configuration" id="ref-for-:~:text=gatt.client_characteristic_configuration"> Client Characteristic Configuration</a> descriptor.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattdescriptor-value"><code>value</code></dfn> is the currently cached descriptor value. This value gets updated when the value of the descriptor is read.</p> </div> <p>Instances of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor⑨">BluetoothRemoteGATTDescriptor</a></code> are created with the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots①①">internal slots</a> described in the following table:</p> <table> <tbody> <tr> <th><a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots" id="ref-for-sec-object-internal-methods-and-internal-slots①②">Internal Slot</a> <th>Initial Value <th>Description (non-normative) <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor" data-dfn-type="attribute" data-export id="dom-bluetoothremotegattdescriptor-representeddescriptor-slot"><code>[[representedDescriptor]]</code></dfn> <td>&lt;always set in prose> <td> The <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor⑥">Descriptor</a> this object represents, or <code>null</code> if the Descriptor has been removed or otherwise invalidated. </table> <div class="algorithm" data-algorithm="BluetoothRemoteGATTDescriptor constructor"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="create-a-bluetoothremotegattdescriptor-representing">create a <code>BluetoothRemoteGATTDescriptor</code> representing</dfn> a Descriptor <var>descriptor</var>, the UA must return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise①④">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①⑤">in parallel</a>. <ol> <li data-md> <p>Let <var>result</var> be a new instance of <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor①⓪">BluetoothRemoteGATTDescriptor</a></code> with its <code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot①">[[representedDescriptor]]</a></code> slot initialized to <var>descriptor</var>.</p> <li data-md> <p>Initialize <code><var>result</var>.characteristic</code> from the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⑧">BluetoothRemoteGATTCharacteristic</a></code> instance representing the Characteristic in which <var>descriptor</var> appears.</p> <li data-md> <p>Initialize <code><var>result</var>.uuid</code> from the UUID of <var>descriptor</var>.</p> <li data-md> <p>Initialize <code><var>result</var>.value</code> to <code>null</code>. The UA MAY initialize <code><var>result</var>.value</code> to a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①③">DataView</a></code> wrapping a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor⑤">ArrayBuffer</a></code> containing the most recently read value from <var>descriptor</var> if this value is available.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve②③">Resolve</a> <var>promise</var> with <var>result</var>.</p> </ol> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTDescriptor readValue"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor" data-dfn-type="method" data-export data-lt="readValue()" id="dom-bluetoothremotegattdescriptor-readvalue"><code> readValue()</code></dfn></code> method, when invoked, MUST run the following steps: <ol> <li data-md> <p>If <code>this.uuid</code> is <a data-link-type="dfn" href="#blocklisted-for-reads" id="ref-for-blocklisted-for-reads②">blocklisted for reads</a>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①⑤">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror①③">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>If <code>this.characteristic.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected⑧">connected</a></code></code> is <code>false</code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①⑥">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror①⑨">NetworkError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>descriptor</var> be <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot②">[[representedDescriptor]]</a></code></code>.</p> <li data-md> <p>If <var>descriptor</var> is <code>null</code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①⑦">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidstateerror" id="ref-for-invalidstateerror⑦">InvalidStateError</a></code> and abort these steps.</p> <li data-md> <p>Return a <code>this.characteristic.service.device.gatt</code>- <a data-link-type="dfn" href="#connection-checking-wrapper" id="ref-for-connection-checking-wrapper③">connection-checking wrapper</a> around <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise①⑤">a new promise</a> <var>promise</var> and run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①⑥">in parallel</a>:</p> <ol> <li data-md> <p>If the UA is currently using the Bluetooth system, it MAY <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject③⓪">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror②⓪">NetworkError</a></code> and abort these steps.</p> <p class="issue" id="issue-f363405f④"><a class="self-link" href="#issue-f363405f④"></a> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror②①">NetworkError</a></code>, but for now sites need to serialize their use of this API and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">[Issue #188]</a></p> <li data-md> <p>Use either the <a data-link-type="dfn" href="#read-characteristic-descriptors" id="ref-for-read-characteristic-descriptors①">Read Characteristic Descriptors</a> or the <a data-link-type="dfn" href="#read-long-characteristic-descriptors" id="ref-for-read-long-characteristic-descriptors">Read Long Characteristic Descriptors</a> sub-procedure to retrieve the value of <var>descriptor</var>. Handle errors as described in <a href="#error-handling">§ 6.7 Error handling</a>.</p> <li data-md> <p>If the previous step returned an error, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject③①">reject</a> <var>promise</var> with that error and abort these steps.</p> <li data-md> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⑥">Queue a task</a> to perform the following steps:</p> <ol> <li data-md> <p>If <var>promise</var> is not in <code>this.characteristic.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①②">[[activeAlgorithms]]</a></code></code>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject③②">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror②②">NetworkError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>buffer</var> be an <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor⑥">ArrayBuffer</a></code> holding the retrieved value, and assign <code>new DataView(<var>buffer</var>)</code> to <code>this.value</code>.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve②④">Resolve</a> <var>promise</var> with <code>this.value</code>.</p> </ol> </ol> </ol> </div> <div class="algorithm" data-algorithm="BluetoothRemoteGATTDescriptor writeValue"> The <code><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTDescriptor" data-dfn-type="method" data-export data-lt="writeValue(value)" id="dom-bluetoothremotegattdescriptor-writevalue"><code> writeValue(<var>value</var>)</code></dfn></code> method, when invoked, MUST run the following steps: <ol> <li data-md> <p>If <code>this.uuid</code> is <a data-link-type="dfn" href="#blocklisted-for-writes" id="ref-for-blocklisted-for-writes①">blocklisted for writes</a>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①⑧">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror①④">SecurityError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>bytes</var> be <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-get-buffer-source-copy" id="ref-for-dfn-get-buffer-source-copy⑦">a copy of the bytes held</a> by <code><var>value</var></code>.</p> <li data-md> <p>If <var>bytes</var> is more than 512 bytes long (the maximum length of an attribute value, per <a data-link-type="dfn" href="#long-attribute-values" id="ref-for-long-attribute-values①">Long Attribute Values</a>) return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①⑨">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidmodificationerror" id="ref-for-invalidmodificationerror①">InvalidModificationError</a></code> and abort these steps.</p> <li data-md> <p>If <code>this.characteristic.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected⑨">connected</a></code></code> is <code>false</code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with②⓪">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror②③">NetworkError</a></code> and abort these steps.</p> <li data-md> <p>Let <var>descriptor</var> be <code>this.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot③">[[representedDescriptor]]</a></code></code>.</p> <li data-md> <p>If <var>descriptor</var> is <code>null</code>, return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with②①">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidstateerror" id="ref-for-invalidstateerror⑧">InvalidStateError</a></code> and abort these steps.</p> <li data-md> <p>Return a <code>this.characteristic.service.device.gatt</code>- <a data-link-type="dfn" href="#connection-checking-wrapper" id="ref-for-connection-checking-wrapper④">connection-checking wrapper</a> around <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-new-promise" id="ref-for-a-new-promise①⑥">a new promise</a> <var>promise</var> and run the following steps in parallel.</p> <ol> <li data-md> <p>If the UA is currently using the Bluetooth system, it MAY <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject③③">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror②④">NetworkError</a></code> and abort these steps.</p> <p class="issue" id="issue-f363405f⑤"><a class="self-link" href="#issue-f363405f⑤"></a> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror②⑤">NetworkError</a></code>, but for now sites need to serialize their use of this API and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">[Issue #188]</a></p> <li data-md> <p>Use either the <a data-link-type="dfn" href="#write-characteristic-descriptors" id="ref-for-write-characteristic-descriptors">Write Characteristic Descriptors</a> or the <a data-link-type="dfn" href="#write-long-characteristic-descriptors" id="ref-for-write-long-characteristic-descriptors">Write Long Characteristic Descriptors</a> sub-procedure to write <var>bytes</var> to <var>descriptor</var>. Handle errors as described in <a href="#error-handling">§ 6.7 Error handling</a>.</p> <li data-md> <p>If the previous step returned an error, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject③④">reject</a> <var>promise</var> with that error and abort these steps.</p> <li data-md> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⑦">Queue a task</a> to perform the following steps:</p> <ol> <li data-md> <p>If <var>promise</var> is not in <code>this.characteristic.service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①③">[[activeAlgorithms]]</a></code></code>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#reject" id="ref-for-reject③⑤">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror②⑥">NetworkError</a></code> and abort these steps.</p> <li data-md> <p>Set <code>this.value</code> to a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①④">DataView</a></code> wrapping a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor⑦">ArrayBuffer</a></code> containing <var>bytes</var>.</p> <li data-md> <p><a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#resolve" id="ref-for-resolve②⑤">Resolve</a> <var>promise</var> with <code>undefined</code>.</p> </ol> </ol> </ol> </div> <h3 class="heading settled" data-level="6.6" id="events"><span class="secno">6.6. </span><span class="content">Events</span><a class="self-link" href="#events"></a></h3> <div class="unstable"> <h4 class="heading settled" data-level="6.6.1" id="bluetooth-tree"><span class="secno">6.6.1. </span><span class="content">Bluetooth Tree</span><a class="self-link" href="#bluetooth-tree"></a></h4> <p>The <dfn class="dfn-paneled" data-dfn-for="Bluetooth tree" data-dfn-type="dfn" data-noexport id="bluetooth-tree-bluetooth-tree">Bluetooth tree</dfn> is the name given to <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth④">navigator.bluetooth</a></code> and objects implementing the <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice③⑨">BluetoothDevice</a></code>, <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⑧">BluetoothRemoteGATTService</a></code>, <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic①⑨">BluetoothRemoteGATTCharacteristic</a></code>, or <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor①①">BluetoothRemoteGATTDescriptor</a></code> interface <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-tree-participate" id="ref-for-concept-tree-participate">participate in a tree</a>.</p> <ul> <li data-md> <p>The <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-tree-child" id="ref-for-concept-tree-child">children</a> of <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth⑤">navigator.bluetooth</a></code> are the <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice④⓪">BluetoothDevice</a></code> objects representing devices in the <code class="idl"><a data-link-type="idl" href="#dom-bluetoothpermissionstorage-alloweddevices" id="ref-for-dom-bluetoothpermissionstorage-alloweddevices⑨">allowedDevices</a></code> list in <a class="idl-code" data-link-type="permission" href="#permissiondef-bluetooth" id="ref-for-permissiondef-bluetooth⑥">"bluetooth"</a>’s <a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-extra-permission-data" id="ref-for-dfn-extra-permission-data⑥">extra permission data</a> for <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth⑥">navigator.bluetooth</a></code>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object②">relevant settings object</a>, in an unspecified order.</p> <li data-md> <p>The <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-tree-child" id="ref-for-concept-tree-child①">children</a> of a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice④①">BluetoothDevice</a></code> are the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice①⑨">BluetoothRemoteGATTService</a></code> objects representing Primary and Secondary <a data-link-type="dfn" href="#service" id="ref-for-service⑧">Service</a>s on its <a data-link-type="dfn" href="#gatt-server" id="ref-for-gatt-server⑤">GATT Server</a> whose UUIDs are on the origin and device’s <code class="idl"><a data-link-type="idl" href="#dom-allowedbluetoothdevice-allowedservices" id="ref-for-dom-allowedbluetoothdevice-allowedservices⑦">allowedServices</a></code> list. The order of the primary services MUST be consistent with the order returned by the <a data-link-type="dfn" href="#discover-primary-service-by-service-uuid" id="ref-for-discover-primary-service-by-service-uuid">Discover Primary Service by Service UUID</a> procedure, but secondary services and primary services with different UUIDs may be in any order.</p> <li data-md> <p>The <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-tree-child" id="ref-for-concept-tree-child②">children</a> of a <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②⓪">BluetoothRemoteGATTService</a></code> are the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②⓪">BluetoothRemoteGATTCharacteristic</a></code> objects representing its Characteristics. The order of the characteristics MUST be consistent with the order returned by the <a data-link-type="dfn" href="#discover-characteristics-by-uuid" id="ref-for-discover-characteristics-by-uuid②">Discover Characteristics by UUID</a> procedure, but characteristics with different UUIDs may be in any order.</p> <li data-md> <p>The <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-tree-child" id="ref-for-concept-tree-child③">children</a> of a <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②①">BluetoothRemoteGATTCharacteristic</a></code> are the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor①②">BluetoothRemoteGATTDescriptor</a></code> objects representing its Descriptors in the order returned by the <a data-link-type="dfn" href="#discover-all-characteristic-descriptors" id="ref-for-discover-all-characteristic-descriptors">Discover All Characteristic Descriptors</a> procedure.</p> </ul> </div> <h4 class="heading settled" data-level="6.6.2" id="event-types"><span class="secno">6.6.2. </span><span class="content">Event types</span><a class="self-link" href="#event-types"></a></h4> <dl> <dt> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDeviceEventHandlers" data-dfn-type="event" data-export id="eventdef-bluetoothdeviceeventhandlers-advertisementreceived"><code>advertisementreceived</code></dfn> <dd> Fired on a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice④②">BluetoothDevice</a></code> when an <a href="#advertising-event-algorithm">advertising event is received from that device</a>. <dt><dfn class="dfn-paneled idl-code" data-dfn-for="Bluetooth" data-dfn-type="event" data-export id="eventdef-bluetooth-availabilitychanged"><code>availabilitychanged</code></dfn> <dd> Fired on <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth①①">navigator.bluetooth</a></code> when <a href="#availability-changed-algorithm">the Bluetooth system as a whole becomes available or unavailable to the UA</a>. <dt> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTCharacteristic" data-dfn-type="event" data-export data-lt="characteristicvaluechanged" id="eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged"> <code>characteristicvaluechanged</code> </dfn> <dd> Fired on a <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②②">BluetoothRemoteGATTCharacteristic</a></code> when its value changes, either as a result of a <a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-readvalue" id="ref-for-dom-bluetoothremotegattcharacteristic-readvalue②"> read request </a>, or a <a href="#notification-events"> value change notification/indication</a>. <dt> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDeviceEventHandlers" data-dfn-type="event" data-export id="eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected"><code>gattserverdisconnected</code></dfn> <dd> Fired on a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice④③">BluetoothDevice</a></code> when <a href="#disconnection-events">an active GATT connection is lost</a>. <dt> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="event" data-export id="eventdef-bluetoothremotegattservice-serviceadded"><code>serviceadded</code></dfn> <dd> Fired on a new <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②①">BluetoothRemoteGATTService</a></code> <a href="#service-change-events">when it has been discovered on a remote device</a>, just after it is added to the <a data-link-type="dfn" href="#bluetooth-tree-bluetooth-tree" id="ref-for-bluetooth-tree-bluetooth-tree">Bluetooth tree</a>. <dt> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="event" data-export data-lt="servicechanged" id="eventdef-bluetoothremotegattservice-servicechanged"> <code>servicechanged</code> </dfn> <dd> Fired on a <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②②">BluetoothRemoteGATTService</a></code> <a href="#service-change-events">when its state changes</a>. This involves any characteristics and/or descriptors that get added or removed from the service, as well as <a data-link-type="dfn" href="#service-changed" id="ref-for-service-changed">Service Changed</a> indications from the remote device. <dt> <dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothRemoteGATTService" data-dfn-type="event" data-export data-lt="serviceremoved" id="eventdef-bluetoothremotegattservice-serviceremoved"> <code>serviceremoved</code> </dfn> <dd> Fired on a <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②③">BluetoothRemoteGATTService</a></code> <a href="#service-change-events">when it has been removed from its device</a>, just before it is removed from the <a data-link-type="dfn" href="#bluetooth-tree-bluetooth-tree" id="ref-for-bluetooth-tree-bluetooth-tree①">Bluetooth tree</a>. </dl> <h4 class="heading settled" data-level="6.6.3" id="disconnection-events"><span class="secno">6.6.3. </span><span class="content">Responding to Disconnection</span><a class="self-link" href="#disconnection-events"></a></h4> <div class="algorithm" data-algorithm="disconnection"> When a <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①⑦">Bluetooth device</a> <var>device</var>’s <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer⑦">ATT Bearer</a> is lost (e.g. because the remote device moved out of range or the user used a platform feature to disconnect it), for each <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice④④">BluetoothDevice</a></code> <var>deviceObj</var> the UA MUST <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⑧">queue a task</a> on <var>deviceObj</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object③">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop②">responsible event loop</a> to perform the following steps: <ol> <li data-md> <p>If <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①③">[[representedDevice]]</a></code></code> is not the <a data-link-type="dfn" href="#same-bluetooth-device" id="ref-for-same-bluetooth-device⑨">same device</a> as <var>device</var>, abort these steps.</p> <li data-md> <p>If <code>!<var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected①⓪">connected</a></code></code>, abort these steps.</p> <li data-md> <p><a data-link-type="dfn" href="#clean-up-the-disconnected-device" id="ref-for-clean-up-the-disconnected-device①">Clean up the disconnected device</a> <var>deviceObj</var>.</p> </ol> </div> <div class="algorithm" data-algorithm="clean up disconnected Bluetooth device"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="clean-up-the-disconnected-device">clean up the disconnected device</dfn> <var>deviceObj</var>, the UA must: <ol> <li data-md> <p>Set <code><var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected①①">connected</a></code></code> to <code>false</code>.</p> <li data-md> <p>Clear <code><var>deviceObj</var>.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-activealgorithms-slot" id="ref-for-dom-bluetoothremotegattserver-activealgorithms-slot①④">[[activeAlgorithms]]</a></code></code>.</p> <li data-md> <p>Let <var>context</var> be <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-context-slot" id="ref-for-dom-bluetoothdevice-context-slot②">[[context]]</a></code></code>.</p> <li data-md> <p>Remove all entries from <code><var>context</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-attributeinstancemap-slot" id="ref-for-dom-bluetooth-attributeinstancemap-slot③">[[attributeInstanceMap]]</a></code></code> whose keys are inside <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①④">[[representedDevice]]</a></code></code>.</p> <li data-md> <p>For each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②④">BluetoothRemoteGATTService</a></code> <var>service</var> in <var>deviceObj</var>’s <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms⑤">realm</a>, set <code><var>service</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-representedservice-slot" id="ref-for-dom-bluetoothremotegattservice-representedservice-slot②">[[representedService]]</a></code></code> to <code>null</code>.</p> <li data-md> <p>For each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②③">BluetoothRemoteGATTCharacteristic</a></code> <var>characteristic</var> in <var>deviceObj</var>’s <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms⑥">realm</a>, do the following sub-steps:</p> <ol> <li data-md> <p>Let <var>notificationContexts</var> be <code><var>characteristic</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑥">[[representedCharacteristic]]</a></code></code>’s <a data-link-type="dfn" href="#active-notification-context-set" id="ref-for-active-notification-context-set④">active notification context set</a>.</p> <li data-md> <p>Remove <var>context</var> from <var>notificationContexts</var>.</p> <li data-md> <p>If <var>notificationContexts</var> became empty and there is still an <a data-link-type="dfn" href="#att-bearer" id="ref-for-att-bearer⑧">ATT Bearer</a> to <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-representeddevice-slot" id="ref-for-dom-bluetoothdevice-representeddevice-slot①⑤">[[representedDevice]]</a></code></code> and <var>characteristic</var> has a <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration⑤">Client Characteristic Configuration</a> descriptor, the UA SHOULD use any of the <a data-link-type="dfn" href="#characteristic-descriptors" id="ref-for-characteristic-descriptors②">Characteristic Descriptors</a> procedures to clear the <code>Notification</code> and <code>Indication</code> bits in <var>characteristic</var>’s <a data-link-type="dfn" href="#client-characteristic-configuration" id="ref-for-client-characteristic-configuration⑥">Client Characteristic Configuration</a> descriptor.</p> <li data-md> <p>Set <code><var>characteristic</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑦">[[representedCharacteristic]]</a></code></code> to <code>null</code>.</p> </ol> <li data-md> <p>For each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor①③">BluetoothRemoteGATTDescriptor</a></code> <var>descriptor</var> in <var>deviceObj</var>’s <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms⑦">realm</a>, set <code><var>descriptor</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot④">[[representedDescriptor]]</a></code></code> to <code>null</code>.</p> <li data-md> <p><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire③">Fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected" id="ref-for-eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected①">gattserverdisconnected</a></code> with its <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-event-bubbles" id="ref-for-dom-event-bubbles">bubbles</a></code> attribute initialized to <code>true</code> at <code><var>deviceObj</var></code>.</p> <div class="note" role="note"> Note: This event is <em>not</em> fired at the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattserver" id="ref-for-bluetoothremotegattserver①②">BluetoothRemoteGATTServer</a></code>. </div> </ol> </div> <h4 class="heading settled" data-level="6.6.4" id="notification-events"><span class="secno">6.6.4. </span><span class="content">Responding to Notifications and Indications</span><a class="self-link" href="#notification-events"></a></h4> <div class="algorithm" data-algorithm="notifications"> When the UA receives a Bluetooth <a data-link-type="dfn" href="#characteristic-value-notification" id="ref-for-characteristic-value-notification">Characteristic Value Notification</a> or <a data-link-type="dfn" href="#characteristic-value-indications" id="ref-for-characteristic-value-indications">Indication</a>, it must perform the following steps: <ol> <li data-md> <p>For each <var>bluetoothGlobal</var> in the Characteristic’s <a data-link-type="dfn" href="#active-notification-context-set" id="ref-for-active-notification-context-set⑤">active notification context set</a>, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⑨">queue a task</a> on the event loop of the script settings object of <var>bluetoothGlobal</var> to do the following sub-steps:</p> <ol> <li data-md> <p>Let <var>characteristicObject</var> be the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②④">BluetoothRemoteGATTCharacteristic</a></code> in the <a data-link-type="dfn" href="#bluetooth-tree-bluetooth-tree" id="ref-for-bluetooth-tree-bluetooth-tree②">Bluetooth tree</a> rooted at <var>bluetoothGlobal</var> that represents the <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic①⓪">Characteristic</a>.</p> <li data-md> <p>If <code><var>characteristicObject</var> .service.device.gatt.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattserver-connected" id="ref-for-dom-bluetoothremotegattserver-connected①②">connected</a></code></code> is <code>false</code>, abort these sub-steps.</p> <li data-md> <p>Set <code><var>characteristicObject</var>.value</code> to a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①⑤">DataView</a></code> wrapping a new <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor⑧">ArrayBuffer</a></code> holding the new value of the <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic①①">Characteristic</a>.</p> <li data-md> <p><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire④">Fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged" id="ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged②">characteristicvaluechanged</a></code> with its <code>bubbles</code> attribute initialized to <code>true</code> at <var>characteristicObject</var>.</p> </ol> </ol> </div> <div class="unstable"> <h4 class="heading settled" data-level="6.6.5" id="service-change-events"><span class="secno">6.6.5. </span><span class="content">Responding to Service Changes</span><a class="self-link" href="#service-change-events"></a></h4> <div class="algorithm" data-algorithm="service changes"> The Bluetooth <a data-link-type="dfn" href="#attribute-caching" id="ref-for-attribute-caching①">Attribute Caching</a> system allows clients to track changes to <a data-link-type="dfn" href="#service" id="ref-for-service⑨">Service</a>s, <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic①②">Characteristic</a>s, and <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor⑦">Descriptor</a>s. Before discovering any of these attributes for the purpose of exposing them to a web page the UA MUST subscribe to Indications from the <a data-link-type="dfn" href="#service-changed" id="ref-for-service-changed①">Service Changed</a> characteristic, if it exists. When the UA receives an Indication on the Service Changed characteristic, it MUST perform the following steps. <ol> <li data-md> <p>Let <var>removedAttributes</var> be the list of attributes in the range indicated by the Service Changed characteristic that the UA had discovered before the Indication.</p> <li data-md> <p>Use the <a data-link-type="dfn" href="#primary-service-discovery" id="ref-for-primary-service-discovery">Primary Service Discovery</a>, <a data-link-type="dfn" href="#relationship-discovery" id="ref-for-relationship-discovery">Relationship Discovery</a>, <a data-link-type="dfn" href="#characteristic-discovery" id="ref-for-characteristic-discovery">Characteristic Discovery</a>, and <a data-link-type="dfn" href="#characteristic-descriptor-discovery" id="ref-for-characteristic-descriptor-discovery①">Characteristic Descriptor Discovery</a> procedures to re-discover attributes in the range indicated by the Service Changed characteristic. The UA MAY skip discovering all or part of the indicated range if it can prove that the results of that discovery could not affect the events fired below.</p> <li data-md> <p>Let <var>addedAttributes</var> be the list of attributes discovered in the previous step.</p> <li data-md> <p>If an attribute with the same definition (see the <a data-link-type="dfn" href="#service-interoperability-requirements" id="ref-for-service-interoperability-requirements">Service Interoperability Requirements</a>), ignoring Characteristic and Descriptor values, appears in both <var>removedAttributes</var> and <var>addedAttributes</var>, remove it from both.</p> <div class="example" id="example-changed-service"> <a class="self-link" href="#example-changed-service"></a> Given the following device states: <dl> <dt>State 1 <dd> <ul> <li> Service A <ul> <li>Characteristic C: value <code>[1, 2, 3]</code> </ul> <li>Service B </ul> <dt>State 2 <dd> <ul> <li> Service A <ul> <li>Characteristic C: value <code>[3, 2, 1]</code> </ul> <li>Service B </ul> <dt>State 3 <dd> <ul> <li> Service A <ul> <li>Characteristic D: value <code>[3, 2, 1]</code> </ul> <li>Service B </ul> <dt>State 4 <dd> <ul> <li> Service A <ul> <li>Characteristic C: value <code>[1, 2, 3]</code> </ul> <li> Service B <ul> <li>Include Service A </ul> </ul> </dl> <p>A transition from state 1 to 2 leaves service A with "the same definition, ignoring Characteristic and Descriptor values", which means it’s removed from both <var>removedAttributes</var> and <var>addedAttributes</var>, and it wouldn’t appear in any <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-servicechanged" id="ref-for-eventdef-bluetoothremotegattservice-servicechanged">servicechanged</a></code> events.</p> <p>A transition from state 1 to 3 leaves service A with a different definition, because a <a data-link-type="dfn" href="#service-definition" id="ref-for-service-definition">service definition</a> includes its characteristic definitions, so it’s left in both <var>removedAttributes</var> and <var>addedAttributes</var>. Then in <a href="#same-service-removed-and-added">step 8</a>, the service is moved to <var>changedServices</var>, which makes it cause a <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-servicechanged" id="ref-for-eventdef-bluetoothremotegattservice-servicechanged①">servicechanged</a></code> event instead of both a <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceadded" id="ref-for-eventdef-bluetoothremotegattservice-serviceadded①">serviceadded</a></code> and <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceremoved" id="ref-for-eventdef-bluetoothremotegattservice-serviceremoved">serviceremoved</a></code>. <a href="#characteristic-descriptor-change-adds-changed-service"> Step 9</a> also adds service A to <var>changedServices</var> because characteristic C was removed and characteristic D was added.</p> <p>A transition from state 1 to 4 is similar to the 1->3 transition. Service B is moved to <var>changedServices</var> in <a href="#same-service-removed-and-added">step 8</a>, but no characteristics or descriptors have changed, so it’s not redundantly added in <a href="#characteristic-descriptor-change-adds-changed-service"> step 9</a>.</p> </div> <li data-md> <p>Let <var>invalidatedAttributes</var> be the attributes in <var>removedAttributes</var> but not <var>addedAttributes</var>.</p> <li data-md> <p>For each <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object">environment settings object</a> <var>settings</var> in the UA, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②⓪">queue a task</a> on its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop③">responsible event loop</a> to do the following sub-steps:</p> <ol> <li data-md> <p>For each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②⑤">BluetoothRemoteGATTService</a></code> <var>service</var> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object④">relevant settings object</a> is <var>settings</var>, if <code><var>service</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-representedservice-slot" id="ref-for-dom-bluetoothremotegattservice-representedservice-slot③">[[representedService]]</a></code></code> is in <var>invalidatedAttributes</var>, set <code><var>service</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattservice-representedservice-slot" id="ref-for-dom-bluetoothremotegattservice-representedservice-slot④">[[representedService]]</a></code></code> to <code>null</code>.</p> <li data-md> <p>For each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattcharacteristic" id="ref-for-bluetoothremotegattcharacteristic②⑤">BluetoothRemoteGATTCharacteristic</a></code> <var>characteristic</var> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object⑤">relevant settings object</a> is <var>settings</var>, if <code><var>characteristic</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑧">[[representedCharacteristic]]</a></code></code> is in <var>invalidatedAttributes</var>, set <code><var>characteristic</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot" id="ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot⑨">[[representedCharacteristic]]</a></code></code> to <code>null</code>.</p> <li data-md> <p>For each <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattdescriptor" id="ref-for-bluetoothremotegattdescriptor①④">BluetoothRemoteGATTDescriptor</a></code> <var>descriptor</var> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object⑥">relevant settings object</a> is <var>settings</var>, if <code><var>descriptor</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot⑤">[[representedDescriptor]]</a></code></code> is in <var>invalidatedAttributes</var>, set <code><var>descriptor</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot" id="ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot⑥">[[representedDescriptor]]</a></code></code> to <code>null</code>.</p> <li data-md> <p>Let <var>global</var> be <var>settings</var>’ <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global">global object</a>.</p> <li data-md> <p>Remove every entry from <code> <var>global</var>.navigator.bluetooth.<code class="idl"><a data-link-type="idl" href="#dom-bluetooth-attributeinstancemap-slot" id="ref-for-dom-bluetooth-attributeinstancemap-slot④">[[attributeInstanceMap]]</a></code></code> that represents an attribute that is in <var>invalidatedAttributes</var>.</p> </ol> <li data-md> <p>Let <var>changedServices</var> be a set of <a data-link-type="dfn" href="#service" id="ref-for-service①⓪">Service</a>s, initially empty.</p> <li data-md> <p id="same-service-removed-and-added">If the <a data-link-type="dfn" href="#same-attribute" id="ref-for-same-attribute④">same</a> <a data-link-type="dfn" href="#service" id="ref-for-service①①">Service</a> appears in both <var>removedAttributes</var> and <var>addedAttributes</var>, remove it from both, and add it to <var>changedServices</var>.</p> <li data-md> <p id="characteristic-descriptor-change-adds-changed-service">For each <a data-link-type="dfn" href="#characteristic" id="ref-for-characteristic①③">Characteristic</a> and <a data-link-type="dfn" href="#descriptor" id="ref-for-descriptor⑧">Descriptor</a> in <var>removedAttributes</var> or <var>addedAttributes</var>, remove it from its original list, and add its parent <a data-link-type="dfn" href="#service" id="ref-for-service①②">Service</a> to <var>changedServices</var>.</p> <div class="note" role="note"> Note: After this point, <var>removedAttributes</var> and <var>addedAttributes</var> contain only <a data-link-type="dfn" href="#service" id="ref-for-service①③">Service</a>s. </div> <li data-md> <p id="only-notify-for-requested-services">If a <a data-link-type="dfn" href="#service" id="ref-for-service①④">Service</a> in <var>addedAttributes</var> would not have been returned from any previous call to <code>getPrimaryService</code>, <code>getPrimaryServices</code>, <code>getIncludedService</code>, or <code>getIncludedServices</code> if it had existed at the time of the call, the UA MAY remove the <a data-link-type="dfn" href="#service" id="ref-for-service①⑤">Service</a> from <var>addedAttributes</var>.</p> <li data-md> <p>Let <var>changedDevices</var> be the set of <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①⑧">Bluetooth device</a>s that contain any <a data-link-type="dfn" href="#service" id="ref-for-service①⑥">Service</a> in <var>removedAttributes</var>, <var>addedAttributes</var>, and <var>changedServices</var>.</p> <li data-md> <p>For each <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice④⑤">BluetoothDevice</a></code> <var>deviceObj</var> that is connected to a device in <var>changedDevices</var>, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②①">queue a task</a> on its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global" id="ref-for-concept-relevant-global⑧">relevant global object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop④">responsible event loop</a> to do the following steps:</p> <ol> <li data-md> <p>For each <a data-link-type="dfn" href="#service" id="ref-for-service①⑦">Service</a> <var>service</var> in <var>removedAttributes</var>:</p> <ol> <li data-md> <p>If <code><var>deviceObj</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot①⓪">[[allowedServices]]</a></code></code> is <code>"all"</code> or contains the Service’s UUID, <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire⑤">fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceremoved" id="ref-for-eventdef-bluetoothremotegattservice-serviceremoved①">serviceremoved</a></code> with its <code>bubbles</code> attribute initialized to <code>true</code> at the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②⑥">BluetoothRemoteGATTService</a></code> representing the <a data-link-type="dfn" href="#service" id="ref-for-service①⑧">Service</a>.</p> <li data-md> <p>Remove this <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②⑦">BluetoothRemoteGATTService</a></code> from the <a data-link-type="dfn" href="#bluetooth-tree-bluetooth-tree" id="ref-for-bluetooth-tree-bluetooth-tree③">Bluetooth tree</a>.</p> </ol> <li data-md> <p>For each <a data-link-type="dfn" href="#service" id="ref-for-service①⑨">Service</a> in <var>addedAttributes</var>, if <code>deviceObj.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot①①">[[allowedServices]]</a></code></code> is <code>"all"</code> or contains the Service’s UUID, add the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②⑧">BluetoothRemoteGATTService</a></code> representing this <a data-link-type="dfn" href="#service" id="ref-for-service②⓪">Service</a> to the <a data-link-type="dfn" href="#bluetooth-tree-bluetooth-tree" id="ref-for-bluetooth-tree-bluetooth-tree④">Bluetooth tree</a> and then <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire⑥">fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceadded" id="ref-for-eventdef-bluetoothremotegattservice-serviceadded②">serviceadded</a></code> with its <code>bubbles</code> attribute initialized to <code>true</code> at the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice②⑨">BluetoothRemoteGATTService</a></code>.</p> <li data-md> <p>For each <a data-link-type="dfn" href="#service" id="ref-for-service②①">Service</a> in <var>changedServices</var>, if <code>deviceObj.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-allowedservices-slot" id="ref-for-dom-bluetoothdevice-allowedservices-slot①②">[[allowedServices]]</a></code></code> is <code>"all"</code> or contains the Service’s UUID, <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire⑦">fire an event</a> named <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-servicechanged" id="ref-for-eventdef-bluetoothremotegattservice-servicechanged②">servicechanged</a></code> with its <code>bubbles</code> attribute initialized to <code>true</code> at the <code class="idl"><a data-link-type="idl" href="#bluetoothremotegattservice" id="ref-for-bluetoothremotegattservice③⓪">BluetoothRemoteGATTService</a></code> representing the <a data-link-type="dfn" href="#service" id="ref-for-service②②">Service</a>.</p> </ol> </ol> </div> </div> <h4 class="heading settled" data-level="6.6.6" id="idl-event-handlers"><span class="secno">6.6.6. </span><span class="content">IDL event handlers</span><a class="self-link" href="#idl-event-handlers"></a></h4> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext①①"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <c- b>mixin</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="characteristiceventhandlers"><code><c- g>CharacteristicEventHandlers</c-></code></dfn> { <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-characteristiceventhandlers-oncharacteristicvaluechanged" id="ref-for-dom-characteristiceventhandlers-oncharacteristicvaluechanged"><c- g>oncharacteristicvaluechanged</c-></a>; }; </pre> <p><dfn class="dfn-paneled idl-code" data-dfn-for="CharacteristicEventHandlers" data-dfn-type="attribute" data-export data-lt="oncharacteristicvaluechanged" id="dom-characteristiceventhandlers-oncharacteristicvaluechanged"><code> oncharacteristicvaluechanged</code></dfn> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes">Event handler IDL attribute</a> for the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged" id="ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged③">characteristicvaluechanged</a></code> event type.</p> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext①②"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <c- b>mixin</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bluetoothdeviceeventhandlers"><code><c- g>BluetoothDeviceEventHandlers</c-></code></dfn> { <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler②"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-bluetoothdeviceeventhandlers-onadvertisementreceived" id="ref-for-dom-bluetoothdeviceeventhandlers-onadvertisementreceived"><c- g>onadvertisementreceived</c-></a>; <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler③"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-bluetoothdeviceeventhandlers-ongattserverdisconnected" id="ref-for-dom-bluetoothdeviceeventhandlers-ongattserverdisconnected"><c- g>ongattserverdisconnected</c-></a>; }; </pre> <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDeviceEventHandlers" data-dfn-type="attribute" data-export id="dom-bluetoothdeviceeventhandlers-onadvertisementreceived"><code>onadvertisementreceived</code></dfn> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes①">Event handler IDL attribute</a> for the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdeviceeventhandlers-advertisementreceived" id="ref-for-eventdef-bluetoothdeviceeventhandlers-advertisementreceived④">advertisementreceived</a></code> event type.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothDeviceEventHandlers" data-dfn-type="attribute" data-export id="dom-bluetoothdeviceeventhandlers-ongattserverdisconnected"><code>ongattserverdisconnected</code></dfn> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes②">Event handler IDL attribute</a> for the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected" id="ref-for-eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected②">gattserverdisconnected</a></code> event type.</p> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext①③"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <c- b>mixin</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="serviceeventhandlers"><code><c- g>ServiceEventHandlers</c-></code></dfn> { <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler④"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-serviceeventhandlers-onserviceadded" id="ref-for-dom-serviceeventhandlers-onserviceadded"><c- g>onserviceadded</c-></a>; <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑤"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-serviceeventhandlers-onservicechanged" id="ref-for-dom-serviceeventhandlers-onservicechanged"><c- g>onservicechanged</c-></a>; <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑥"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-serviceeventhandlers-onserviceremoved" id="ref-for-dom-serviceeventhandlers-onserviceremoved"><c- g>onserviceremoved</c-></a>; }; </pre> <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceEventHandlers" data-dfn-type="attribute" data-export id="dom-serviceeventhandlers-onserviceadded"><code>onserviceadded</code></dfn> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes③">Event handler IDL attribute</a> for the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceadded" id="ref-for-eventdef-bluetoothremotegattservice-serviceadded③">serviceadded</a></code> event type.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceEventHandlers" data-dfn-type="attribute" data-export id="dom-serviceeventhandlers-onservicechanged"><code>onservicechanged</code></dfn> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes④">Event handler IDL attribute</a> for the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-servicechanged" id="ref-for-eventdef-bluetoothremotegattservice-servicechanged③">servicechanged</a></code> event type.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceEventHandlers" data-dfn-type="attribute" data-export id="dom-serviceeventhandlers-onserviceremoved"><code>onserviceremoved</code></dfn> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes⑤">Event handler IDL attribute</a> for the <code class="idl"><a data-link-type="idl" href="#eventdef-bluetoothremotegattservice-serviceremoved" id="ref-for-eventdef-bluetoothremotegattservice-serviceremoved②">serviceremoved</a></code> event type.</p> <h3 class="heading settled" data-level="6.7" id="error-handling"><span class="secno">6.7. </span><span class="content">Error handling</span><a class="self-link" href="#error-handling"></a></h3> <div class="note" role="note"> Note: This section primarily defines the mapping from system errors to Javascript error names and allows UAs to retry certain operations. The retry logic and possible error distinctions are highly constrained by the operating system, so places these requirements don’t reflect reality are likely <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues">spec bugs</a> instead of browser bugs. </div> <div class="algorithm" data-algorithm="error handling"> When the UA is using a <a data-link-type="dfn" href="#gatt-procedure" id="ref-for-gatt-procedure②">GATT procedure</a> to execute a step in an algorithm or to handle a query to the <a data-link-type="dfn" href="#bluetooth-cache-bluetooth-cache" id="ref-for-bluetooth-cache-bluetooth-cache④">Bluetooth cache</a> (both referred to as a "step", here), and the GATT procedure returns an <code><a data-link-type="dfn" href="#error-response" id="ref-for-error-response">Error Response</a></code>, the UA MUST perform the following steps: <ol> <li data-md> <p>If the <a data-link-type="dfn" href="#procedure-timeouts" id="ref-for-procedure-timeouts">procedure times out</a> or the ATT Bearer (described in <a data-link-type="dfn" href="#profile-fundamentals" id="ref-for-profile-fundamentals">Profile Fundamentals</a>) is absent or terminated for any reason, return a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror" id="ref-for-networkerror②⑦">NetworkError</a></code> from the step and abort these steps.</p> <li data-md> <p>Take the following actions depending on the <code>Error Code</code>:</p> <dl class="switch"> <dt><code>Invalid PDU</code> <dt><code>Invalid Offset</code> <dt><code>Attribute Not Found</code> <dt><code>Unsupported Group Type</code> <dd> These error codes indicate that something unexpected happened at the protocol layer, likely either due to a UA or device bug. Return a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#notsupportederror" id="ref-for-notsupportederror③">NotSupportedError</a></code> from the step. <dt><code>Invalid Handle</code> <dd> Return an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidstateerror" id="ref-for-invalidstateerror⑨">InvalidStateError</a></code> from the step. <dt><code>Invalid Attribute Value Length</code> <dd> Return an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidmodificationerror" id="ref-for-invalidmodificationerror②">InvalidModificationError</a></code> from the step. <dt><code>Attribute Not Long</code> <dd> <p> If this error code is received without having used a "Long" sub-procedure, this may indicate a device bug. Return a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#notsupportederror" id="ref-for-notsupportederror④">NotSupportedError</a></code> from the step. </p> <p> Otherwise, retry the step without using a "Long" sub-procedure. If this is impossible due to the length of the value being written, return an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidmodificationerror" id="ref-for-invalidmodificationerror③">InvalidModificationError</a></code> from the step. </p> <dt><code>Insufficient Authentication</code> <dt><code>Insufficient Encryption</code> <dt><code>Insufficient Encryption Key Size</code> <dd> The UA SHOULD attempt to increase the security level of the connection. If this attempt fails or the UA doesn’t support any higher security, Return a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror①⑤">SecurityError</a></code> from the step. Otherwise, retry the step at the new higher security level. <dt><code>Insufficient Authorization</code> <dd> Return a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#securityerror" id="ref-for-securityerror①⑥">SecurityError</a></code> from the step. <dt><code>Application Error</code> <dd> If the GATT procedure was a Write, return an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#invalidmodificationerror" id="ref-for-invalidmodificationerror④">InvalidModificationError</a></code> from the step. Otherwise, return a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#notsupportederror" id="ref-for-notsupportederror⑤">NotSupportedError</a></code> from the step. <dt><code>Read Not Permitted</code> <dt><code>Write Not Permitted</code> <dt><code>Request Not Supported</code> <dt><code>Prepare Queue Full</code> <dt><code>Insufficient Resources</code> <dt><code>Unlikely Error</code> <dt>Anything else <dd> Return a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#notsupportederror" id="ref-for-notsupportederror⑥">NotSupportedError</a></code> from the step. </dl> </ol> </div> <h2 class="heading settled" data-level="7" id="uuids"><span class="secno">7. </span><span class="content">UUIDs</span><a class="self-link" href="#uuids"></a></h2> <pre class="idl highlight def"><c- b>typedef</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString①②"><c- b>DOMString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-type="typedef" data-export id="typedefdef-uuid"><code><c- g>UUID</c-></code></dfn>; </pre> <p>A <a data-link-type="dfn" href="#uuid" id="ref-for-uuid③">UUID</a> string represents a 128-bit <a data-biblio-obsolete data-link-type="biblio" href="#biblio-rfc4122" title="A Universally Unique IDentifier (UUID) URN Namespace">[RFC4122]</a> UUID. A <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="valid UUID" data-noexport id="valid-uuid">valid UUID</dfn> is a string that matches the <a data-link-type="biblio" href="#biblio-ecmascript" title="ECMAScript Language Specification">[ECMAScript]</a> regexp <code>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/</code>. That is, a <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid">valid UUID</a> is lower-case and does not use the 16- or 32-bit abbreviations defined by the Bluetooth standard. All UUIDs returned from functions and attributes in this specification MUST be <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid①">valid UUID</a>s. If a function in this specification takes a parameter whose type is <a data-link-type="dfn" href="#uuid" id="ref-for-uuid④">UUID</a> or a dictionary including a <a data-link-type="dfn" href="#uuid" id="ref-for-uuid⑤">UUID</a> attribute, and the argument passed in any <a data-link-type="dfn" href="#uuid" id="ref-for-uuid⑥">UUID</a> slot is not a <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid②">valid UUID</a>, the function MUST return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with②②">a promise rejected with</a> a <code>TypeError</code> and abort its other steps.</p> <div class="note" role="note"> Note: This standard provides the <code>BluetoothUUID.<a data-link-type="functionish" href="#dom-bluetoothuuid-canonicaluuid" id="ref-for-dom-bluetoothuuid-canonicaluuid">canonicalUUID(<var>alias</var>)</a></code> function to map a 16- or 32-bit Bluetooth <a data-link-type="dfn" href="#uuid-alias" id="ref-for-uuid-alias">UUID alias</a> to its 128-bit form. </div> <div class="note" role="note"> Note: Bluetooth devices are required to convert 16- and 32-bit UUIDs to 128-bit UUIDs before comparing them (as described in <a data-link-type="dfn" href="#attribute-type" id="ref-for-attribute-type">Attribute Type</a>), but not all devices do so. To interoperate with these devices, if the UA has received a UUID from the device in one form (16-, 32-, or 128-bit), it should send other aliases of that UUID back to the device in the same form. </div> <h3 class="heading settled" data-level="7.1" id="standardized-uuids"><span class="secno">7.1. </span><span class="content">Standardized UUIDs</span><a class="self-link" href="#standardized-uuids"></a></h3> <p>The Bluetooth SIG maintains a registry at <a data-link-type="biblio" href="#biblio-bluetooth-assigned" title="Assigned Numbers">[BLUETOOTH-ASSIGNED]</a> of UUIDs that identify services, characteristics, descriptors, and other entities. This section provides a way for script to look up those UUIDs by name so they don’t need to be replicated in each application.</p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="valid-name">valid name</dfn> is a string that matches the <a data-link-type="biblio" href="#biblio-ecmascript" title="ECMAScript Language Specification">[ECMAScript]</a> regexp <code>/^[a-z0-9_-.]+$/</code>.</p> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed①②"><c- g>Exposed</c-></a>=<c- n>Window</c->] <c- b>interface</c-> <dfn class="idl-code" data-dfn-type="interface" data-export id="bluetoothuuid"><code><c- g>BluetoothUUID</c-></code><a class="self-link" href="#bluetoothuuid"></a></dfn> { <c- b>static</c-> <a data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑦"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①①"><c- g>getService</c-></a>((<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString①③"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long" id="ref-for-idl-unsigned-long①"><c- b>unsigned</c-> <c- b>long</c-></a>) <dfn class="idl-code" data-dfn-for="BluetoothUUID/getService(name)" data-dfn-type="argument" data-export id="dom-bluetoothuuid-getservice-name-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-bluetoothuuid-getservice-name-name"></a></dfn>); <c- b>static</c-> <a data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑧"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-getcharacteristic" id="ref-for-dom-bluetoothuuid-getcharacteristic②"><c- g>getCharacteristic</c-></a>((<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString①④"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long" id="ref-for-idl-unsigned-long②"><c- b>unsigned</c-> <c- b>long</c-></a>) <dfn class="idl-code" data-dfn-for="BluetoothUUID/getCharacteristic(name)" data-dfn-type="argument" data-export id="dom-bluetoothuuid-getcharacteristic-name-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-bluetoothuuid-getcharacteristic-name-name"></a></dfn>); <c- b>static</c-> <a data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid⑨"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-getdescriptor" id="ref-for-dom-bluetoothuuid-getdescriptor②"><c- g>getDescriptor</c-></a>((<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString①⑤"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long" id="ref-for-idl-unsigned-long③"><c- b>unsigned</c-> <c- b>long</c-></a>) <dfn class="idl-code" data-dfn-for="BluetoothUUID/getDescriptor(name)" data-dfn-type="argument" data-export id="dom-bluetoothuuid-getdescriptor-name-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-bluetoothuuid-getdescriptor-name-name"></a></dfn>); <c- b>static</c-> <a data-link-type="idl-name" href="#typedefdef-uuid" id="ref-for-typedefdef-uuid①⓪"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-canonicaluuid" id="ref-for-dom-bluetoothuuid-canonicaluuid①"><c- g>canonicalUUID</c-></a>([<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#EnforceRange" id="ref-for-EnforceRange①"><c- g>EnforceRange</c-></a>] <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long" id="ref-for-idl-unsigned-long④"><c- b>unsigned</c-> <c- b>long</c-></a> <dfn class="idl-code" data-dfn-for="BluetoothUUID/canonicalUUID(alias)" data-dfn-type="argument" data-export id="dom-bluetoothuuid-canonicaluuid-alias-alias"><code><c- g>alias</c-></code><a class="self-link" href="#dom-bluetoothuuid-canonicaluuid-alias-alias"></a></dfn>); }; <c- b>typedef</c-> (<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString①⑥"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long" id="ref-for-idl-unsigned-long⑤"><c- b>unsigned</c-> <c- b>long</c-></a>) <a class="idl-code" data-link-type="typedef" href="#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid⑨"><c- g>BluetoothServiceUUID</c-></a>; <c- b>typedef</c-> (<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString①⑦"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long" id="ref-for-idl-unsigned-long⑥"><c- b>unsigned</c-> <c- b>long</c-></a>) <a class="idl-code" data-link-type="typedef" href="#typedefdef-bluetoothcharacteristicuuid" id="ref-for-typedefdef-bluetoothcharacteristicuuid②"><c- g>BluetoothCharacteristicUUID</c-></a>; <c- b>typedef</c-> (<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString" id="ref-for-idl-DOMString①⑧"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long" id="ref-for-idl-unsigned-long⑦"><c- b>unsigned</c-> <c- b>long</c-></a>) <a class="idl-code" data-link-type="typedef" href="#typedefdef-bluetoothdescriptoruuid" id="ref-for-typedefdef-bluetoothdescriptoruuid②"><c- g>BluetoothDescriptorUUID</c-></a>; </pre> <p>The static <code>BluetoothUUID.<dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothUUID" data-dfn-type="method" data-export data-lt="canonicalUUID(alias)" id="dom-bluetoothuuid-canonicaluuid"><code> canonicalUUID(<var>alias</var>)</code></dfn></code> method, when invoked, MUST return <a data-link-type="dfn" href="#the-128-bit-uuid-represented" id="ref-for-the-128-bit-uuid-represented">the 128-bit UUID represented</a> by the 16- or 32-bit UUID alias <var>alias</var>.</p> <div class="note" role="note"> Note: This algorithm consists of replacing the top 32 bits of "<code>00000000-0000-1000-8000-00805f9b34fb</code>" with the bits of the alias. For example, <code>canonicalUUID(0xDEADBEEF)</code> returns <code>"deadbeef-0000-1000-8000-00805f9b34fb"</code>. </div> <div class="note" role="note"> <dfn class="dfn-paneled idl-code" data-dfn-type="typedef" data-export id="typedefdef-bluetoothserviceuuid"><code>BluetoothServiceUUID</code></dfn> represents 16- and 32-bit UUID aliases, <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid③">valid UUID</a>s, and <a data-link-type="dfn" href="#valid-name" id="ref-for-valid-name">valid name</a>s from <a data-link-type="dfn" href="#gatt-assigned-services" id="ref-for-gatt-assigned-services">GATT assigned services</a> keys, or, equivalently, the values for which <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①②">BluetoothUUID.getService()</a></code> does not throw an exception. <p><dfn class="dfn-paneled idl-code" data-dfn-type="typedef" data-export id="typedefdef-bluetoothcharacteristicuuid"><code>BluetoothCharacteristicUUID</code></dfn> represents 16- and 32-bit UUID aliases, <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid④">valid UUID</a>s, and <a data-link-type="dfn" href="#valid-name" id="ref-for-valid-name①">valid name</a>s from <a data-link-type="dfn" href="#gatt-assigned-characteristics" id="ref-for-gatt-assigned-characteristics">GATT assigned characteristics</a> keys, or, equivalently, the values for which <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getcharacteristic" id="ref-for-dom-bluetoothuuid-getcharacteristic③">BluetoothUUID.getCharacteristic()</a></code> does not throw an exception.</p> <p><dfn class="dfn-paneled idl-code" data-dfn-type="typedef" data-export id="typedefdef-bluetoothdescriptoruuid"><code>BluetoothDescriptorUUID</code></dfn> represents 16- and 32-bit UUID aliases, <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid⑤">valid UUID</a>s, and <a data-link-type="dfn" href="#valid-name" id="ref-for-valid-name②">valid name</a>s from <a data-link-type="dfn" href="#gatt-assigned-descriptors" id="ref-for-gatt-assigned-descriptors">GATT assigned descriptors</a> keys, or, equivalently, the values for which <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getdescriptor" id="ref-for-dom-bluetoothuuid-getdescriptor③">BluetoothUUID.getDescriptor()</a></code> does not throw an exception.</p> </div> <div class="algorithm" data-algorithm="resolve UUID name"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="resolveuuidname">ResolveUUIDName</dfn>(<var>name</var>, <var>GATT assigned numbers</var>), the UA MUST perform the following steps: <ol> <li data-md> <p>If <var>name</var> is an <code>unsigned long</code>, return <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-canonicaluuid" id="ref-for-dom-bluetoothuuid-canonicaluuid②">BluetoothUUID.canonicalUUID</a></code>(name) and abort these steps.</p> <li data-md> <p>If <var>name</var> is a <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid⑥">valid UUID</a>, return <var>name</var> and abort these steps.</p> <li data-md> <p>If <var>name</var> is a <a data-link-type="dfn" href="#valid-name" id="ref-for-valid-name③">valid name</a> and maps to a <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid⑦">valid UUID</a> in <var>GATT assigned numbers</var>, let <var>alias</var> be its assigned number, and return <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-canonicaluuid" id="ref-for-dom-bluetoothuuid-canonicaluuid③">BluetoothUUID.canonicalUUID</a></code>(<var>alias</var>).</p> <li data-md> <p>Otherwise, throw a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①⑥">TypeError</a></code>.</p> </ol> </div> <p>The static <code>BluetoothUUID.<dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothUUID" data-dfn-type="method" data-export data-lt="getService(name)" id="dom-bluetoothuuid-getservice"><code> getService(<var>name</var>)</code></dfn></code> method, when invoked, MUST return <a data-link-type="dfn" href="#resolveuuidname" id="ref-for-resolveuuidname">ResolveUUIDName</a>(<code><var>name</var></code>, <a data-link-type="dfn" href="#gatt-assigned-services" id="ref-for-gatt-assigned-services①">GATT assigned services</a>).</p> <p>The static <code>BluetoothUUID.<dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothUUID" data-dfn-type="method" data-export data-lt="getCharacteristic(name)" id="dom-bluetoothuuid-getcharacteristic"><code> getCharacteristic(<var>name</var>)</code></dfn></code> method, when invoked, MUST return <a data-link-type="dfn" href="#resolveuuidname" id="ref-for-resolveuuidname①">ResolveUUIDName</a>(<code><var>name</var></code>, <a data-link-type="dfn" href="#gatt-assigned-characteristics" id="ref-for-gatt-assigned-characteristics①">GATT assigned characteristics</a>).</p> <p>The static <code>BluetoothUUID.<dfn class="dfn-paneled idl-code" data-dfn-for="BluetoothUUID" data-dfn-type="method" data-export data-lt="getDescriptor(name)" id="dom-bluetoothuuid-getdescriptor"><code> getDescriptor(<var>name</var>)</code></dfn></code> method, when invoked, MUST return <a data-link-type="dfn" href="#resolveuuidname" id="ref-for-resolveuuidname②">ResolveUUIDName</a>(<code><var>name</var></code>, <a data-link-type="dfn" href="#gatt-assigned-descriptors" id="ref-for-gatt-assigned-descriptors①">GATT assigned descriptors</a>).</p> <div class="example" id="example-650faeb7"> <a class="self-link" href="#example-650faeb7"></a> <code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①③">BluetoothUUID.getService</a></code>("<a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_services.txt#:~:text=cycling_power" id="ref-for-:~:text=cycling_power"> cycling_power</a>")</code> returns <code>"00001818-0000-1000-8000-00805f9b34fb"</code>. <p><code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①④">BluetoothUUID.getService</a></code>("00001801-0000-1000-8000-00805f9b34fb")</code> returns <code>"00001801-0000-1000-8000-00805f9b34fb"</code>.</p> <p><code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①⑤">BluetoothUUID.getService</a></code>("unknown-service")</code> throws a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror" id="ref-for-sec-native-error-types-used-in-this-standard-typeerror①⑦">TypeError</a></code>.</p> <p><code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getcharacteristic" id="ref-for-dom-bluetoothuuid-getcharacteristic④">BluetoothUUID.getCharacteristic</a></code>("<code class="idl"><a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=ieee_11073-20601_regulatory_certification_data_list" id="ref-for-:~:text=ieee_11073-20601_regulatory_certification_data_list">ieee_11073-20601_regulatory_certification_data_list</a></code>")</code> returns <code>"00002a2a-0000-1000-8000-00805f9b34fb"</code>.</p> <p><code><code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getdescriptor" id="ref-for-dom-bluetoothuuid-getdescriptor④">BluetoothUUID.getDescriptor</a></code>("<code class="idl"><a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_descriptors.txt#:~:text=gatt.characteristic_presentation_format" id="ref-for-:~:text=gatt.characteristic_presentation_format">gatt.characteristic_presentation_format</a></code>")</code> returns <code>"00002904-0000-1000-8000-00805f9b34fb"</code>.</p> </div> <h3 class="heading settled" data-level="7.2" id="gatt-assigned-numbers"><span class="secno">7.2. </span><span class="content">GATT assigned numbers</span><a class="self-link" href="#gatt-assigned-numbers"></a></h3> <p>This specification provides human-readable names for GATT assigned numbers to increase readability for developers using standardized GATT services, characteristics, and descriptors. The GATT assigned numbers files live in the <a href="https://github.com/WebBluetoothCG/registries">https://github.com/WebBluetoothCG/registries</a> repository.</p> <div class="note" role="note"> This specification previously used a mapping table, provided by the Bluetooth SIG, for defining these human-readable names. When discovered it was no longer maintained, a mapping table was specified directly in the specification. </div> <div class="algorithm" data-algorithm="parsing the GATT assigned numbers"> The result of <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="parsing-the-gatt-assigned-numbers">parsing the GATT assigned numbers</dfn> at a URL <var>url</var> is a map from <a data-link-type="dfn" href="#valid-name" id="ref-for-valid-name④">valid name</a>s to <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid⑧">valid UUID</a>s, or an error, produced by the following algorithm: <ol> <li data-md> <p>Fetch <var>url</var>, and let <var>contents</var> be its body, decoded as UTF-8.</p> <li data-md> <p>Let <var>lines</var> be <var>contents</var> split on <code>'\n'</code>.</p> <li data-md> <p>Let <var>result</var> be an empty map.</p> <li data-md> <p>For each <var>line</var> in <var>lines</var>, do the following sub-steps:</p> <ol> <li data-md> <p>If <var>line</var> is empty or its first character is <code>'#'</code>, continue to the next line.</p> <li data-md> <p>If <var>line</var> consists of a <a data-link-type="dfn" href="#valid-name" id="ref-for-valid-name⑤">valid name</a>, a space (U+0020), and a <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid⑨">valid UUID</a>, let <var>name</var> be that name and let <var>uuid</var> be that UUID.</p> <li data-md> <p>Otherwise, return an error and abort these steps.</p> <li data-md> <p>If <var>name</var> is already in <var>result</var>, return an error and abort these steps.</p> <li data-md> <p>Add a mapping in <var>result</var> from <var>name</var> to <var>uuid</var>.</p> </ol> <li data-md> <p>Return <var>result</var>.</p> </ol> </div> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="gatt-assigned-services">GATT assigned services</dfn> are the result of <a data-link-type="dfn" href="#parsing-the-gatt-assigned-numbers" id="ref-for-parsing-the-gatt-assigned-numbers">parsing the GATT assigned numbers</a> at <a href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_services.txt"> https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_services.txt</a>. The UA should re-fetch this file periodically, but it’s unspecified how often.</p> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="gatt-assigned-characteristics">GATT assigned characteristics</dfn> are the result of <a data-link-type="dfn" href="#parsing-the-gatt-assigned-numbers" id="ref-for-parsing-the-gatt-assigned-numbers①">parsing the GATT assigned numbers</a> at <a href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt"> https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt</a>. The UA should re-fetch this file periodically, but it’s unspecified how often.</p> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="gatt-assigned-descriptors">GATT assigned descriptors</dfn> are the result of <a data-link-type="dfn" href="#parsing-the-gatt-assigned-numbers" id="ref-for-parsing-the-gatt-assigned-numbers②">parsing the GATT assigned numbers</a> at <a href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_descriptors.txt"> https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_descriptors.txt</a>. The UA should re-fetch this file periodically, but it’s unspecified how often.</p> <h2 class="heading settled" data-level="8" id="advertising-data-filter"><span class="secno">8. </span><span class="content">Advertising Data Filter</span><a class="self-link" href="#advertising-data-filter"></a></h2> <p>An advertising data filter represents a way to match against manufacturer or service data.</p> <div class="algorithm" data-algorithm="parse an advertising data filter"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="parse-an-advertising-data-filter">parse an advertising data filter</dfn> from a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string" id="ref-for-string">string</a> <var>input</var>, perform the following steps: <ol> <li data-md> <p>Let <var>words</var> be <var>input</var> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#strictly-split" id="ref-for-strictly-split">strictly split</a> on <code>/</code>.</p> <li data-md> <p>If the length of <var>words</var> is not equal to <code>2</code>, return an error and abort these steps.</p> <li data-md> <p>If the length of <var>words</var>[0] is not equal to the length of <var>words</var>[1], return an error and abort these steps.</p> <li data-md> <p>Let <var>prefixData</var> be <var>words</var>[0].</p> <li data-md> <p>Let <var>prefixMask</var> be <var>words</var>[1].</p> <li data-md> <p>If <var>prefixData</var> or <var>prefixMask</var> is not a sequence of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-lower-hex-digit" id="ref-for-ascii-lower-hex-digit">ascii lower hex digit</a>, return an error.</p> <li data-md> <p>Let <var>prefixIndex</var> be <code>0</code>.</p> <li data-md> <p>let <var>dataList</var> be an empty list.</p> <li data-md> <p>let <var>maskList</var> be an empty list.</p> <li data-md> <p>While <var>prefixIndex</var> is less than the length of <var>prefixData</var>, do the following sub-steps:</p> <ol> <li data-md> <p>Let <var>data</var> be the result of interpreting the characters at index <var>prefixIndex</var> and <code><var>prefixIndex</var> + 1</code> of <var>prefixData</var> as a hexadecimal number.</p> <li data-md> <p>Let <var>mask</var> be the result of interpreting the characters at index <var>prefixIndex</var> and <code><var>prefixIndex</var> + 1</code> of <var>prefixMask</var> as a hexadecimal number.</p> <li data-md> <p>Append <var>data</var> to <var>dataList</var>.</p> <li data-md> <p>Append <var>mask</var> to <var>maskList</var>.</p> <li data-md> <p>Set <var>prefixIndex</var> to <code>|prefixIndex| + 2</code>.</p> </ol> <li data-md> <p>Let <var>result</var> be a new <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit⑧">BluetoothDataFilterInit</a></code> dictionary.</p> <li data-md> <p>Set <var>result</var>[<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-dataprefix" id="ref-for-dom-bluetoothdatafilterinit-dataprefix⑤">dataPrefix</a></code>] to an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-Uint8Array" id="ref-for-idl-Uint8Array">Uint8Array</a></code> constructed with <var>dataList</var>.</p> <li data-md> <p>Set <var>result</var>[<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdatafilterinit-mask" id="ref-for-dom-bluetoothdatafilterinit-mask⑨">mask</a></code>] to an <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-Uint8Array" id="ref-for-idl-Uint8Array①">Uint8Array</a></code> constructed with <var>maskList</var>.</p> <li data-md> <p>Return <var>result</var>.</p> </ol> </div> <h2 class="heading settled" data-level="9" id="the-blocklist"><span class="secno">9. </span><span class="content">The Blocklist</span><a class="self-link" href="#the-blocklist"></a></h2> <p>This specification relies on blocklist files in the <a href="https://github.com/WebBluetoothCG/registries"> https://github.com/WebBluetoothCG/registries</a> repository to restrict the set of GATT attributes and manufacturer data a website can access.</p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="valid-company-identifier-string">valid company identifier string</dfn> is a seqeunce of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-lower-hex-digit" id="ref-for-ascii-lower-hex-digit①">ascii lower hex digit</a> that its length is bigger than <code>0</code> and less than <code>5</code>. The official list of company identifies can be found on <a href="https://www.bluetooth.com/specifications/assigned-numbers/">Bluetooth Assigned Numbers website</a>.</p> <div class="algorithm" data-algorithm="parsing the manufacturer data blocklist"> The result of <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="parsing-the-manufacturer-data-blocklist">parsing the manufacturer data blocklist</dfn> at a URL <var>url</var> is a map from Company Identifier Code to a list of <code class="idl"><a data-link-type="idl" href="#dictdef-bluetoothdatafilterinit" id="ref-for-dictdef-bluetoothdatafilterinit⑨">BluetoothDataFilterInit</a></code>, or an error, produced by the following algorithm: <ol> <li data-md> <p>Fetch <var>url</var>, and let <var>contents</var> be its body, decoded as UTF-8.</p> <li data-md> <p>Let <var>lines</var> be the result of invoking <code class="idl"><a data-link-type="idl" href="https://tc39.es/ecma262/multipage/text-processing.html#sec-string.prototype.split" id="ref-for-sec-string.prototype.split">split(separator, limit)</a></code> on <var>contents</var> with separator <code>'\n'</code>.</p> <li data-md> <p>Let <var>result</var> be an empty map.</p> <li data-md> <p>For each <var>line</var> in <var>lines</var>, do the following sub-steps:</p> <ol> <li data-md> <p>If <var>line</var> is empty or its first character is <code>'#'</code>, continue to the next line.</p> <li data-md> <p>Let <var>regExp</var> be a <code class="idl"><a data-link-type="idl" href="https://tc39.es/ecma262/multipage/text-processing.html#sec-regexp-regular-expression-objects" id="ref-for-sec-regexp-regular-expression-objects">RegExp</a></code> constructed with 'manufacturer\ ([0-9a-f]+)\ ([0-9a-f]+\/[0-9a-f]+)'.</p> <li data-md> <p>Let <var>matchResult</var> be the result of invoking <var>regExp</var>.<code class="idl"><a data-link-type="idl" href="https://tc39.es/ecma262/multipage/text-processing.html#sec-regexp.prototype.exec" id="ref-for-sec-regexp.prototype.exec">exec(string)</a></code> on <var>line</var>, or return an error if <var>matchResult</var> is <code>null</code> or the length of <var>matchResult</var> is not equal to <code>3</code>.</p> <li data-md> <p>Let <var>companyIdentifierStr</var> be <var>matchResult</var>[1] if <var>matchResult</var>[1] is a <a data-link-type="dfn" href="#valid-company-identifier-string" id="ref-for-valid-company-identifier-string">valid company identifier string</a>, otherwise return an error.</p> <li data-md> <p>Let <var>companyIdentifier</var> be the result of interpreting <var>companyIdentifierStr</var> as a hexadecimal number.</p> <li data-md> <p>Let <var>dataPrefixStr</var> be <var>matchResult</var>[2].</p> <li data-md> <p>If <var>companyIdentifier</var> is not in <var>result</var>, set <var>result</var>[<var>companyIdentifier</var>] to be an empty list.</p> <li data-md> <p>Let <var>dataFilter</var> be the result of <a data-link-type="dfn" href="#parse-an-advertising-data-filter" id="ref-for-parse-an-advertising-data-filter">parsing an advertising data filter</a> at <var>dataPrefixStr</var> if the result is not an error, otherwise return an error.</p> <li data-md> <p>Append <var>dataFilter</var> to <var>result</var>[<var>companyIdentifier</var>].</p> </ol> <li data-md> <p>Return <var>result</var>.</p> </ol> </div> <div class="algorithm" data-algorithm="parsing the GATT blocklist"> The result of <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="parsing-the-gatt-blocklist">parsing the gatt blocklist</dfn> at a URL <var>url</var> is a map from <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid①⓪">valid UUID</a>s to tokens, or an error, produced by the following algorithm: <ol> <li data-md> <p>Fetch <var>url</var>, and let <var>contents</var> be its body, decoded as UTF-8.</p> <li data-md> <p>Let <var>lines</var> be <var>contents</var> split on <code>'\n'</code>.</p> <li data-md> <p>Let <var>result</var> be an empty map.</p> <li data-md> <p>For each <var>line</var> in <var>lines</var>, do the following sub-steps:</p> <ol> <li data-md> <p>If <var>line</var> is empty or its first character is <code>'#'</code>, continue to the next line.</p> <li data-md> <p>If <var>line</var> consists of just a <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid①①">valid UUID</a>, let <var>uuid</var> be that UUID and let <var>token</var> be "<code>exclude</code>".</p> <li data-md> <p>If <var>line</var> consists of a <a data-link-type="dfn" href="#valid-uuid" id="ref-for-valid-uuid①②">valid UUID</a>, a space (U+0020), and one of the tokens "<code>exclude-reads</code>" or "<code>exclude-writes</code>", let <var>uuid</var> be that UUID and let <var>token</var> be that token.</p> <li data-md> <p>Otherwise, return an error and abort these steps.</p> <li data-md> <p>If <var>uuid</var> is already in <var>result</var>, return an error and abort these steps.</p> <li data-md> <p>Add a mapping in <var>result</var> from <var>uuid</var> to <var>token</var>.</p> </ol> <li data-md> <p>Return <var>result</var>.</p> </ol> </div> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="gatt-blocklist">GATT blocklist</dfn> is the result of <a data-link-type="dfn" href="#parsing-the-gatt-blocklist" id="ref-for-parsing-the-gatt-blocklist">parsing the gatt blocklist</a> at <a href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt"> https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt</a>. The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="manufacturer-data-blocklist">Manufacturer Data blocklist</dfn> is the result of <a data-link-type="dfn" href="#parsing-the-manufacturer-data-blocklist" id="ref-for-parsing-the-manufacturer-data-blocklist">parsing the manufacturer data blocklist</a> at <a href="https://github.com/WebBluetoothCG/registries/blob/master/manufacturer_data_blocklist.txt"> https://github.com/WebBluetoothCG/registries/blob/master/manufacturer_data_blocklist.txt</a>. The UA should re-fetch the blocklist periodically, but it’s unspecified how often.</p> <p>A <a data-link-type="dfn" href="#uuid" id="ref-for-uuid⑦">UUID</a> is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="blocklisted">blocklisted</dfn> if either the <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist①">GATT blocklist</a>’s value is an error, or the UUID maps to "<code>exclude</code>" in the <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist②">GATT blocklist</a>.</p> <p>A <a data-link-type="dfn" href="#uuid" id="ref-for-uuid⑧">UUID</a> is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="blocklisted-for-reads">blocklisted for reads</dfn> if either the <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist③">GATT blocklist</a>’s value is an error, or the UUID maps to either "<code>exclude</code>" or "<code>exclude-reads</code>" in the <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist④">GATT blocklist</a>.</p> <p>A <a data-link-type="dfn" href="#uuid" id="ref-for-uuid⑨">UUID</a> is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="blocklisted-for-writes">blocklisted for writes</dfn> if either the <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist⑤">GATT blocklist</a>’s value is an error, or the UUID maps to either "<code>exclude</code>" or "<code>exclude-writes</code>" in the <a data-link-type="dfn" href="#gatt-blocklist" id="ref-for-gatt-blocklist⑥">GATT blocklist</a>.</p> <div class="algorithm" data-algorithm="blocklisted manufacturer data"> A manufacturer data <var>manufacturerData</var> is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="blocklisted-manufacturer-data">blocklisted manufacturer data</dfn> if the following steps return <code>blocked</code>: <ol> <li data-md> <p>If the <a data-link-type="dfn" href="#manufacturer-data-blocklist" id="ref-for-manufacturer-data-blocklist">Manufacturer Data blocklist</a>’s value is an error, return <code>blocked</code>.</p> <li data-md> <p>Let <var>manufacturerBlocklist</var> be the <a data-link-type="dfn" href="#manufacturer-data-blocklist" id="ref-for-manufacturer-data-blocklist①">Manufacturer Data blocklist</a>’s value.</p> <li data-md> <p>Let <var>companyIdentifier</var> be the company identifier of <var>manufacturerData</var>.</p> <li data-md> <p>If <var>companyIdentifier</var> is not in <var>manufacturerBlocklist</var>, return <code>unblocked</code>.</p> <li data-md> <p>For each <var>dataFilter</var> in <var>manufacturerBlocklist</var>[<var>companyIdentifier</var>], do the following sub-steps:</p> <ol> <li data-md> <p>If the advertising data of <var>manufacturerData</var> <a data-link-type="dfn" href="#bluetoothdatafilterinit-matches" id="ref-for-bluetoothdatafilterinit-matches②">matches</a> <var>dataFilter</var>, return <code>blocked</code>.</p> </ol> <li data-md> <p>Return <code>unblocked</code>.</p> </ol> </div> <div class="algorithm" data-algorithm="blocklisted manufacturer data filter"> A manufacturer data filter <var>manufacturerDataFilter</var> is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="blocklisted-manufacturer-data-filter">blocklisted manufacturer data filter</dfn> if the following steps return <code>blocked</code>: <ol> <li data-md> <p>If the <a data-link-type="dfn" href="#manufacturer-data-blocklist" id="ref-for-manufacturer-data-blocklist②">Manufacturer Data blocklist</a>’s value is an error, return <code>blocked</code>.</p> <li data-md> <p>Let <var>manufacturerBlocklist</var> be the <a data-link-type="dfn" href="#manufacturer-data-blocklist" id="ref-for-manufacturer-data-blocklist③">Manufacturer Data blocklist</a>’s value.</p> <li data-md> <p>Let <var>companyIdentifier</var> be <var>manufacturerDataFilter</var>["<code class="idl"><a data-link-type="idl" href="#dom-bluetoothmanufacturerdatafilterinit-companyidentifier" id="ref-for-dom-bluetoothmanufacturerdatafilterinit-companyidentifier③">companyIdentifier</a></code>"].</p> <li data-md> <p>If <var>companyIdentifier</var> is not in <var>manufacturerBlocklist</var>, return <code>unblocked</code>.</p> <li data-md> <p>For each <var>dataFilter</var> in <var>manufacturerBlocklist</var>[<var>companyIdentifier</var>], do the following sub-steps:</p> <ol> <li data-md> <p>If <var>manufacturerDataFilter</var> is a <a data-link-type="dfn" href="#bluetoothdatafilterinit-strict-subset" id="ref-for-bluetoothdatafilterinit-strict-subset">strict subset</a> of <var>dataFilter</var>, return <code>blocked</code>.</p> </ol> <li data-md> <p>Return <code>unblocked</code>.</p> </ol> </div> <h2 class="heading settled" data-level="10" id="navigator-extensions"><span class="secno">10. </span><span class="content">Extensions to the Navigator Interface</span><a class="self-link" href="#navigator-extensions"></a></h2> <pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext①④"><c- g>SecureContext</c-></a>] <c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator"><c- g>Navigator</c-></a> { [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject" id="ref-for-SameObject⑧"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetooth" id="ref-for-bluetooth①②"><c- n>Bluetooth</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Bluetooth" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth⑦"><c- g>bluetooth</c-></a>; }; </pre> <p>Each <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator①">Navigator</a></code> has an <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="associated-bluetooth">associated <code>Bluetooth</code></dfn>, which is a <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth①③">Bluetooth</a></code> object. Upon creation of the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator②">Navigator</a></code> object, its <a data-link-type="dfn" href="#associated-bluetooth" id="ref-for-associated-bluetooth">associated <code>Bluetooth</code></a> must be set to a new <code class="idl"><a data-link-type="idl" href="#bluetooth" id="ref-for-bluetooth①④">Bluetooth</a></code> object created in the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator③">Navigator</a></code> object’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm" id="ref-for-concept-relevant-realm">relevant realm</a>.</p> <p><code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator④">Navigator</a></code>'s <dfn class="dfn-paneled idl-code" data-dfn-for="Navigator" data-dfn-type="attribute" data-export id="dom-navigator-bluetooth"><code>bluetooth</code></dfn> getter steps are to return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this④">this</a>'s <a data-link-type="dfn" href="#associated-bluetooth" id="ref-for-associated-bluetooth①">associated <code>Bluetooth</code></a>.</p> <h2 class="heading settled" data-level="11" id="integrations"><span class="secno">11. </span><span class="content">Integrations</span><a class="self-link" href="#integrations"></a></h2> <h3 class="heading settled" data-level="11.1" id="permissions-policy"><span class="secno">11.1. </span><span class="content">Permissions Policy</span><a class="self-link" href="#permissions-policy"></a></h3> <p>This specification defines a <a data-link-type="dfn" href="https://w3c.github.io/webappsec-permissions-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature③">policy-controlled feature</a>, identified by the token "<dfn class="dfn-paneled" data-dfn-for="policy-controlled feature" data-dfn-type="dfn" data-noexport id="policy-controlled-feature-bluetooth"><code>bluetooth</code></dfn>", that controls whether the methods exposed by the <code class="idl"><a data-link-type="idl" href="#dom-navigator-bluetooth" id="ref-for-dom-navigator-bluetooth⑧">bluetooth</a></code> attribute on the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator⑤">Navigator</a></code> object may be used.</p> <p>The <a data-link-type="dfn" href="https://w3c.github.io/webappsec-permissions-policy/#policy-controlled-feature-default-allowlist" id="ref-for-policy-controlled-feature-default-allowlist">default allowlist</a> for this feature is <code>["self"]</code>.</p> <h2 class="heading settled" data-level="12" id="automated-testing"><span class="secno">12. </span><span class="content">Automated testing</span><a class="self-link" href="#automated-testing"></a></h2> <p>For the purposes of user-agent automation and application testing, this document defines extensions to the <a data-link-type="biblio" href="#biblio-webdriver-bidi" title="WebDriver BiDi">[WebDriver-BiDi]</a> specification.</p> <p>The Web Bluetooth API and its extension specifications pose a challenge to test authors, as fully exercising those interfaces requires physical hardware devices that respond in predictable ways. To address this challenge this document defines a number of WebDriver-BiDi extension commands that allow defining and controlling simulated peripherals and advertisements that behave like physical device peripherals and their advertisements. These simulated peripherals and advertisements represent devices with particular properties and whose readings can be entirely defined by users.</p> <p>Each <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#nav-top" id="ref-for-nav-top②">top-level traversable</a> may have a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="simulated-bluetooth-adapter">simulated Bluetooth adapter</dfn>, that is a software defined Bluetooth adapter that has a set of discovered <a data-link-type="dfn" href="#simulated-bluetooth-device" id="ref-for-simulated-bluetooth-device">simulated Bluetooth devices</a> and can assume roles like <a data-link-type="dfn" href="#central" id="ref-for-central④">Central</a>.</p> <p>Each <a data-link-type="dfn" href="#simulated-bluetooth-adapter" id="ref-for-simulated-bluetooth-adapter②">simulated Bluetooth adapter</a> has a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="simulated-bluetooth-device-mapping">simulated Bluetooth device mapping</dfn>, which is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map">ordered map</a> of Bluetooth address <code class="idl"><a data-link-type="idl" href="https://wicg.github.io/webhid/#dom-hidreportitem-strings" id="ref-for-dom-hidreportitem-strings">strings</a></code> to <a data-link-type="dfn" href="#simulated-bluetooth-device" id="ref-for-simulated-bluetooth-device①">simulated Bluetooth devices</a>.</p> <p>Each <a data-link-type="dfn" href="#simulated-bluetooth-adapter" id="ref-for-simulated-bluetooth-adapter③">simulated Bluetooth adapter</a> has an <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="adapter-state">adapter state</dfn> that is a string enumeration describing the current state of the adapter. The possible enumeration values are:</p> <ul> <li data-md> <p>"powered-on"</p> <li data-md> <p>"powered-off"</p> <li data-md> <p>"absent"</p> </ul> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="simulated-bluetooth-device">simulated Bluetooth device</dfn> is a software defined <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device①⑨">Bluetooth device</a> that behaves like a physical device, and may be attached to a <a data-link-type="dfn" href="#simulated-bluetooth-adapter" id="ref-for-simulated-bluetooth-adapter④">simulated Bluetooth adapter</a>, and may have associated properties like <a data-link-type="dfn" href="#manufacturer-specific-data" id="ref-for-manufacturer-specific-data④">Manufacturer Specific Data</a> and <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type⑧">Service UUIDs</a>.</p> <p class="issue" id="issue-194ad560"><a class="self-link" href="#issue-194ad560"></a> CDDL snippetes use the "text" type instead of "browsingContext.BrowsingContext" to allow indepedent programmatic processing of CDDL snippets. Currently, other modules cannot be referenced.</p> <h3 class="heading settled" data-level="12.1" id="bluetooth-bidi-definitions"><span class="secno">12.1. </span><span class="content">Definitions</span><a class="self-link" href="#bluetooth-bidi-definitions"></a></h3> <pre class="cddl local-cddl remote-cddl">bluetooth.BluetoothServiceUuid = text; bluetooth.BluetoothManufacturerData = { key: uint, data: tstr }; </pre> <dl> <dt><code>key</code> <dd>is the Company Identifier Code. <dt><code>data</code> <dd>is the manufacturer data <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence">byte sequence</a>, base64 encoded. </dl> <h3 class="heading settled" data-level="12.2" id="bluetooth-module"><span class="secno">12.2. </span><span class="content">The bluetooth module</span><a class="self-link" href="#bluetooth-module"></a></h3> <p>The bluetooth module contains commands for managing the remote end Bluetooth behavior.</p> <h4 class="heading settled" data-level="12.2.1" id="bidi-types"><span class="secno">12.2.1. </span><span class="content">Types</span><a class="self-link" href="#bidi-types"></a></h4> <h5 class="heading settled" data-level="12.2.1.1" id="bluetooth-requestdevice-type"><span class="secno">12.2.1.1. </span><span class="content">The bluetooth.RequestDevice Type</span><a class="self-link" href="#bluetooth-requestdevice-type"></a></h5> <pre class="cddl local-cddl remote-cddl highlight"><c- nc>bluetooth.RequestDevice</c-> <c- o>=</c-> text </pre> <p>A bluetooth.RequestDevice is an identifier for a single device in a request device prompt.</p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="device-prompt">device prompt</dfn> is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple">tuple</a> consisting of a <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="device prompt id" data-noexport id="device-prompt-id">device prompt id</dfn> (a string) and a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="set-of-devices">set of devices</dfn> which is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set">set</a> of <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice④⑥">BluetoothDevice</a></code> objects. It represents a prompt which allows a user to <a data-link-type="dfn" href="https://w3c.github.io/permissions/#dfn-prompt-the-user-to-choose" id="ref-for-dfn-prompt-the-user-to-choose①">choose</a> a <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device②⓪">Bluetooth device</a>.</p> <h5 class="heading settled" data-level="12.2.1.2" id="bluetooth-requestdeviceinfo-type"><span class="secno">12.2.1.2. </span><span class="content">The bluetooth.RequestDeviceInfo Type</span><a class="self-link" href="#bluetooth-requestdeviceinfo-type"></a></h5> <pre class="cddl local-cddl remote-cddl highlight"><c- nc>bluetooth.RequestDeviceInfo</c-> <c- o>=</c-> <c- p>{</c-> <c- s>id</c-><c- p>:</c-> <c- nc>bluetooth.RequestDevice</c-><c- p>,</c-> <c- s>name</c-><c- p>:</c-> text <c- o>/</c-> null<c- p>,</c-> <c- p>}</c-> </pre> <p>A bluetooth.RequestDeviceInfo represents a single device in a request device prompt.</p> <div class="algorithm" data-algorithm="serialize device"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="serialize-a-device">serialize a device</dfn> given a <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice④⑦">BluetoothDevice</a></code> <var>device</var>: <ol> <li data-md> <p>Let <var>id</var> be <var>device</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-id" id="ref-for-dom-bluetoothdevice-id②">id</a></code>.</p> <li data-md> <p>Let <var>name</var> be <var>device</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-name" id="ref-for-dom-bluetoothdevice-name①">name</a></code>.</p> <li data-md> <p>Return a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map①">map</a> matching the <code>bluetooth.RequestDeviceInfo</code> production, with <code>"id"</code> set to <var>id</var> and <code>"name"</code> set to <var>name</var>.</p> </ol> </div> <h5 class="heading settled" data-level="12.2.1.3" id="bluetooth-requestdeviceprompt-type"><span class="secno">12.2.1.3. </span><span class="content">The bluetooth.RequestDevicePrompt Type</span><a class="self-link" href="#bluetooth-requestdeviceprompt-type"></a></h5> <pre class="cddl local-cddl remote-cddl highlight"><c- nc>bluetooth.RequestDevicePrompt</c-> <c- o>=</c-> text </pre> <p>A bluetooth.RequestDevicePrompt is an identifier for a single prompt.</p> <p>A remote end has a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="map-of-navigables-to-device-prompts">map of navigables to device prompts</dfn> which is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map②">map</a> whose keys are <a data-link-type="dfn" href="https://w3c.github.io/webdriver-bidi/#navigable-id" id="ref-for-navigable-id①">navigable ids</a> and values are <a data-link-type="dfn" href="#device-prompt" id="ref-for-device-prompt">device prompts</a>.</p> <div class="algorithm" data-algorithm="get a prompt"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="get-a-prompt">get a prompt</dfn> given <var>navigableId</var> and <var>promptId</var>: <ol> <li data-md> <p>Let <var>promptMap</var> be the <a data-link-type="dfn" href="#map-of-navigables-to-device-prompts" id="ref-for-map-of-navigables-to-device-prompts①">map of navigables to device prompts</a>.</p> <li data-md> <p>If <var>promptMap</var>[<var>navigableId</var>] does not <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists">exist</a>:</p> <ol> <li data-md> <p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error" id="ref-for-dfn-error">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code">error code</a> <a data-link-type="dfn" href="#no-such-prompt" id="ref-for-no-such-prompt">no such prompt</a>.</p> </ol> <li data-md> <p>Let <var>prompt</var> be <a data-link-type="dfn" href="#map-of-navigables-to-device-prompts" id="ref-for-map-of-navigables-to-device-prompts②">map of navigables to device prompts</a>[<var>navigableId</var>].</p> <li data-md> <p>If <var>prompt</var>’s <a data-link-type="dfn" href="#device-prompt-id" id="ref-for-device-prompt-id">device prompt id</a> is not <var>promptId</var>:</p> <ol> <li data-md> <p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error" id="ref-for-dfn-error①">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code①">error code</a> <a data-link-type="dfn" href="#no-such-prompt" id="ref-for-no-such-prompt①">no such prompt</a>.</p> </ol> <li data-md> <p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-success" id="ref-for-dfn-success">success</a> with data <var>prompt</var>.</p> </ol> </div> <div class="algorithm" data-algorithm="match a device in prompt"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="match-a-device-in-prompt">match a device in prompt</dfn> given <a data-link-type="dfn" href="#device-prompt" id="ref-for-device-prompt①">device prompt</a> <var>prompt</var> and <var>deviceId</var>: <ol> <li data-md> <p>For each <var>device</var> in <var>prompt</var>’s <a data-link-type="dfn" href="#set-of-devices" id="ref-for-set-of-devices">set of devices</a>:</p> <ol> <li data-md> <p>If <var>device</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-id" id="ref-for-dom-bluetoothdevice-id③">id</a></code> is <var>deviceId</var>, return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-success" id="ref-for-dfn-success①">success</a> with data <var>device</var>.</p> </ol> <li data-md> <p>Otherwise:</p> <ol> <li data-md> <p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error" id="ref-for-dfn-error②">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code②">error code</a> <a data-link-type="dfn" href="#no-such-device" id="ref-for-no-such-device">no such device</a>.</p> </ol> </ol> </div> <div class="algorithm" data-algorithm="serialize prompt devices"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="serialize-prompt-devices">serialize prompt devices</dfn> given <a data-link-type="dfn" href="#device-prompt" id="ref-for-device-prompt②">device prompt</a> <var>prompt</var>: <ol> <li data-md> <p>Let <var>devices</var> be an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①">list</a>.</p> <li data-md> <p>For each <var>device</var> in <var>prompt</var>’s <a data-link-type="dfn" href="#set-of-devices" id="ref-for-set-of-devices①">set of devices</a>.</p> <ol> <li data-md> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append">Append</a> the result of <a data-link-type="dfn" href="#serialize-a-device" id="ref-for-serialize-a-device">serializing</a> <var>device</var> to <var>devices</var>.</p> </ol> <li data-md> <p>Return <var>devices</var>.</p> </ol> </div> <h5 class="heading settled" data-level="12.2.1.4" id="bluetooth-scanrecord-type"><span class="secno">12.2.1.4. </span><span class="content">The bluetooth.ScanRecord Type</span><a class="self-link" href="#bluetooth-scanrecord-type"></a></h5> <pre class="cddl local-cddl remote-cddl highlight"><c- nc>bluetooth.ScanRecord</c-> <c- o>=</c-> <c- p>{</c-> <c- o>?</c-> <c- s>name</c-><c- p>:</c-> text<c- p>,</c-> <c- o>?</c-> <c- s>uuids</c-><c- p>:</c-> <c- p>[</c-> <c- o>*</c-> <c- nc>bluetooth.BluetoothServiceUuid</c-> <c- p>],</c-> <c- o>?</c-> <c- s>appearance</c-><c- p>:</c-> number<c- p>,</c-> <c- o>?</c-> <c- s>manufacturerData</c-><c- p>:</c-> <c- p>[</c-> <c- o>*</c-> <c- nc>bluetooth.BluetoothManufacturerData</c-> <c- p>],</c-> <c- p>}</c-> </pre> <p>A <code>bluetooth.ScanRecord</code> represents data of the advertisement packet sent by a <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device②①">Bluetooth device</a>.</p> <dl> <dt><code>name</code> <dd>is the <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device②②">Bluetooth device</a>'s local name, or a prefix of it. <dt><code>uuids</code> <dd>lists the Service UUIDs that this scan record says the <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device②③">Bluetooth device</a>'s GATT server supports. <dt><code>appearance</code> <dd>is an <a data-link-type="dfn" href="#appearance" id="ref-for-appearance②">Appearance</a>, one of the values defined by the <code class="idl"><a data-link-type="idl" href="https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=gap.appearance" id="ref-for-:~:text=gap.appearance①">gap.appearance</a></code> characteristic. <dt><code>manufacturerData</code> <dd>list of <code>BluetoothManufacturerData</code> that maps <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-unsigned-short" id="ref-for-idl-unsigned-short⑨">unsigned short</a></code> Company Identifier Codes to base64 encoded manufacturer data <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①">byte sequences</a>. </dl> <h4 class="heading settled" data-level="12.2.2" id="bidi-errors"><span class="secno">12.2.2. </span><span class="content">Errors</span><a class="self-link" href="#bidi-errors"></a></h4> <p>This specification extends the set of <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code③">error codes</a> from <a data-link-type="biblio" href="#biblio-webdriver-bidi" title="WebDriver BiDi">WebDriver BiDi</a> with the following additional codes:</p> <dl> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="no-such-device">no such device</dfn> <dd>Tried to reference an unknown <code class="idl"><a data-link-type="idl" href="#bluetoothdevice" id="ref-for-bluetoothdevice④⑧">BluetoothDevice</a></code>. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="no-such-prompt">no such prompt</dfn> <dd>Tried to reference an unknown <a data-link-type="dfn" href="#device-prompt" id="ref-for-device-prompt③">device prompt</a>. </dl> <h4 class="heading settled" data-level="12.2.3" id="bidi-commands"><span class="secno">12.2.3. </span><span class="content">Commands</span><a class="self-link" href="#bidi-commands"></a></h4> <h5 class="heading settled" data-level="12.2.3.1" id="bluetooth-handlerequestdeviceprompt-command"><span class="secno">12.2.3.1. </span><span class="content">The bluetooth.handleRequestDevicePrompt Command</span><a class="self-link" href="#bluetooth-handlerequestdeviceprompt-command"></a></h5> <pre class="cddl local-cddl remote-cddl highlight"><c- nc>bluetooth.HandleRequestDevicePrompt</c-> <c- o>=</c-> <c- p>(</c-> <c- s>method</c-><c- p>:</c-> <c- u>"bluetooth.handleRequestDevicePrompt"</c-><c- p>,</c-> <c- s>params</c-><c- p>:</c-> <c- nc>bluetooth.HandleRequestDevicePromptParameters</c-><c- p>,</c-> <c- p>)</c-> <c- nc>bluetooth.HandleRequestDevicePromptParameters</c-> <c- o>=</c-> <c- p>{</c-> <c- s>context</c-><c- p>:</c-> text<c- p>,</c-> <c- s>prompt</c-><c- p>:</c-> <c- nc>bluetooth.RequestDevicePrompt</c-><c- p>,</c-> <c- p>(</c-> <c- nc>bluetooth.HandleRequestDevicePromptAcceptParameters</c-> <c- o>//</c-> <c- nc>bluetooth.HandleRequestDevicePromptCancelParameters</c-> <c- p>)</c-> <c- p>}</c-> <c- nc>bluetooth.HandleRequestDevicePromptAcceptParameters</c-> <c- o>=</c-> <c- p>(</c-> <c- s>accept</c-><c- p>:</c-> true<c- p>,</c-> <c- s>device</c-><c- p>:</c-> <c- nc>bluetooth.RequestDevice</c-><c- p>,</c-> <c- p>)</c-> <c- nc>bluetooth.HandleRequestDevicePromptCancelParameters</c-> <c- o>=</c-> <c- p>(</c-> <c- s>accept</c-><c- p>:</c-> false<c- p>,</c-> <c- p>)</c-> </pre> <div class="algorithm" data-algorithm="remote end steps for bluetooth.handleRequestDevicePrompt"> The <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-remote-end-steps" id="ref-for-dfn-remote-end-steps">remote end steps</a> with <var>command parameters</var> are: <ol> <li data-md> <p>Let <var>contextId</var> be <var>params</var>[<code>"context"</code>].</p> <li data-md> <p>Let <var>promptId</var> be <var>params</var>[<code>"prompt"</code>].</p> <li data-md> <p>Let <var>prompt</var> be the result of <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-try" id="ref-for-dfn-try">trying</a> to <a data-link-type="dfn" href="#get-a-prompt" id="ref-for-get-a-prompt">get a prompt</a> with <var>contextId</var> and <var>promptId</var>.</p> <li data-md> <p>Let <var>accept</var> be the value of the <code>accept</code> field of <var>command parameters</var>.</p> <li data-md> <p>If <var>accept</var> is true:</p> <ol> <li data-md> <p>Let <var>deviceId</var> be the value of the <code>device</code> field of <var>command parameters</var>.</p> <li data-md> <p>Let <var>device</var> be the result of <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-try" id="ref-for-dfn-try①">trying</a> to <a data-link-type="dfn" href="#match-a-device-in-prompt" id="ref-for-match-a-device-in-prompt">match a device in prompt</a> given <var>prompt</var> and <var>deviceId</var>.</p> <li data-md> <p>Acknowledge <var>prompt</var> with <var>device</var>.</p> </ol> <li data-md> <p>Otherwise:</p> <ol> <li data-md> <p>Dismiss <var>prompt</var>.</p> </ol> <li data-md> <p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-success" id="ref-for-dfn-success②">success</a> with data <code>null</code>.</p> </ol> </div> <div class="example" id="example-7968adf4"> <a class="self-link" href="#example-7968adf4"></a> A <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-local-ends" id="ref-for-dfn-local-ends">local end</a> could dismiss a prompt by sending the following message: <pre class="highlight"><c- p>{</c-> <c- f>"method"</c-><c- p>:</c-> <c- u>"bluetooth.handleRequestDevicePrompt"</c-><c- p>,</c-> <c- f>"params"</c-><c- p>:</c-> <c- p>{</c-> <c- f>"context"</c-><c- p>:</c-> <c- u>"cxt-d03fdd81"</c-><c- p>,</c-> <c- f>"prompt"</c-><c- p>:</c-> <c- u>"pmt-e0a234b"</c-><c- p>,</c-> <c- f>"accept"</c-><c- p>:</c-> <c- kc>true</c-><c- p>,</c-> <c- f>"device"</c-><c- p>:</c-> <c- u>"dvc-9b3b872"</c-> <c- p>}</c-> <c- p>}</c-> </pre> </div> <h5 class="heading settled" data-level="12.2.3.2" id="bluetooth-simulateAdapter-command"><span class="secno">12.2.3.2. </span><span class="content">The bluetooth.simulateAdapter Command</span><a class="self-link" href="#bluetooth-simulateAdapter-command"></a></h5> <pre class="cddl local-cddl remote-cddl highlight"><c- nc>bluetooth.simulateAdapter</c-> <c- o>=</c-> <c- p>(</c-> <c- s>method</c-><c- p>:</c-> <c- u>"bluetooth.simulateAdapter"</c-><c- p>,</c-> <c- s>params</c-><c- p>:</c-> <c- nc>bluetooth.SimulateAdapterParameters</c-><c- p>,</c-> <c- p>)</c-> <c- nc>bluetooth.SimulateAdapterParameters</c-> <c- o>=</c-> <c- p>{</c-> <c- s>context</c-><c- p>:</c-> text<c- p>,</c-> <c- s>state</c-><c- p>:</c-> <c- u>"absent"</c-> <c- o>/</c-> <c- u>"powered-off"</c-> <c- o>/</c-> <c- u>"powered-on"</c-> <c- p>}</c-> </pre> <div class="algorithm" data-algorithm="remote end steps for bluetooth.simulateAdapter"> The <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-remote-end-steps" id="ref-for-dfn-remote-end-steps①">remote end steps</a> with command parameters <var>params</var> are: <ol> <li data-md> <p>Let <var>contextId</var> be params["context"].</p> <li data-md> <p>Let <var>navigable</var> be the result of <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-try" id="ref-for-dfn-try②">trying</a> to <a data-link-type="dfn" href="https://w3c.github.io/webdriver-bidi/#get-a-navigable" id="ref-for-get-a-navigable">get a navigable</a> with <var>contextId</var>.</p> <li data-md> <p>If <var>navigable</var> is not a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#nav-top" id="ref-for-nav-top③">top-level traversable</a>, return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error" id="ref-for-dfn-error③">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code④">error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-invalid-argument" id="ref-for-dfn-invalid-argument">invalid argument</a>.</p> <li data-md> <p>Let <var>simulatedBluetoothAdapter</var> be a new <a data-link-type="dfn" href="#simulated-bluetooth-adapter" id="ref-for-simulated-bluetooth-adapter⑤">simulated Bluetooth adapter</a>.</p> <li data-md> <p>Set <var>simulatedBluetoothAdapter</var>’s <a data-link-type="dfn" href="#adapter-state" id="ref-for-adapter-state①">adapter state</a> to <var>params</var>[<code>"state"</code>].</p> <li data-md> <p>Set <var>navigable</var>’s <a data-link-type="dfn" href="#simulated-bluetooth-adapter" id="ref-for-simulated-bluetooth-adapter⑥">simulated Bluetooth adapter</a> to <var>simulatedBluetoothAdapter</var>.</p> <li data-md> <p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-success" id="ref-for-dfn-success③">success</a> with data <code>null</code>.</p> </ol> </div> <div class="example" id="example-5d6ca36f"> <a class="self-link" href="#example-5d6ca36f"></a> A <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-local-ends" id="ref-for-dfn-local-ends①">local end</a> could simulate an adapter by sending the following message: <pre class="highlight"><c- p>{</c-> <c- f>"method"</c-><c- p>:</c-> <c- u>"bluetooth.simulateAdapter"</c-><c- p>,</c-> <c- f>"params"</c-><c- p>:</c-> <c- p>{</c-> <c- f>"context"</c-><c- p>:</c-> <c- u>"cxt-d03fdd81"</c-><c- p>,</c-> <c- f>"state"</c-><c- p>:</c-> <c- u>"powered-on"</c-><c- p>,</c-> <c- p>}</c-> <c- p>}</c-> </pre> </div> <h5 class="heading settled" data-level="12.2.3.3" id="bluetooth-simulateconnectedperipheral-command"><span class="secno">12.2.3.3. </span><span class="content">The bluetooth.simulatePreconnectedPeripheral Command</span><a class="self-link" href="#bluetooth-simulateconnectedperipheral-command"></a></h5> <pre class="cddl local-cddl remote-cddl highlight"><c- nc>bluetooth.SimulatePreconnectedPeripheral</c-> <c- o>=</c-> <c- p>(</c-> <c- s>method</c-><c- p>:</c-> <c- u>"bluetooth.simulatePreconnectedPeripheral"</c-><c- p>,</c-> <c- s>params</c-><c- p>:</c-> <c- nc>bluetooth.SimulatePreconnectedPeripheralParameters</c-><c- p>,</c-> <c- p>)</c-> <c- nc>bluetooth.SimulatePreconnectedPeripheralParameters</c-> <c- o>=</c-> <c- p>{</c-> <c- s>context</c-><c- p>:</c-> text<c- p>,</c-> <c- s>address</c-><c- p>:</c-> text<c- p>,</c-> <c- s>name</c-><c- p>:</c-> text<c- p>,</c-> <c- s>manufacturerData</c-><c- p>:</c-> <c- p>[</c-> <c- o>*</c-> <c- nc>bluetooth.BluetoothManufacturerData</c-> <c- p>],</c-> <c- s>knownServiceUuids</c-><c- p>:</c-> <c- p>[</c-> <c- o>*</c-> <c- nc>bluetooth.BluetoothServiceUuid</c-> <c- p>]</c-> <c- p>}</c-> </pre> <div class="algorithm" data-algorithm="remote end steps for bluetooth.simulatePreconnectedPeripheral"> The <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-remote-end-steps" id="ref-for-dfn-remote-end-steps②">remote end steps</a> with command parameters <var>params</var> are: <ol> <li data-md> <p>Let <var>contextId</var> be params["context"].</p> <li data-md> <p>Let <var>navigable</var> be the result of <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-try" id="ref-for-dfn-try③">trying</a> to <a data-link-type="dfn" href="https://w3c.github.io/webdriver-bidi/#get-a-navigable" id="ref-for-get-a-navigable①">get a navigable</a> with <var>contextId</var>.</p> <li data-md> <p>If <var>navigable</var> is not a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#nav-top" id="ref-for-nav-top④">top-level traversable</a>, return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error" id="ref-for-dfn-error④">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑤">error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-invalid-argument" id="ref-for-dfn-invalid-argument①">invalid argument</a>.</p> <li data-md> <p>Let <var>simulatedBluetoothAdapter</var> be <var>navigable</var>’s <a data-link-type="dfn" href="#simulated-bluetooth-adapter" id="ref-for-simulated-bluetooth-adapter⑦">simulated Bluetooth adapter</a>.</p> <li data-md> <p>If <var>simulatedBluetoothAdapter</var> is empty, return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error" id="ref-for-dfn-error⑤">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑥">error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-invalid-argument" id="ref-for-dfn-invalid-argument②">invalid argument</a>.</p> <li data-md> <p>Let <var>deviceAddress</var> be <var>params</var>[<code>"address"</code>].</p> <li data-md> <p>Let <var>deviceMapping</var> be <var>simulatedBluetoothAdapter</var>’s <a data-link-type="dfn" href="#simulated-bluetooth-device-mapping" id="ref-for-simulated-bluetooth-device-mapping①">simulated Bluetooth device mapping</a>.</p> <li data-md> <p>If <var>deviceMapping</var>[<var>deviceAddress</var>] <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists①">exists</a>, return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error" id="ref-for-dfn-error⑥">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑦">error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-invalid-argument" id="ref-for-dfn-invalid-argument③">invalid argument</a>.</p> <li data-md> <p>Let <var>simulatedBluetoothDevice</var> be a new <a data-link-type="dfn" href="#simulated-bluetooth-device" id="ref-for-simulated-bluetooth-device②">simulated Bluetooth device</a>.</p> <li data-md> <p>Set <var>simulatedBluetoothDevice</var>’s name to <var>params</var>[<code>"name"</code>].</p> <li data-md> <p>Set <var>simulatedBluetoothDevice</var>’s address to <var>params</var>[<code>"address"</code>].</p> <li data-md> <p>Set <var>simulatedBluetoothDevice</var>’s <a data-link-type="dfn" href="#manufacturer-specific-data" id="ref-for-manufacturer-specific-data⑤">manufacturer specific data</a> to the output of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#forgiving-base64-decode" id="ref-for-forgiving-base64-decode">forgiving-base64 decode</a> performed on <var>params</var>[<code>"manufacturerData"</code>].</p> <li data-md> <p>Set <var>simulatedBluetoothDevice</var>’s <a data-link-type="dfn" href="#service-uuid-data-type" id="ref-for-service-uuid-data-type⑨">service UUIDs</a> to <var>params</var>[<code>"knownServiceUuids"</code>].</p> <li data-md> <p>Set <var>deviceMapping</var>[<var>deviceAddress</var>] to <var>simulatedBluetoothDevice</var>.</p> <li data-md> <p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-success" id="ref-for-dfn-success④">success</a> with data <code>null</code>.</p> </ol> </div> <div class="example" id="example-7050eb6b"> <a class="self-link" href="#example-7050eb6b"></a> A <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-local-ends" id="ref-for-dfn-local-ends②">local end</a> could simulate a preconnected peripheral by sending the following message: <pre class="highlight"><c- p>{</c-> <c- f>"method"</c-><c- p>:</c-> <c- u>"bluetooth.simulatePreconnectedPeripheral"</c-><c- p>,</c-> <c- f>"params"</c-><c- p>:</c-> <c- p>{</c-> <c- f>"context"</c-><c- p>:</c-> <c- u>"cxt-d03fdd81"</c-><c- p>,</c-> <c- f>"address"</c-><c- p>:</c-> <c- u>"09:09:09:09:09:09"</c-><c- p>,</c-> <c- f>"name"</c-><c- p>:</c-> <c- u>"Some Device"</c-><c- p>,</c-> <c- f>"manufacturerData"</c-><c- p>:</c-> <c- p>[</c-> <c- p>{</c-> key<c- p>:</c-> <c- mi>17</c-><c- p>,</c-> da<c- kc>ta</c-><c- p>:</c-> <c- u>"AP8BAX8="</c-> <c- p>}</c-> <c- p>],</c-> <c- f>"knownServiceUuids"</c-><c- p>:</c-> <c- p>[</c-> <c- u>"12345678-1234-5678-9abc-def123456789"</c-><c- p>,</c-> <c- p>],</c-> <c- p>}</c-> <c- p>}</c-> </pre> </div> <h5 class="heading settled" data-level="12.2.3.4" id="bluetooth-simulateadvertisement-command"><span class="secno">12.2.3.4. </span><span class="content">The bluetooth.simulateAdvertisement Command</span><a class="self-link" href="#bluetooth-simulateadvertisement-command"></a></h5> <pre class="cddl local-cddl remote-cddl highlight"><c- nc>bluetooth.SimulateAdvertisement</c-> <c- o>=</c-> <c- p>(</c-> <c- s>method</c-><c- p>:</c-> <c- u>"bluetooth.simulateAdvertisement"</c-><c- p>,</c-> <c- s>params</c-><c- p>:</c-> <c- nc>bluetooth.SimulateAdvertisementParameters</c-><c- p>,</c-> <c- p>)</c-> <c- nc>bluetooth.SimulateAdvertisementParameters</c-> <c- o>=</c-> <c- p>{</c-> <c- s>context</c-><c- p>:</c-> text<c- p>,</c-> <c- s>scanEntry</c-><c- p>:</c-> <c- nc>bluetooth.SimulateAdvertisementScanEntryParameters</c-> <c- p>}</c-> <c- nc>bluetooth.SimulateAdvertisementScanEntryParameters</c-> <c- o>=</c-> <c- p>{</c-> <c- s>deviceAddress</c-><c- p>:</c-> text<c- p>,</c-> <c- s>rssi</c-><c- p>:</c-> number<c- p>,</c-> <c- s>scanRecord</c-><c- p>:</c-> <c- nc>bluetooth.ScanRecord</c-> <c- p>}</c-> </pre> <div class="algorithm" data-algorithm="remote end steps for bluetooth.simulateAdvertisement"> The <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-remote-end-steps" id="ref-for-dfn-remote-end-steps③">remote end steps</a> with command parameters <var>params</var> are: <ol> <li data-md> <p>Let <var>contextId</var> be params["context"].</p> <li data-md> <p>Let <var>topLevelNavigable</var> be the result of <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-try" id="ref-for-dfn-try④">trying</a> to <a data-link-type="dfn" href="https://w3c.github.io/webdriver-bidi/#get-a-navigable" id="ref-for-get-a-navigable②">get a navigable</a> with <var>contextId</var>.</p> <li data-md> <p>If <var>topLevelNavigable</var> is not a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#nav-top" id="ref-for-nav-top⑤">top-level traversable</a>, return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error" id="ref-for-dfn-error⑦">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑧">error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-invalid-argument" id="ref-for-dfn-invalid-argument④">invalid argument</a>.</p> <li data-md> <p>Let <var>scanEntry</var> be <var>params</var>[<code>"scanEntry"</code>].</p> <li data-md> <p>Let <var>deviceAddress</var> be <var>scanEntry</var>[<code>"deviceAddress"</code>].</p> <li data-md> <p>Let <var>simulatedBluetoothAdapter</var> be <var>topLevelNavigable</var>’s <a data-link-type="dfn" href="#simulated-bluetooth-adapter" id="ref-for-simulated-bluetooth-adapter⑧">simulated Bluetooth adapter</a>.</p> <li data-md> <p>If <var>simulatedBluetoothAdapter</var> is empty, return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error" id="ref-for-dfn-error⑧">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑨">error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-invalid-argument" id="ref-for-dfn-invalid-argument⑤">invalid argument</a>.</p> <li data-md> <p>Let <var>deviceMapping</var> be <var>simulatedBluetoothAdapter</var>’s <a data-link-type="dfn" href="#simulated-bluetooth-device-mapping" id="ref-for-simulated-bluetooth-device-mapping②">simulated Bluetooth device mapping</a>.</p> <li data-md> <p>If <var>deviceMapping</var>[<var>deviceAddress</var>] <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists②">exists</a>, let <var>simulatedDevice</var> be <var>deviceMapping</var>[<var>deviceAddress</var>]. Otherwise, let <var>simulatedDevice</var> be a new <a data-link-type="dfn" href="#simulated-bluetooth-device" id="ref-for-simulated-bluetooth-device③">simulated Bluetooth device</a> with <var>deviceAddress</var> and set <var>deviceMapping</var>[<var>deviceAddress</var>] to <var>simulatedDevice</var>.</p> <li data-md> <p>If <var>topLevelNavigable</var> is currently executing the <a data-link-type="dfn" href="#scan-for-devices" id="ref-for-scan-for-devices①">scan for devices</a> algorithm, insert <var>simulatedDevice</var> into the <em>simulatedBluetoothDevices</em> variable within that algorithm.</p> <p class="issue" id="issue-6d693d48"><a class="self-link" href="#issue-6d693d48"></a> Inserting data into variables from another algorithm is not well defined. The <a data-link-type="dfn" href="#scan-for-devices" id="ref-for-scan-for-devices②">scan for devices</a> algorithm needs to define asynchronous device discovery in order to match implementations.</p> <li data-md> <p>Let <var>navigables</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#inclusive-descendant-navigables" id="ref-for-inclusive-descendant-navigables">inclusive descendant navigables</a> of <var>topLevelNavigable</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#nav-document" id="ref-for-nav-document">active document</a>.</p> <li data-md> <p>For each <var>navigable</var> of <var>navigables</var>:</p> <ol> <li data-md> <p>Let <var>document</var> be <var>navigable</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#nav-document" id="ref-for-nav-document①">active document</a>.</p> <li data-md> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②②">Queue a task</a> on <var>document</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object⑦">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop⑤">responsible event loop</a> to do the following sub-steps:</p> <ol> <li data-md> <p>Let <var>simulatedDeviceInstance</var> be the result of <a data-link-type="dfn" href="#get-the-bluetoothdevice-representing" id="ref-for-get-the-bluetoothdevice-representing④">get the <code>BluetoothDevice</code> representing</a> <var>simulatedDevice</var> inside <var>navigable</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#nav-window" id="ref-for-nav-window">active window</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/system-state.html#associated-navigator" id="ref-for-associated-navigator">associated <code>Navigator</code></a>’s <a data-link-type="dfn" href="#associated-bluetooth" id="ref-for-associated-bluetooth②">associated Bluetooth</a>.</p> <li data-md> <p>If <var>simulatedDeviceInstance</var>.<code class="idl"><a data-link-type="idl" href="#dom-bluetoothdevice-watchadvertisementsstate-slot" id="ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot⑧">[[watchAdvertisementsState]]</a></code> is <code>not-watching</code>, abort these sub-steps.</p> <li data-md> <p><a data-link-type="dfn" href="#fire-an-advertisementreceived-event" id="ref-for-fire-an-advertisementreceived-event①">Fire an <code>advertisementreceived</code> event</a> for the advertising event represented by <var>scanEntry</var>[<code>"scanRecord"</code>], at <var>simulatedDeviceInstance</var>.</p> </ol> </ol> <li data-md> <p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-success" id="ref-for-dfn-success⑤">success</a> with data <code>null</code>.</p> </ol> </div> <div class="example" id="example-2a9b64bf"> <a class="self-link" href="#example-2a9b64bf"></a> A <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-local-ends" id="ref-for-dfn-local-ends③">local end</a> could simulate a device advertisement by sending the following message: <pre class="highlight"><c- p>{</c-> <c- f>"method"</c-><c- p>:</c-> <c- u>"bluetooth.simulateAdvertisement"</c-><c- p>,</c-> <c- f>"params"</c-><c- p>:</c-> <c- p>{</c-> <c- f>"context"</c-><c- p>:</c-> <c- u>"cxt-d03fdd81"</c-><c- p>,</c-> <c- f>"scanEntry"</c-><c- p>:</c-> <c- p>{</c-> <c- f>"deviceAddress"</c-><c- p>:</c-> <c- u>"08:08:08:08:08:08"</c-><c- p>,</c-> <c- f>"rssi"</c-><c- p>:</c-> <c- mi>-10</c-><c- p>,</c-> <c- f>"scanRecord"</c-><c- p>:</c-> <c- p>{</c-> <c- f>"name"</c-><c- p>:</c-> <c- u>"Heart Rate"</c-><c- p>,</c-> <c- f>"uuids"</c-><c- p>:</c-> <c- p>[</c-><c- u>"0000180d-0000-1000-8000-00805f9b34fb"</c-><c- p>],</c-> <c- f>"manufacturerData"</c-><c- p>:</c-> <c- p>[</c-> <c- p>{</c-> key<c- p>:</c-> <c- mi>17</c-><c- p>,</c-> da<c- kc>ta</c-><c- p>:</c-> <c- u>"AP8BAX8="</c-> <c- p>}</c-> <c- p>],</c-> <c- f>"appearance"</c-><c- p>:</c-> <c- mi>1</c-><c- p>,</c-> <c- f>"txPower"</c-><c- p>:</c-> <c- mi>1</c-> <c- p>}</c-> <c- p>}</c-> <c- p>}</c-> <c- p>}</c-> </pre> </div> <h4 class="heading settled" data-level="12.2.4" id="bidi-events"><span class="secno">12.2.4. </span><span class="content">Events</span><a class="self-link" href="#bidi-events"></a></h4> <h5 class="heading settled" data-level="12.2.4.1" id="bluetooth-requestdevicepromptupdated-event"><span class="secno">12.2.4.1. </span><span class="content">The bluetooth.requestDevicePromptUpdated Event</span><a class="self-link" href="#bluetooth-requestdevicepromptupdated-event"></a></h5> <pre class="cddl local-cddl highlight"><c- nc>bluetooth.RequestDevicePromptUpdated</c-> <c- o>=</c-> <c- p>(</c-> <c- s>method</c-><c- p>:</c-> <c- u>"bluetooth.requestDevicePromptUpdated"</c-><c- p>,</c-> <c- s>params</c-><c- p>:</c-> <c- nc>bluetooth.RequestDevicePromptUpdatedParameters</c-> <c- p>)</c-> <c- nc>bluetooth.RequestDevicePromptUpdatedParameters</c-> <c- o>=</c-> <c- p>{</c-> <c- s>context</c-><c- p>:</c-> text<c- p>,</c-> <c- s>prompt</c-><c- p>:</c-> <c- nc>bluetooth.RequestDevicePrompt</c-><c- p>,</c-> <c- s>devices</c-><c- p>:</c-> <c- p>[</c-><c- o>*</c-> <c- nc>bluetooth.RequestDeviceInfo</c-><c- p>],</c-> <c- p>}</c-> </pre> <div class="algorithm" data-algorithm="remote end event trigger for bluetooth.requestDevicePromptUpdated"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="trigger-a-prompt-updated-event">trigger a prompt updated event</dfn> given a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#navigable" id="ref-for-navigable①">navigable</a> <var>navigable</var>, a string <var>promptId</var>, and a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set①">set</a> of <a data-link-type="dfn" href="#bluetooth-device" id="ref-for-bluetooth-device②④">Bluetooth devices</a> <var>devices</var>: <ol> <li data-md> <p>Let <var>navigableId</var> be <var>navigable</var>’s <a data-link-type="dfn" href="https://w3c.github.io/webdriver-bidi/#navigable-id" id="ref-for-navigable-id②">navigable id</a>.</p> <li data-md> <p>Let <var>prompt</var> be the <a data-link-type="dfn" href="#device-prompt" id="ref-for-device-prompt④">device prompt</a> (<var>promptId</var>, <var>devices</var>).</p> <li data-md> <p>Let <var>serialized devices</var> be the result of <a data-link-type="dfn" href="#serialize-prompt-devices" id="ref-for-serialize-prompt-devices">serialize prompt devices</a> with <var>prompt</var>.</p> <li data-md> <p>Set <a data-link-type="dfn" href="#map-of-navigables-to-device-prompts" id="ref-for-map-of-navigables-to-device-prompts③">map of navigables to device prompts</a>[<var>navigableId</var>] to <var>prompt</var>.</p> <li data-md> <p>Let <var>params</var> be a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map③">map</a> matching the <code>bluetooth.RequestDevicePromptUpdatedParameters</code> production with the <code>context</code> field set to <var>navigableId</var>, the <code>prompt</code> field set to <var>promptId</var>, and the <code>devices</code> field set to <var>serialized devices</var>.</p> <li data-md> <p>Let <var>body</var> be a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map④">map</a> matching the <code>bluetooth.RequestDevicePromptUpdated</code> production, with the <code>params</code> field set to <var>params</var>.</p> <li data-md> <p>Let <var>related navigables</var> be a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set②">set</a> containing <var>navigable</var>.</p> <li data-md> <p>For each <var>session</var> in the <a data-link-type="dfn" href="https://w3c.github.io/webdriver-bidi/#set-of-sessions-for-which-an-event-is-enabled" id="ref-for-set-of-sessions-for-which-an-event-is-enabled">set of sessions for which an event is enabled</a> given "<code>bluetooth.requestDevicePromptUpdated</code>" and <var>related navigables</var>:</p> <ol> <li data-md> <p><a data-link-type="dfn" href="https://w3c.github.io/webdriver-bidi/#emit-an-event" id="ref-for-emit-an-event">Emit an event</a> with <var>session</var> and <var>body</var>.</p> </ol> </ol> </div> <h2 class="heading settled" data-level="13" id="terminology"><span class="secno">13. </span><span class="content">Terminology and Conventions</span><a class="self-link" href="#terminology"></a></h2> <p>This specification uses a few conventions and several terms from other specifications. This section lists those and links to their primary definitions.</p> <p>When an algorithm in this specification uses a name defined in this or another specification, the name MUST resolve to its initial value, ignoring any changes that have been made to the name in the current execution environment. For example, when the <code class="idl"><a data-link-type="idl" href="#dom-bluetooth-requestdevice" id="ref-for-dom-bluetooth-requestdevice⑤">requestDevice()</a></code> algorithm says to call <code><code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array.prototype.map" id="ref-for-sec-array.prototype.map②">Array.prototype.map</a></code>.call(<var>filter</var>.services, <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①⑥">BluetoothUUID.getService</a></code>)</code>, this MUST apply the <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-array.prototype.map" id="ref-for-sec-array.prototype.map③">Array.prototype.map</a></code> algorithm defined in <a data-link-type="biblio" href="#biblio-ecmascript" title="ECMAScript Language Specification">[ECMAScript]</a> with <code><var>filter</var>.services</code> as its <code>this</code> parameter and the algorithm defined in <a href="#standardized-uuids">§ 7.1 Standardized UUIDs</a> for <code class="idl"><a data-link-type="idl" href="#dom-bluetoothuuid-getservice" id="ref-for-dom-bluetoothuuid-getservice①⑦">BluetoothUUID.getService</a></code> as its <code>callbackfn</code> parameter, regardless of any modifications that have been made to <code>window</code>, <code>Array</code>, <code>Array.prototype</code>, <code>Array.prototype.map</code>, <code>Function</code>, <code>Function.prototype</code>, <code>BluetoothUUID</code>, <code>BluetoothUUID.getService</code>, or other objects.</p> <p>This specification uses a read-only type that is similar to WebIDL’s <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-frozen-array" id="ref-for-idl-frozen-array⑥">FrozenArray</a></code>.</p> <ul> <li data-md> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="read-only-arraybuffer">read only ArrayBuffer</dfn> has <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor⑨">ArrayBuffer</a></code>'s values and interface, except that attempting to write to its contents or transfer it has the same effect as trying to write to a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-frozen-array" id="ref-for-idl-frozen-array⑦">FrozenArray</a></code>'s contents. This applies to <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-typedarray-constructors" id="ref-for-sec-typedarray-constructors">TypedArray</a></code>s and <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-dataview-constructor" id="ref-for-sec-dataview-constructor①⑥">DataView</a></code>s wrapped around the <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-arraybuffer-constructor" id="ref-for-sec-arraybuffer-constructor①⓪">ArrayBuffer</a></code> too.</p> </ul> <dl> <dt><a data-link-type="biblio" href="#biblio-bluetooth42" title="BLUETOOTH SPECIFICATION Version 4.2">[BLUETOOTH42]</a> <dd> <ol> <li value="1"> Architecture &amp; Terminology Overview <ol type="A"> <li value="1"> General Description <ol> <li value="2">Overview of Bluetooth Low Energy Operation (defines <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="advertising event|advertising events" data-noexport id="advertising-event">advertising events</dfn>) </ol> <li value="4"> Communication Topology and Operation <ol> <li value="2"> Operational Procedures and Modes <ol> <li value="1"> BR/EDR Procedures <ol> <li value="1"> Inquiry (Discovering) Procedure <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="extended-inquiry-response">Extended Inquiry Response</dfn> </ol> </ol> </ol> </ol> </ol> <li value="2"> Core System Package [BR/EDR Controller volume] <ol type="A"> <li value="5"> Host Controller Interface Functional Specification <ol> <li value="7"> HCI Commands and Events <ol> <li value="4"> Informational Parameters <ol> <li value="6"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="read-bd_addr-command">Read BD_ADDR Command</dfn> </ol> <li value="5"> Status Parameters <ol> <li value="4"> Read <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="RSSI|Received Signal Strength" data-noexport id="rssi"> <abbr title="Received Signal Strength Indication"> RSSI</abbr></dfn> Command </ol> </ol> </ol> </ol> <li value="3"> Core System Package [Host volume] <ol type="A"> <li value="2"> Service Discovery Protocol (SDP) Specification <ol> <li value="2"> Overview <ol> <li value="5"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="searching-for-services">Searching for Services</dfn> <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="uuid">UUID</dfn> (defines <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="uuid-alias">UUID alias</dfn>es and the algorithm to compute <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="the-128-bit-uuid-represented">the 128-bit UUID represented</dfn> by a UUID alias) </ol> </ol> </ol> <li value="3"> Generic Access Profile <ol> <li value="2"> Profile Overview <ol> <li value="2"> Profile Roles <ol> <li value="2"> Roles when Operating over an LE Physical Transport <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="broadcaster">Broadcaster</dfn> Role <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="observer">Observer</dfn> Role <li value="3"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="peripheral">Peripheral</dfn> Role <li value="4"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="central">Central</dfn> Role </ol> </ol> </ol> <li value="3"> User Interface Aspects <ol> <li value="2"> Representation of Bluetooth Parameters <ol> <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="bluetooth-device-name">Bluetooth Device Name</dfn> (the user-friendly name) </ol> </ol> <li value="6"> Idle Mode Procedures — BR/EDR Physical Transport <ol> <li value="4"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="device-discovery-procedure">Device Discovery Procedure</dfn> <li value="5"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="br-edr-bonding-procedure">BR/EDR Bonding Procedure</dfn> </ol> <li value="9"> Operational Modes and Procedures — LE Physical Transport <ol> <li value="1"> Broadcast Mode and Observation Procedure <ol> <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="observation-procedure">Observation Procedure</dfn> </ol> <li value="2"> Discovery Modes and Procedures <ol> <li value="6"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="general-discovery-procedure">General Discovery Procedure</dfn> <li value="7"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="name-discovery-procedure">Name Discovery Procedure</dfn> </ol> <li value="3">Connection Modes and Procedures <li value="4"> Bonding Modes and Procedures <ol> <li value="4"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="le-bonding-procedure">LE Bonding Procedure</dfn> </ol> </ol> <li value="10"> Security Aspects — LE Physical Transport <ol> <li value="7"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="privacy-feature">Privacy Feature</dfn> <li value="8"> Random Device Address <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="static-address">Static Address</dfn> <li value="2"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="private-address">Private address</dfn> <ol> <li value="3"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="resolvable-private-address-resolution-procedure">Resolvable Private Address Resolution Procedure</dfn> </ol> </ol> </ol> <li value="11"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="advertising-data">Advertising Data</dfn> and Scan Response Data Format (defines <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ad-structure">AD structure</dfn>) <li value="15"> Bluetooth Device Requirements <ol> <li value="1"> Bluetooth Device Address (defines <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="bd_addr">BD_ADDR</dfn>) <ol> <li value="1"> Bluetooth Device Address Types <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="public-bluetooth-address">Public Bluetooth Address</dfn> </ol> </ol> </ol> <li value="16">Definitions (defines <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="bond">bond</dfn>) </ol> <li value="6"> Attribute Protocol (ATT) <ol> <li value="3"> Protocol Requirements <ol> <li value="2"> Basic Concepts <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="attribute-type">Attribute Type</dfn> <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="attribute-handle">Attribute Handle</dfn> <li value="9"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="long-attribute-values">Long Attribute Values</dfn> </ol> <li value="4"> Attribute Protocol Pdus <ol> <li value="1"> Error Handling <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="error-response">Error Response</dfn> </ol> </ol> </ol> </ol> <li value="7"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="Generic Attribute Profile|GATT" data-noexport id="generic-attribute-profile">Generic Attribute Profile</dfn> (GATT) <ol> <li value="2"> Profile Overview <ol> <li value="2">Configurations and Roles (defines <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="gatt-client">GATT Client</dfn> and <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="gatt-server">GATT Server</dfn>) <li value="4"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="profile-fundamentals">Profile Fundamentals</dfn>, defines the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="att-bearer">ATT Bearer</dfn> <li value="5"> Attribute Protocol <ol> <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="attribute-caching">Attribute Caching</dfn> </ol> <li value="6"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="gatt-profile-hierarchy">GATT Profile Hierarchy</dfn> <ol> <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="service">Service</dfn> <li value="3"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="included-service">Included Service</dfn>s <li value="4"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic">Characteristic</dfn> </ol> </ol> <li value="3"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="service-interoperability-requirements">Service Interoperability Requirements</dfn> <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="service-definition">Service Definition</dfn> <li value="3"> Characteristic Definition <ol> <li value="1"> Characteristic Declaration <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-properties">Characteristic Properties</dfn> </ol> <li value="3"> Characteristic <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="descriptor">Descriptor</dfn> Declarations <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-extended-properties">Characteristic Extended Properties</dfn> <li value="3"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="client-characteristic-configuration">Client Characteristic Configuration</dfn> </ol> </ol> </ol> <li value="4"> GATT Feature Requirements — defines the <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="GATT procedure|GATT procedures" data-noexport id="gatt-procedure">GATT procedures</dfn>. <ol> <li value="3"> Server Configuration <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="exchange-mtu">Exchange MTU</dfn> </ol> <li value="4"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="primary-service-discovery">Primary Service Discovery</dfn> <ol> <li value="1">Discover All Primary Services <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="discover-primary-service-by-service-uuid">Discover Primary Service by Service UUID</dfn> </ol> <li value="5"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="relationship-discovery">Relationship Discovery</dfn> <ol> <li value="1">Find Included Services </ol> <li value="6"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-discovery">Characteristic Discovery</dfn> <ol> <li value="1">Discover All Characteristics of a Service <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="discover-characteristics-by-uuid">Discover Characteristics by UUID</dfn> </ol> <li value="7"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-descriptor-discovery">Characteristic Descriptor Discovery</dfn> <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="discover-all-characteristic-descriptors">Discover All Characteristic Descriptors</dfn> </ol> <li value="8"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-value-read">Characteristic Value Read</dfn> <li value="9"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-value-write">Characteristic Value Write</dfn> <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="write-without-response">Write Without Response</dfn> <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="write-characteristic-value">Write Characteristic Value</dfn> </ol> <li value="10"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-value-notification">Characteristic Value Notification</dfn> <li value="11"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-value-indications">Characteristic Value Indications</dfn> <li value="12"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="characteristic-descriptors">Characteristic Descriptors</dfn> <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="read-characteristic-descriptors">Read Characteristic Descriptors</dfn> <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="read-long-characteristic-descriptors">Read Long Characteristic Descriptors</dfn> <li value="3"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="write-characteristic-descriptors">Write Characteristic Descriptors</dfn> <li value="4"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="write-long-characteristic-descriptors">Write Long Characteristic Descriptors</dfn> </ol> <li value="14"><dfn class="dfn-paneled" data-dfn-type="dfn" data-local-lt="procedure times out" data-noexport id="procedure-timeouts">Procedure Timeouts</dfn> </ol> <li value="6"> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="gap-interoperability-requirements">GAP Interoperability Requirements</dfn> <ol> <li value="1"> BR/EDR GAP Interoperability Requirements <ol> <li value="1">Connection Establishment </ol> <li value="2"> LE GAP Interoperability Requirements <ol> <li value="1">Connection Establishment </ol> </ol> <li value="7"> Defined Generic Attribute Profile Service <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="service-changed">Service Changed</dfn> </ol> </ol> <li value="8"> Security Manager Specification <ol> <li value="2"> Security Manager <ol> <li value="4"> Security in Bluetooth Low Energy <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="definition-of-keys-and-values">Definition of Keys and Values</dfn>, defines the <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="Identity Resolving Key|IRK" data-noexport id="identity-resolving-key">Identity Resolving Key</dfn> (<abbr title="Identity Resolving Key">IRK</abbr>) </ol> </ol> </ol> </ol> <li value="6"> Core System Package [Low Energy Controller volume] <ol type="A"> <li value="2"> Link Layer Specification <ol> <li value="1"> General Description <ol> <li value="3"> Device Address <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="public-device-address">Public Device Address</dfn> <li value="2"> Random Device Address <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="static-device-address">Static Device Address</dfn> </ol> </ol> </ol> <li value="4"> Air Interface Protocol <ol> <li value="4"> Non-Connected States <ol> <li value="3"> Scanning State <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="passive-scanning">Passive Scanning</dfn> </ol> </ol> </ol> </ol> </ol> </ol> <dt><a data-link-type="biblio" href="#biblio-bluetooth-supplement6" title="Supplement to the Bluetooth Core Specification Version 6">[BLUETOOTH-SUPPLEMENT6]</a> <dd> <ol type="A"> <li value="1"> Data Types Specification <ol> <li value="1"> Data Types Definitions and Formats <ol> <li value="1"><dfn class="dfn-paneled" data-dfn-type="dfn" data-local-lt="Service UUIDs" data-noexport id="service-uuid-data-type">Service UUID Data Type</dfn> <li value="2"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="local-name-data-type">Local Name Data Type</dfn> <li value="3"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="flags-data-type">Flags Data Type</dfn> (defines the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="discoverable-mode">Discoverable Mode</dfn> flags) <li value="4"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="manufacturer-specific-data">Manufacturer Specific Data</dfn> <li value="5"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="tx-power-level">TX Power Level</dfn> <li value="11"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="service-data">Service Data</dfn> <li value="12"><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="appearance">Appearance</dfn> </ol> </ol> </ol> </dl> </main> <div data-fill-with="conformance"> <h2 class="no-ref no-num heading settled" id="w3c-conformance"><span class="content">Conformance</span><a class="self-link" href="#w3c-conformance"></a></h2> <h3 class="no-ref no-num heading settled" id="w3c-conventions"><span class="content">Document conventions</span><a class="self-link" href="#w3c-conventions"></a></h3> <p>Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification. </p> <p>All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119" title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</a> </p> <p>Examples in this specification are introduced with the words “for example” or are set apart from the normative text with <code>class="example"</code>, like this: </p> <div class="example" id="w3c-example"> <a class="self-link" href="#w3c-example"></a> <p>This is an example of an informative example. </p> </div> <p>Informative notes begin with the word “Note” and are set apart from the normative text with <code>class="note"</code>, like this: </p> <p class="note" role="note">Note, this is an informative note.</p> </div> <script src="https://www.w3.org/scripts/TR/2021/fixup.js"></script> <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2> <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3> <ul class="index"> <li><a href="#abort-all-active-watchadvertisements">abort all active watchAdvertisements</a><span>, in § 5.2</span> <li><a href="#abort-watchadvertisements">abort watchAdvertisements</a><span>, in § 5.2</span> <li> acceptAllDevices <ul> <li><a href="#dom-bluetoothpermissiondescriptor-acceptalldevices">dict-member for BluetoothPermissionDescriptor</a><span>, in § 4.1</span> <li><a href="#dom-requestdeviceoptions-acceptalldevices">dict-member for RequestDeviceOptions</a><span>, in § 4</span> </ul> <li><a href="#dom-bluetoothremotegattserver-activealgorithms-slot">[[activeAlgorithms]]</a><span>, in § 6.2</span> <li><a href="#active-notification-context-set">active notification context set</a><span>, in § 6.4</span> <li><a href="#adapter-state">adapter state</a><span>, in § 12</span> <li><a href="#add-device-to-storage">add device to storage</a><span>, in § 4</span> <li><a href="#ad-structure">AD structure</a><span>, in § 13</span> <li><a href="#eventdef-bluetoothdeviceeventhandlers-advertisementreceived">advertisementreceived</a><span>, in § 6.6.2</span> <li><a href="#advertising-data">Advertising Data</a><span>, in § 13</span> <li><a href="#advertising-event">advertising event</a><span>, in § 13</span> <li><a href="#advertising-event">advertising events</a><span>, in § 13</span> <li><a href="#dictdef-allowedbluetoothdevice">AllowedBluetoothDevice</a><span>, in § 4.1</span> <li><a href="#dom-bluetoothpermissionstorage-alloweddevices">allowedDevices</a><span>, in § 4.1</span> <li><a href="#dom-bluetoothdevice-allowedmanufacturerdata-slot">[[allowedManufacturerData]]</a><span>, in § 5.2</span> <li><a href="#dom-allowedbluetoothdevice-allowedmanufacturerdata">allowedManufacturerData</a><span>, in § 4.1</span> <li><a href="#dom-bluetoothdevice-allowedservices-slot">[[allowedServices]]</a><span>, in § 5.2</span> <li><a href="#dom-allowedbluetoothdevice-allowedservices">allowedServices</a><span>, in § 4.1</span> <li><a href="#appearance">Appearance</a><span>, in § 13</span> <li> appearance <ul> <li><a href="#dom-bluetoothadvertisingevent-appearance">attribute for BluetoothAdvertisingEvent</a><span>, in § 5.2.3</span> <li><a href="#dom-bluetoothadvertisingeventinit-appearance">dict-member for BluetoothAdvertisingEventInit</a><span>, in § 5.2.3</span> </ul> <li><a href="#associated-bluetooth">associated Bluetooth</a><span>, in § 10</span> <li><a href="#att-bearer">ATT Bearer</a><span>, in § 13</span> <li><a href="#attribute">Attribute</a><span>, in § 6.1</span> <li><a href="#attribute-caching">Attribute Caching</a><span>, in § 13</span> <li><a href="#attribute-handle">Attribute Handle</a><span>, in § 13</span> <li><a href="#dom-bluetooth-attributeinstancemap-slot">[[attributeInstanceMap]]</a><span>, in § 4</span> <li><a href="#attribute-type">Attribute Type</a><span>, in § 13</span> <li><a href="#dom-bluetoothcharacteristicproperties-authenticatedsignedwrites">authenticatedSignedWrites</a><span>, in § 6.4.1</span> <li><a href="#eventdef-bluetooth-availabilitychanged">availabilitychanged</a><span>, in § 6.6.2</span> <li> [[BackingMap]] <ul> <li><a href="#dom-bluetoothmanufacturerdatamap-backingmap-slot">attribute for BluetoothManufacturerDataMap</a><span>, in § 5.2.3.1</span> <li><a href="#dom-bluetoothservicedatamap-backingmap-slot">attribute for BluetoothServiceDataMap</a><span>, in § 5.2.3.2</span> </ul> <li><a href="#bd_addr">BD_ADDR</a><span>, in § 13</span> <li><a href="#blocklisted">blocklisted</a><span>, in § 9</span> <li><a href="#blocklisted-for-reads">blocklisted for reads</a><span>, in § 9</span> <li><a href="#blocklisted-for-writes">blocklisted for writes</a><span>, in § 9</span> <li><a href="#blocklisted-manufacturer-data">blocklisted manufacturer data</a><span>, in § 9</span> <li><a href="#blocklisted-manufacturer-data-filter">blocklisted manufacturer data filter</a><span>, in § 9</span> <li><a href="#permissiondef-bluetooth">"bluetooth"</a><span>, in § 4.1</span> <li><a href="#bluetooth">Bluetooth</a><span>, in § 4</span> <li> bluetooth <ul> <li><a href="#dom-navigator-bluetooth">attribute for Navigator</a><span>, in § 10</span> <li><a href="#policy-controlled-feature-bluetooth">dfn for policy-controlled feature</a><span>, in § 11.1</span> </ul> <li><a href="#bluetoothadvertisingevent">BluetoothAdvertisingEvent</a><span>, in § 5.2.3</span> <li><a href="#dictdef-bluetoothadvertisingeventinit">BluetoothAdvertisingEventInit</a><span>, in § 5.2.3</span> <li><a href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent">BluetoothAdvertisingEvent(type, init)</a><span>, in § 5.2.3</span> <li><a href="#bluetooth-cache-bluetooth-cache">Bluetooth cache</a><span>, in § 6.1.2</span> <li><a href="#bluetoothcharacteristicproperties">BluetoothCharacteristicProperties</a><span>, in § 6.4.1</span> <li><a href="#typedefdef-bluetoothcharacteristicuuid">BluetoothCharacteristicUUID</a><span>, in § 7.1</span> <li><a href="#dictdef-bluetoothdatafilterinit">BluetoothDataFilterInit</a><span>, in § 4</span> <li><a href="#typedefdef-bluetoothdescriptoruuid">BluetoothDescriptorUUID</a><span>, in § 7.1</span> <li><a href="#bluetooth-device">Bluetooth device</a><span>, in § 5.1</span> <li><a href="#bluetoothdevice">BluetoothDevice</a><span>, in § 5.2</span> <li><a href="#bluetoothdeviceeventhandlers">BluetoothDeviceEventHandlers</a><span>, in § 6.6.6</span> <li><a href="#bluetooth-device-name">Bluetooth Device Name</a><span>, in § 13</span> <li><a href="#dictdef-bluetoothlescanfilterinit">BluetoothLEScanFilterInit</a><span>, in § 4</span> <li><a href="#dictdef-bluetoothmanufacturerdatafilterinit">BluetoothManufacturerDataFilterInit</a><span>, in § 4</span> <li><a href="#bluetoothmanufacturerdatamap">BluetoothManufacturerDataMap</a><span>, in § 5.2.3</span> <li><a href="#dictdef-bluetoothpermissiondescriptor">BluetoothPermissionDescriptor</a><span>, in § 4.1</span> <li><a href="#bluetoothpermissionresult">BluetoothPermissionResult</a><span>, in § 4.1</span> <li><a href="#dictdef-bluetoothpermissionstorage">BluetoothPermissionStorage</a><span>, in § 4.1</span> <li><a href="#bluetoothremotegattcharacteristic">BluetoothRemoteGATTCharacteristic</a><span>, in § 6.4</span> <li><a href="#bluetoothremotegattdescriptor">BluetoothRemoteGATTDescriptor</a><span>, in § 6.5</span> <li><a href="#bluetoothremotegattserver">BluetoothRemoteGATTServer</a><span>, in § 6.2</span> <li><a href="#bluetoothremotegattservice">BluetoothRemoteGATTService</a><span>, in § 6.3</span> <li><a href="#dictdef-bluetoothservicedatafilterinit">BluetoothServiceDataFilterInit</a><span>, in § 4</span> <li><a href="#bluetoothservicedatamap">BluetoothServiceDataMap</a><span>, in § 5.2.3</span> <li><a href="#typedefdef-bluetoothserviceuuid">BluetoothServiceUUID</a><span>, in § 7.1</span> <li><a href="#bluetooth-tree-bluetooth-tree">Bluetooth tree</a><span>, in § 6.6.1</span> <li><a href="#bluetoothuuid">BluetoothUUID</a><span>, in § 7.1</span> <li><a href="#bond">bond</a><span>, in § 13</span> <li><a href="#br-edr-bonding-procedure">BR/EDR Bonding Procedure</a><span>, in § 13</span> <li><a href="#dom-bluetoothcharacteristicproperties-broadcast">broadcast</a><span>, in § 6.4.1</span> <li><a href="#broadcaster">Broadcaster</a><span>, in § 13</span> <li> canonicalizing <ul> <li><a href="#bluetoothdatafilterinit-canonicalizing">dfn for BluetoothDataFilterInit</a><span>, in § 4</span> <li><a href="#bluetoothlescanfilterinit-canonicalizing">dfn for BluetoothLEScanFilterInit</a><span>, in § 4</span> </ul> <li><a href="#dom-bluetoothuuid-canonicaluuid">canonicalUUID(alias)</a><span>, in § 7.1</span> <li><a href="#central">Central</a><span>, in § 13</span> <li><a href="#characteristic">Characteristic</a><span>, in § 13</span> <li><a href="#dom-bluetoothremotegattdescriptor-characteristic">characteristic</a><span>, in § 6.5</span> <li><a href="#characteristic-descriptor-discovery">Characteristic Descriptor Discovery</a><span>, in § 13</span> <li><a href="#characteristic-descriptors">Characteristic Descriptors</a><span>, in § 13</span> <li><a href="#characteristic-discovery">Characteristic Discovery</a><span>, in § 13</span> <li><a href="#characteristiceventhandlers">CharacteristicEventHandlers</a><span>, in § 6.6.6</span> <li><a href="#characteristic-extended-properties">Characteristic Extended Properties</a><span>, in § 13</span> <li><a href="#characteristic-properties">Characteristic Properties</a><span>, in § 13</span> <li><a href="#eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged">characteristicvaluechanged</a><span>, in § 6.6.2</span> <li><a href="#characteristic-value-indications">Characteristic Value Indications</a><span>, in § 13</span> <li><a href="#characteristic-value-notification">Characteristic Value Notification</a><span>, in § 13</span> <li><a href="#characteristic-value-read">Characteristic Value Read</a><span>, in § 13</span> <li><a href="#characteristic-value-write">Characteristic Value Write</a><span>, in § 13</span> <li><a href="#clean-up-the-disconnected-device">clean up the disconnected device</a><span>, in § 6.6.3</span> <li><a href="#client-characteristic-configuration">Client Characteristic Configuration</a><span>, in § 13</span> <li><a href="#dom-bluetoothmanufacturerdatafilterinit-companyidentifier">companyIdentifier</a><span>, in § 4</span> <li><a href="#dom-bluetoothremotegattserver-connect">connect()</a><span>, in § 6.2</span> <li><a href="#dom-bluetoothremotegattserver-connected">connected</a><span>, in § 6.2</span> <li><a href="#connection-checking-wrapper">connection-checking wrapper</a><span>, in § 6.2</span> <li><a href="#dom-valueevent-valueevent">constructor(type)</a><span>, in § 4.2</span> <li><a href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent">constructor(type, init)</a><span>, in § 5.2.3</span> <li><a href="#dom-valueevent-valueevent">constructor(type, initDict)</a><span>, in § 4.2</span> <li><a href="#dom-bluetoothdevice-context-slot">[[context]]</a><span>, in § 5.2</span> <li><a href="#create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic">create a BluetoothCharacteristicProperties instance from the Characteristic</a><span>, in § 6.4.1</span> <li><a href="#create-a-bluetoothremotegattcharacteristic-representing">create a BluetoothRemoteGATTCharacteristic representing</a><span>, in § 6.4</span> <li><a href="#create-a-bluetoothremotegattdescriptor-representing">create a BluetoothRemoteGATTDescriptor representing</a><span>, in § 6.5</span> <li><a href="#create-a-bluetoothremotegattservice-representing">create a BluetoothRemoteGATTService representing</a><span>, in § 6.3</span> <li><a href="#dom-bluetoothdatafilterinit-dataprefix">dataPrefix</a><span>, in § 4</span> <li><a href="#definition-of-keys-and-values">Definition of Keys and Values</a><span>, in § 13</span> <li><a href="#descriptor">Descriptor</a><span>, in § 13</span> <li><a href="#dom-allowedbluetoothdevice-device-slot">[[device]]</a><span>, in § 4.1</span> <li> device <ul> <li><a href="#dom-bluetoothadvertisingevent-device">attribute for BluetoothAdvertisingEvent</a><span>, in § 5.2.3</span> <li><a href="#dom-bluetoothremotegattserver-device">attribute for BluetoothRemoteGATTServer</a><span>, in § 6.2</span> <li><a href="#dom-bluetoothremotegattservice-device">attribute for BluetoothRemoteGATTService</a><span>, in § 6.3</span> <li><a href="#dom-bluetoothadvertisingeventinit-device">dict-member for BluetoothAdvertisingEventInit</a><span>, in § 5.2.3</span> </ul> <li><a href="#device-discovery-procedure">Device Discovery Procedure</a><span>, in § 13</span> <li> deviceId <ul> <li><a href="#dom-allowedbluetoothdevice-deviceid">dict-member for AllowedBluetoothDevice</a><span>, in § 4.1</span> <li><a href="#dom-bluetoothpermissiondescriptor-deviceid">dict-member for BluetoothPermissionDescriptor</a><span>, in § 4.1</span> </ul> <li><a href="#dom-bluetooth-deviceinstancemap-slot">[[deviceInstanceMap]]</a><span>, in § 4</span> <li><a href="#device-prompt">device prompt</a><span>, in § 12.2.1.1</span> <li><a href="#device-prompt-id">device prompt id</a><span>, in § 12.2.1.1</span> <li><a href="#dom-bluetoothpermissionresult-devices">devices</a><span>, in § 4.1</span> <li><a href="#dom-bluetoothremotegattserver-disconnect">disconnect()</a><span>, in § 6.2</span> <li><a href="#discoverable-mode">Discoverable Mode</a><span>, in § 13</span> <li><a href="#discover-all-characteristic-descriptors">Discover All Characteristic Descriptors</a><span>, in § 13</span> <li><a href="#discover-characteristics-by-uuid">Discover Characteristics by UUID</a><span>, in § 13</span> <li><a href="#discover-primary-service-by-service-uuid">Discover Primary Service by Service UUID</a><span>, in § 13</span> <li><a href="#error-response">Error Response</a><span>, in § 13</span> <li><a href="#exchange-mtu">Exchange MTU</a><span>, in § 13</span> <li><a href="#dom-requestdeviceoptions-exclusionfilters">exclusionFilters</a><span>, in § 4</span> <li><a href="#extended-inquiry-response">Extended Inquiry Response</a><span>, in § 13</span> <li> filters <ul> <li><a href="#dom-bluetoothpermissiondescriptor-filters">dict-member for BluetoothPermissionDescriptor</a><span>, in § 4.1</span> <li><a href="#dom-requestdeviceoptions-filters">dict-member for RequestDeviceOptions</a><span>, in § 4</span> </ul> <li><a href="#fire-an-advertisementreceived-event">fire an advertisementreceived event</a><span>, in § 5.2.3</span> <li><a href="#flags-data-type">Flags Data Type</a><span>, in § 13</span> <li><a href="#dom-bluetoothdevice-forget">forget()</a><span>, in § 5.2</span> <li><a href="#gap-interoperability-requirements">GAP Interoperability Requirements</a><span>, in § 13</span> <li><a href="#garbage-collect-the-connection">garbage-collect the connection</a><span>, in § 6.2</span> <li><a href="#dom-bluetoothdevice-gatt-slot">[[gatt]]</a><span>, in § 5.2</span> <li><a href="#generic-attribute-profile">GATT</a><span>, in § 13</span> <li><a href="#dom-bluetoothdevice-gatt">gatt</a><span>, in § 5.2</span> <li><a href="#gatt-assigned-characteristics">GATT assigned characteristics</a><span>, in § 7.2</span> <li><a href="#gatt-assigned-descriptors">GATT assigned descriptors</a><span>, in § 7.2</span> <li><a href="#gatt-assigned-services">GATT assigned services</a><span>, in § 7.2</span> <li><a href="#gatt-blocklist">GATT blocklist</a><span>, in § 9</span> <li><a href="#gatt-client">GATT Client</a><span>, in § 13</span> <li><a href="#gatt-procedure">GATT procedure</a><span>, in § 13</span> <li><a href="#gatt-procedure">GATT procedures</a><span>, in § 13</span> <li><a href="#gatt-profile-hierarchy">GATT Profile Hierarchy</a><span>, in § 13</span> <li><a href="#gatt-server">GATT Server</a><span>, in § 13</span> <li><a href="#eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected">gattserverdisconnected</a><span>, in § 6.6.2</span> <li><a href="#general-discovery-procedure">General Discovery Procedure</a><span>, in § 13</span> <li><a href="#generic-attribute-profile">Generic Attribute Profile</a><span>, in § 13</span> <li><a href="#get-a-prompt">get a prompt</a><span>, in § 12.2.1.3</span> <li><a href="#dom-bluetooth-getavailability">getAvailability()</a><span>, in § 4.2</span> <li><a href="#dom-bluetoothremotegattservice-getcharacteristic">getCharacteristic(characteristic)</a><span>, in § 6.3</span> <li><a href="#dom-bluetoothuuid-getcharacteristic">getCharacteristic(name)</a><span>, in § 7.1</span> <li><a href="#dom-bluetoothremotegattservice-getcharacteristics">getCharacteristics()</a><span>, in § 6.3</span> <li><a href="#dom-bluetoothremotegattservice-getcharacteristics">getCharacteristics(characteristic)</a><span>, in § 6.3</span> <li><a href="#dom-bluetoothremotegattcharacteristic-getdescriptor">getDescriptor(descriptor)</a><span>, in § 6.4</span> <li><a href="#dom-bluetoothuuid-getdescriptor">getDescriptor(name)</a><span>, in § 7.1</span> <li><a href="#dom-bluetoothremotegattcharacteristic-getdescriptors">getDescriptors()</a><span>, in § 6.4</span> <li><a href="#dom-bluetoothremotegattcharacteristic-getdescriptors">getDescriptors(descriptor)</a><span>, in § 6.4</span> <li><a href="#dom-bluetooth-getdevices">getDevices()</a><span>, in § 4</span> <li><a href="#getgattchildren">GetGATTChildren</a><span>, in § 6.1.3</span> <li><a href="#dom-bluetoothremotegattservice-getincludedservices">getIncludedServices()</a><span>, in § 6.3</span> <li><a href="#dom-bluetoothremotegattservice-getincludedservice">getIncludedService(service)</a><span>, in § 6.3</span> <li><a href="#dom-bluetoothremotegattservice-getincludedservices">getIncludedServices(service)</a><span>, in § 6.3</span> <li><a href="#dom-bluetoothremotegattserver-getprimaryservices">getPrimaryServices()</a><span>, in § 6.2</span> <li><a href="#dom-bluetoothremotegattserver-getprimaryservice">getPrimaryService(service)</a><span>, in § 6.2</span> <li><a href="#dom-bluetoothremotegattserver-getprimaryservices">getPrimaryServices(service)</a><span>, in § 6.2</span> <li><a href="#dom-bluetoothuuid-getservice">getService(name)</a><span>, in § 7.1</span> <li><a href="#get-the-bluetoothdevice-representing">get the BluetoothDevice representing</a><span>, in § 5.2</span> <li><a href="#dom-bluetoothdevice-id">id</a><span>, in § 5.2</span> <li><a href="#identity-resolving-key">Identity Resolving Key</a><span>, in § 13</span> <li><a href="#included-service">Included Service</a><span>, in § 13</span> <li><a href="#dom-bluetoothcharacteristicproperties-indicate">indicate</a><span>, in § 6.4.1</span> <li><a href="#identity-resolving-key">IRK</a><span>, in § 13</span> <li><a href="#dom-bluetoothremotegattservice-isprimary">isPrimary</a><span>, in § 6.3</span> <li><a href="#le-bonding-procedure">LE Bonding Procedure</a><span>, in § 13</span> <li><a href="#local-name-data-type">Local Name Data Type</a><span>, in § 13</span> <li><a href="#long-attribute-values">Long Attribute Values</a><span>, in § 13</span> <li> manufacturerData <ul> <li><a href="#dom-bluetoothadvertisingevent-manufacturerdata">attribute for BluetoothAdvertisingEvent</a><span>, in § 5.2.3</span> <li><a href="#dom-bluetoothadvertisingeventinit-manufacturerdata">dict-member for BluetoothAdvertisingEventInit</a><span>, in § 5.2.3</span> <li><a href="#dom-bluetoothlescanfilterinit-manufacturerdata">dict-member for BluetoothLEScanFilterInit</a><span>, in § 4</span> </ul> <li><a href="#manufacturer-data-blocklist">Manufacturer Data blocklist</a><span>, in § 9</span> <li><a href="#manufacturer-specific-data">Manufacturer Specific Data</a><span>, in § 13</span> <li><a href="#map-of-navigables-to-device-prompts">map of navigables to device prompts</a><span>, in § 12.2.1.3</span> <li><a href="#dom-bluetoothdatafilterinit-mask">mask</a><span>, in § 4</span> <li><a href="#match-a-device-in-prompt">match a device in prompt</a><span>, in § 12.2.1.3</span> <li><a href="#matches-a-filter">match a filter</a><span>, in § 4</span> <li><a href="#bluetoothdatafilterinit-matches">matches</a><span>, in § 4</span> <li><a href="#matches-a-filter">matches a filter</a><span>, in § 4</span> <li><a href="#matches-a-filter">matches any filter</a><span>, in § 4</span> <li><a href="#dom-allowedbluetoothdevice-mayusegatt">mayUseGATT</a><span>, in § 4.1</span> <li> name <ul> <li><a href="#dom-bluetoothadvertisingevent-name">attribute for BluetoothAdvertisingEvent</a><span>, in § 5.2.3</span> <li><a href="#dom-bluetoothdevice-name">attribute for BluetoothDevice</a><span>, in § 5.2</span> <li><a href="#dom-bluetoothadvertisingeventinit-name">dict-member for BluetoothAdvertisingEventInit</a><span>, in § 5.2.3</span> <li><a href="#dom-bluetoothlescanfilterinit-name">dict-member for BluetoothLEScanFilterInit</a><span>, in § 4</span> </ul> <li><a href="#name-discovery-procedure">Name Discovery Procedure</a><span>, in § 13</span> <li><a href="#dom-bluetoothlescanfilterinit-nameprefix">namePrefix</a><span>, in § 4</span> <li><a href="#no-such-device">no such device</a><span>, in § 12.2.2</span> <li><a href="#no-such-prompt">no such prompt</a><span>, in § 12.2.2</span> <li><a href="#dom-bluetoothcharacteristicproperties-notify">notify</a><span>, in § 6.4.1</span> <li><a href="#observation-procedure">Observation Procedure</a><span>, in § 13</span> <li><a href="#observer">Observer</a><span>, in § 13</span> <li><a href="#dom-bluetoothdeviceeventhandlers-onadvertisementreceived">onadvertisementreceived</a><span>, in § 6.6.6</span> <li><a href="#dom-bluetooth-onavailabilitychanged">onavailabilitychanged</a><span>, in § 4</span> <li><a href="#dom-characteristiceventhandlers-oncharacteristicvaluechanged">oncharacteristicvaluechanged</a><span>, in § 6.6.6</span> <li><a href="#dom-bluetoothdeviceeventhandlers-ongattserverdisconnected">ongattserverdisconnected</a><span>, in § 6.6.6</span> <li><a href="#dom-serviceeventhandlers-onserviceadded">onserviceadded</a><span>, in § 6.6.6</span> <li><a href="#dom-serviceeventhandlers-onservicechanged">onservicechanged</a><span>, in § 6.6.6</span> <li><a href="#dom-serviceeventhandlers-onserviceremoved">onserviceremoved</a><span>, in § 6.6.6</span> <li> optionalManufacturerData <ul> <li><a href="#dom-bluetoothpermissiondescriptor-optionalmanufacturerdata">dict-member for BluetoothPermissionDescriptor</a><span>, in § 4.1</span> <li><a href="#dom-requestdeviceoptions-optionalmanufacturerdata">dict-member for RequestDeviceOptions</a><span>, in § 4</span> </ul> <li> optionalServices <ul> <li><a href="#dom-bluetoothpermissiondescriptor-optionalservices">dict-member for BluetoothPermissionDescriptor</a><span>, in § 4.1</span> <li><a href="#dom-requestdeviceoptions-optionalservices">dict-member for RequestDeviceOptions</a><span>, in § 4</span> </ul> <li><a href="#parse-an-advertising-data-filter">parse an advertising data filter</a><span>, in § 8</span> <li><a href="#parsing-the-gatt-assigned-numbers">parsing the GATT assigned numbers</a><span>, in § 7.2</span> <li><a href="#parsing-the-gatt-blocklist">parsing the gatt blocklist</a><span>, in § 9</span> <li><a href="#parsing-the-manufacturer-data-blocklist">parsing the manufacturer data blocklist</a><span>, in § 9</span> <li><a href="#passive-scanning">Passive Scanning</a><span>, in § 13</span> <li><a href="#peripheral">Peripheral</a><span>, in § 13</span> <li><a href="#populate-the-bluetooth-cache">populate the Bluetooth cache</a><span>, in § 6.1.2</span> <li><a href="#primary-service-discovery">Primary Service Discovery</a><span>, in § 13</span> <li><a href="#privacy-feature">Privacy Feature</a><span>, in § 13</span> <li><a href="#private-address">Private address</a><span>, in § 13</span> <li><a href="#procedure-timeouts">Procedure Timeouts</a><span>, in § 13</span> <li><a href="#procedure-timeouts">procedure times out</a><span>, in § 13</span> <li><a href="#profile-fundamentals">Profile Fundamentals</a><span>, in § 13</span> <li><a href="#dom-bluetoothremotegattcharacteristic-properties">properties</a><span>, in § 6.4</span> <li><a href="#public-bluetooth-address">Public Bluetooth Address</a><span>, in § 13</span> <li><a href="#public-device-address">Public Device Address</a><span>, in § 13</span> <li><a href="#query-the-bluetooth-cache">query the Bluetooth cache</a><span>, in § 6.1.2</span> <li><a href="#query-the-bluetooth-permission">query the "bluetooth" permission</a><span>, in § 4.1</span> <li><a href="#dom-bluetoothcharacteristicproperties-read">read</a><span>, in § 6.4.1</span> <li><a href="#read-bd_addr-command">Read BD_ADDR Command</a><span>, in § 13</span> <li><a href="#read-characteristic-descriptors">Read Characteristic Descriptors</a><span>, in § 13</span> <li><a href="#read-long-characteristic-descriptors">Read Long Characteristic Descriptors</a><span>, in § 13</span> <li><a href="#read-only-arraybuffer">read only ArrayBuffer</a><span>, in § 13</span> <li> readValue() <ul> <li><a href="#dom-bluetoothremotegattcharacteristic-readvalue">method for BluetoothRemoteGATTCharacteristic</a><span>, in § 6.4</span> <li><a href="#dom-bluetoothremotegattdescriptor-readvalue">method for BluetoothRemoteGATTDescriptor</a><span>, in § 6.5</span> </ul> <li><a href="#rssi">Received Signal Strength</a><span>, in § 13</span> <li><a href="#dom-bluetooth-referringdevice-slot">[[referringDevice]]</a><span>, in § 4</span> <li><a href="#dom-bluetooth-referringdevice">referringDevice</a><span>, in § 4</span> <li><a href="#relationship-discovery">Relationship Discovery</a><span>, in § 13</span> <li><a href="#dom-bluetoothcharacteristicproperties-reliablewrite">reliableWrite</a><span>, in § 6.4.1</span> <li><a href="#remove-device-from-storage">remove device from storage</a><span>, in § 4</span> <li><a href="#represented">Represented</a><span>, in § 6.1.2</span> <li><a href="#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot">[[representedCharacteristic]]</a><span>, in § 6.4</span> <li><a href="#dom-bluetoothremotegattdescriptor-representeddescriptor-slot">[[representedDescriptor]]</a><span>, in § 6.5</span> <li><a href="#dom-bluetoothdevice-representeddevice-slot">[[representedDevice]]</a><span>, in § 5.2</span> <li><a href="#dom-bluetoothremotegattservice-representedservice-slot">[[representedService]]</a><span>, in § 6.3</span> <li><a href="#request-bluetooth-devices">request Bluetooth devices</a><span>, in § 4</span> <li><a href="#dom-bluetooth-requestdevice">requestDevice()</a><span>, in § 4</span> <li><a href="#dom-bluetooth-requestdevice">requestDevice(options)</a><span>, in § 4</span> <li><a href="#dictdef-requestdeviceoptions">RequestDeviceOptions</a><span>, in § 4</span> <li><a href="#resolvable-private-address-resolution-procedure">Resolvable Private Address Resolution Procedure</a><span>, in § 13</span> <li><a href="#resolveuuidname">ResolveUUIDName</a><span>, in § 7.1</span> <li><a href="#revoke-bluetooth-access">revoke Bluetooth access</a><span>, in § 4.1</span> <li><a href="#rssi">RSSI</a><span>, in § 13</span> <li> rssi <ul> <li><a href="#dom-bluetoothadvertisingevent-rssi">attribute for BluetoothAdvertisingEvent</a><span>, in § 5.2.3</span> <li><a href="#dom-bluetoothadvertisingeventinit-rssi">dict-member for BluetoothAdvertisingEventInit</a><span>, in § 5.2.3</span> </ul> <li><a href="#same-attribute">same attribute</a><span>, in § 6.1.4</span> <li><a href="#same-bluetooth-device">same Bluetooth device</a><span>, in § 5.1</span> <li><a href="#same-bluetooth-device">same device</a><span>, in § 5.1</span> <li><a href="#scan-for-devices">scan for devices</a><span>, in § 4</span> <li><a href="#searching-for-services">Searching for Services</a><span>, in § 13</span> <li><a href="#serialize-a-device">serialize a device</a><span>, in § 12.2.1.2</span> <li><a href="#serialize-prompt-devices">serialize prompt devices</a><span>, in § 12.2.1.3</span> <li><a href="#service">Service</a><span>, in § 13</span> <li> service <ul> <li><a href="#dom-bluetoothremotegattcharacteristic-service">attribute for BluetoothRemoteGATTCharacteristic</a><span>, in § 6.4</span> <li><a href="#dom-bluetoothservicedatafilterinit-service">dict-member for BluetoothServiceDataFilterInit</a><span>, in § 4</span> </ul> <li><a href="#eventdef-bluetoothremotegattservice-serviceadded">serviceadded</a><span>, in § 6.6.2</span> <li><a href="#service-changed">Service Changed</a><span>, in § 13</span> <li><a href="#eventdef-bluetoothremotegattservice-servicechanged">servicechanged</a><span>, in § 6.6.2</span> <li><a href="#service-data">Service Data</a><span>, in § 13</span> <li> serviceData <ul> <li><a href="#dom-bluetoothadvertisingevent-servicedata">attribute for BluetoothAdvertisingEvent</a><span>, in § 5.2.3</span> <li><a href="#dom-bluetoothadvertisingeventinit-servicedata">dict-member for BluetoothAdvertisingEventInit</a><span>, in § 5.2.3</span> <li><a href="#dom-bluetoothlescanfilterinit-servicedata">dict-member for BluetoothLEScanFilterInit</a><span>, in § 4</span> </ul> <li><a href="#service-definition">Service Definition</a><span>, in § 13</span> <li><a href="#serviceeventhandlers">ServiceEventHandlers</a><span>, in § 6.6.6</span> <li><a href="#service-interoperability-requirements">Service Interoperability Requirements</a><span>, in § 13</span> <li><a href="#eventdef-bluetoothremotegattservice-serviceremoved">serviceremoved</a><span>, in § 6.6.2</span> <li><a href="#dom-bluetoothlescanfilterinit-services">services</a><span>, in § 4</span> <li><a href="#service-uuid-data-type">Service UUID Data Type</a><span>, in § 13</span> <li><a href="#service-uuid-data-type">Service UUIDs</a><span>, in § 13</span> <li><a href="#set-of-devices">set of devices</a><span>, in § 12.2.1.1</span> <li><a href="#dom-watchadvertisementsoptions-signal">signal</a><span>, in § 5.2</span> <li><a href="#simulated-bluetooth-adapter">simulated Bluetooth adapter</a><span>, in § 12</span> <li><a href="#simulated-bluetooth-device">simulated Bluetooth device</a><span>, in § 12</span> <li><a href="#simulated-bluetooth-device-mapping">simulated Bluetooth device mapping</a><span>, in § 12</span> <li><a href="#dom-bluetoothremotegattcharacteristic-startnotifications">startNotifications()</a><span>, in § 6.4</span> <li><a href="#static-address">Static Address</a><span>, in § 13</span> <li><a href="#static-device-address">Static Device Address</a><span>, in § 13</span> <li><a href="#dom-bluetoothremotegattcharacteristic-stopnotifications">stopNotifications()</a><span>, in § 6.4</span> <li><a href="#bluetoothdatafilterinit-strict-subset">strict subset</a><span>, in § 4</span> <li><a href="#supported-physical-transports">supported physical transports</a><span>, in § 5.1</span> <li><a href="#the-128-bit-uuid-represented">the 128-bit UUID represented</a><span>, in § 13</span> <li><a href="#trigger-a-prompt-updated-event">trigger a prompt updated event</a><span>, in § 12.2.4.1</span> <li> txPower <ul> <li><a href="#dom-bluetoothadvertisingevent-txpower">attribute for BluetoothAdvertisingEvent</a><span>, in § 5.2.3</span> <li><a href="#dom-bluetoothadvertisingeventinit-txpower">dict-member for BluetoothAdvertisingEventInit</a><span>, in § 5.2.3</span> </ul> <li><a href="#tx-power-level">TX Power Level</a><span>, in § 13</span> <li> UUID <ul> <li><a href="#typedefdef-uuid">(typedef)</a><span>, in § 7</span> <li><a href="#uuid">definition of</a><span>, in § 13</span> </ul> <li> uuid <ul> <li><a href="#dom-bluetoothremotegattcharacteristic-uuid">attribute for BluetoothRemoteGATTCharacteristic</a><span>, in § 6.4</span> <li><a href="#dom-bluetoothremotegattdescriptor-uuid">attribute for BluetoothRemoteGATTDescriptor</a><span>, in § 6.5</span> <li><a href="#dom-bluetoothremotegattservice-uuid">attribute for BluetoothRemoteGATTService</a><span>, in § 6.3</span> </ul> <li><a href="#uuid-alias">UUID alias</a><span>, in § 13</span> <li> uuids <ul> <li><a href="#dom-bluetoothadvertisingevent-uuids">attribute for BluetoothAdvertisingEvent</a><span>, in § 5.2.3</span> <li><a href="#dom-bluetoothadvertisingeventinit-uuids">dict-member for BluetoothAdvertisingEventInit</a><span>, in § 5.2.3</span> </ul> <li><a href="#valid-company-identifier-string">valid company identifier string</a><span>, in § 9</span> <li><a href="#valid-name">valid name</a><span>, in § 7.1</span> <li><a href="#valid-uuid">valid UUID</a><span>, in § 7</span> <li> value <ul> <li><a href="#dom-bluetoothremotegattcharacteristic-value">attribute for BluetoothRemoteGATTCharacteristic</a><span>, in § 6.4</span> <li><a href="#dom-bluetoothremotegattdescriptor-value">attribute for BluetoothRemoteGATTDescriptor</a><span>, in § 6.5</span> <li><a href="#dom-valueevent-value">attribute for ValueEvent</a><span>, in § 4.2</span> <li><a href="#dom-valueeventinit-value">dict-member for ValueEventInit</a><span>, in § 4.2</span> </ul> <li><a href="#valueevent">ValueEvent</a><span>, in § 4.2</span> <li><a href="#dictdef-valueeventinit">ValueEventInit</a><span>, in § 4.2</span> <li><a href="#dom-valueevent-valueevent">ValueEvent(type)</a><span>, in § 4.2</span> <li><a href="#dom-valueevent-valueevent">ValueEvent(type, initDict)</a><span>, in § 4.2</span> <li><a href="#dom-bluetoothdevice-watchadvertisements">watchAdvertisements()</a><span>, in § 5.2</span> <li><a href="#watch-advertisements-manager">watch advertisements manager</a><span>, in § 5.2</span> <li><a href="#dom-bluetoothdevice-watchadvertisements">watchAdvertisements(options)</a><span>, in § 5.2</span> <li><a href="#dictdef-watchadvertisementsoptions">WatchAdvertisementsOptions</a><span>, in § 5.2</span> <li><a href="#dom-bluetoothdevice-watchadvertisementsstate-slot">[[watchAdvertisementsState]]</a><span>, in § 5.2</span> <li><a href="#dom-bluetoothdevice-watchingadvertisements">watchingAdvertisements</a><span>, in § 5.2</span> <li><a href="#dom-bluetoothcharacteristicproperties-writableauxiliaries">writableAuxiliaries</a><span>, in § 6.4.1</span> <li><a href="#dom-bluetoothcharacteristicproperties-write">write</a><span>, in § 6.4.1</span> <li><a href="#write-characteristic-descriptors">Write Characteristic Descriptors</a><span>, in § 13</span> <li><a href="#write-characteristic-value">Write Characteristic Value</a><span>, in § 13</span> <li><a href="#writecharacteristicvalue">WriteCharacteristicValue</a><span>, in § 6.4</span> <li><a href="#write-long-characteristic-descriptors">Write Long Characteristic Descriptors</a><span>, in § 13</span> <li> writeValue(value) <ul> <li><a href="#dom-bluetoothremotegattcharacteristic-writevalue">method for BluetoothRemoteGATTCharacteristic</a><span>, in § 6.4</span> <li><a href="#dom-bluetoothremotegattdescriptor-writevalue">method for BluetoothRemoteGATTDescriptor</a><span>, in § 6.5</span> </ul> <li><a href="#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse">writeValueWithoutResponse(value)</a><span>, in § 6.4</span> <li><a href="#dom-bluetoothremotegattcharacteristic-writevaluewithresponse">writeValueWithResponse(value)</a><span>, in § 6.4</span> <li><a href="#write-without-response">Write Without Response</a><span>, in § 13</span> <li><a href="#dom-bluetoothcharacteristicproperties-writewithoutresponse">writeWithoutResponse</a><span>, in § 6.4.1</span> </ul> <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3> <ul class="index"> <li> <a data-link-type="biblio">[ASSIGNED-NUMBERS]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="ebe1c949">body_sensor_location</span> <li><span class="dfn-paneled" id="ddcccb57">cycling_power</span> <li><span class="dfn-paneled" id="faaed345">gap.appearance</span> <li><span class="dfn-paneled" id="cdd7910f">gatt.characteristic_presentation_format</span> <li><span class="dfn-paneled" id="4186adc1">gatt.client_characteristic_configuration</span> <li><span class="dfn-paneled" id="04e37f16">heart_rate</span> <li><span class="dfn-paneled" id="c0a36310">heart_rate_control_point</span> <li><span class="dfn-paneled" id="074dc840">heart_rate_measurement</span> <li><span class="dfn-paneled" id="25b9cf35">ieee_11073-20601_regulatory_certification_data_list</span> </ul> <li> <a data-link-type="biblio">[BLUETOOTH-ASSIGNED]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="317eda45">shortened local name</span> </ul> <li> <a data-link-type="biblio">[DOM]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="2e66eaf1">AbortController</span> <li><span class="dfn-paneled" id="cca3cdb2">AbortSignal</span> <li><span class="dfn-paneled" id="129bdae8">Event</span> <li><span class="dfn-paneled" id="44a7708c">EventInit</span> <li><span class="dfn-paneled" id="2bc0cdf4">EventTarget</span> <li><span class="dfn-paneled" id="535dd335">aborted</span> <li><span class="dfn-paneled" id="87bc23a5">add</span> <li><span class="dfn-paneled" id="0c0ceb78">bubbles</span> <li><span class="dfn-paneled" id="92b2d7da">children</span> <li><span class="dfn-paneled" id="a973e0fe">document</span> <li><span class="dfn-paneled" id="5fd23811">fire an event</span> <li><span class="dfn-paneled" id="838900a7">isTrusted</span> <li><span class="dfn-paneled" id="ea3f6646">participate in a tree</span> </ul> <li> <a data-link-type="biblio">[ECMAScript]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="134c93cc">Array</span> <li><span class="dfn-paneled" id="a1d620f3">Array.prototype.map</span> <li><span class="dfn-paneled" id="e6d90a77">ArrayBuffer</span> <li><span class="dfn-paneled" id="71aace1c">DataView</span> <li><span class="dfn-paneled" id="724da416">Promise</span> <li><span class="dfn-paneled" id="7716447b">RegExp</span> <li><span class="dfn-paneled" id="4b12cf9e">Set</span> <li><span class="dfn-paneled" id="58788f9d">TypeError</span> <li><span class="dfn-paneled" id="0c99fb90">TypedArray</span> <li><span class="dfn-paneled" id="b107f911">current realm</span> <li><span class="dfn-paneled" id="1bd9bfdc">exec(string)</span> <li><span class="dfn-paneled" id="c15f1628">internal slot</span> <li><span class="dfn-paneled" id="a262536f">realm</span> <li><span class="dfn-paneled" id="7ec42884">split(separator, limit)</span> </ul> <li> <a data-link-type="biblio">[ENCODING]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="a3033be5">utf-8 decode without bom</span> <li><span class="dfn-paneled" id="0303e8e5">utf-8 encode</span> </ul> <li> <a data-link-type="biblio">[FINGERPRINTING-GUIDANCE]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="836b9827">fingerprinting surface</span> </ul> <li> <a data-link-type="biblio">[HTML]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="f0951476">EventHandler</span> <li><span class="dfn-paneled" id="be0c27b2">Navigator</span> <li><span class="dfn-paneled" id="35972864">active document</span> <li><span class="dfn-paneled" id="101c721c">active window</span> <li><span class="dfn-paneled" id="3610bd67">allowed to use</span> <li><span class="dfn-paneled" id="3349d69f">associated document</span> <li><span class="dfn-paneled" id="9604bc39">associated navigator</span> <li><span class="dfn-paneled" id="0d0390b4">browsing context</span> <li><span class="dfn-paneled" id="12b8dfc0">current settings object</span> <li><span class="dfn-paneled" id="102df61f">enqueue the following steps</span> <li><span class="dfn-paneled" id="3e12e042">environment settings object</span> <li><span class="dfn-paneled" id="03675365">event handler idl attribute</span> <li><span class="dfn-paneled" id="0e3ba9f8">fully active</span> <li><span class="dfn-paneled" id="4b6086d7">global object</span> <li><span class="dfn-paneled" id="8a30477b">global object <small>(for environment settings object)</small></span> <li><span class="dfn-paneled" id="a72449dd">in parallel</span> <li><span class="dfn-paneled" id="dbdbb853">inclusive descendant navigables</span> <li><span class="dfn-paneled" id="cfcf5fb7">initializing the document object</span> <li><span class="dfn-paneled" id="9c19b7fc">navigable</span> <li><span class="dfn-paneled" id="228be966">navigable <small>(for Window)</small></span> <li><span class="dfn-paneled" id="2594e562">navigate</span> <li><span class="dfn-paneled" id="5155c2d3">non-secure context</span> <li><span class="dfn-paneled" id="8603b31a">perform a microtask checkpoint</span> <li><span class="dfn-paneled" id="9a517a7d">queue a task</span> <li><span class="dfn-paneled" id="e99bd18e">relevant global object</span> <li><span class="dfn-paneled" id="5991ccfb">relevant realm</span> <li><span class="dfn-paneled" id="9c4c1e66">relevant settings object</span> <li><span class="dfn-paneled" id="e3288657">responsible event loop</span> <li><span class="dfn-paneled" id="65181da8">secure context</span> <li><span class="dfn-paneled" id="8219d486">starting a new parallel queue</span> <li><span class="dfn-paneled" id="30717154">top-level traversable</span> </ul> <li> <a data-link-type="biblio">[INFRA]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="1adcc035">abort when</span> <li><span class="dfn-paneled" id="53275e46">append</span> <li><span class="dfn-paneled" id="b7f60025">ascii lower hex digit</span> <li><span class="dfn-paneled" id="3de9e659">byte sequence</span> <li><span class="dfn-paneled" id="1243a891">exist</span> <li><span class="dfn-paneled" id="45209803">for each</span> <li><span class="dfn-paneled" id="73e75483">forgiving-base64 decode</span> <li><span class="dfn-paneled" id="d5890b17">getting the values</span> <li><span class="dfn-paneled" id="715f22e4">if aborted</span> <li><span class="dfn-paneled" id="649608b9">list</span> <li><span class="dfn-paneled" id="3fca5a9e">map</span> <li><span class="dfn-paneled" id="84b454ff">ordered map</span> <li><span class="dfn-paneled" id="7d4424b2">remove</span> <li><span class="dfn-paneled" id="15e48c39">set</span> <li><span class="dfn-paneled" id="e5fc5b88">strictly split</span> <li><span class="dfn-paneled" id="0698d556">string</span> <li><span class="dfn-paneled" id="0e8de730">tuple</span> </ul> <li> <a data-link-type="biblio">[PAGE-VISIBILITY]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="5afde8ae">document visibility state</span> </ul> <li> <a data-link-type="biblio">[PERMISSIONS]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="ebb01253">PermissionDescriptor</span> <li><span class="dfn-paneled" id="dbf8e074">PermissionStatus</span> <li><span class="dfn-paneled" id="2cb28cb0">denied</span> <li><span class="dfn-paneled" id="c1460964">extra permission data</span> <li><span class="dfn-paneled" id="287bee7a">extra permission data constraints</span> <li><span class="dfn-paneled" id="0cc28b31">extra permission data type</span> <li><span class="dfn-paneled" id="0310eecd">name <small>(for PermissionDescriptor)</small></span> <li><span class="dfn-paneled" id="e740d7e5">name <small>(for powerful feature)</small></span> <li><span class="dfn-paneled" id="4b7ca52a">permission descriptor type</span> <li><span class="dfn-paneled" id="7ee1f942">permission query algorithm</span> <li><span class="dfn-paneled" id="a6da7e16">permission result type</span> <li><span class="dfn-paneled" id="409a61ca">permission revocation algorithm</span> <li><span class="dfn-paneled" id="d124397f">permission state</span> <li><span class="dfn-paneled" id="6c2d7879">powerful feature</span> <li><span class="dfn-paneled" id="c2430fbb">prompt the user to choose</span> <li><span class="dfn-paneled" id="78f04503">query()</span> <li><span class="dfn-paneled" id="620f832e">state</span> </ul> <li> <a data-link-type="biblio">[PERMISSIONS-POLICY-1]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="1570624a">default allowlist</span> <li><span class="dfn-paneled" id="cc890cc1">policy-controlled feature</span> </ul> <li> <a data-link-type="biblio">[WEBDRIVER-BIDI]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="db84aa06">emit an event</span> <li><span class="dfn-paneled" id="be79cdb1">get a navigable</span> <li><span class="dfn-paneled" id="5d727956">navigable id</span> <li><span class="dfn-paneled" id="23af542f">set of sessions for which an event is enabled</span> </ul> <li> <a data-link-type="biblio">[WEBDRIVER1]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="bb4c269e">error</span> <li><span class="dfn-paneled" id="9a707b42">local end</span> </ul> <li> <a data-link-type="biblio">[WEBDRIVER2]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="c8ff8493">error code</span> <li><span class="dfn-paneled" id="8da4d1e3">invalid argument</span> <li><span class="dfn-paneled" id="82c23298">remote end steps</span> <li><span class="dfn-paneled" id="4be6272b">success</span> <li><span class="dfn-paneled" id="7aa9c8e0">trying</span> </ul> <li> <a data-link-type="biblio">[WEBHID]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="0c0fa736">strings</span> </ul> <li> <a data-link-type="biblio">[WEBIDL]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="d25dfb2c">AbortError</span> <li><span class="dfn-paneled" id="3aff2fb3">BufferSource</span> <li><span class="dfn-paneled" id="dca2de17">DOMException</span> <li><span class="dfn-paneled" id="8855a9aa">DOMString</span> <li><span class="dfn-paneled" id="c01cbda0">EnforceRange</span> <li><span class="dfn-paneled" id="889e932f">Exposed</span> <li><span class="dfn-paneled" id="dcf5fafa">FrozenArray</span> <li><span class="dfn-paneled" id="cae6bf57">InvalidModificationError</span> <li><span class="dfn-paneled" id="797018a7">InvalidStateError</span> <li><span class="dfn-paneled" id="c74f29b9">NetworkError</span> <li><span class="dfn-paneled" id="9eda9b58">NotFoundError</span> <li><span class="dfn-paneled" id="3182eb71">NotSupportedError</span> <li><span class="dfn-paneled" id="bdbd19d1">Promise</span> <li><span class="dfn-paneled" id="a5c91173">SameObject</span> <li><span class="dfn-paneled" id="b75bb3bd">SecureContext</span> <li><span class="dfn-paneled" id="c3e881ef">SecurityError</span> <li><span class="dfn-paneled" id="95d7775a">Uint8Array</span> <li><span class="dfn-paneled" id="81dd847b">UnknownError</span> <li><span class="dfn-paneled" id="d72eb9fa">a copy of the bytes held</span> <li><span class="dfn-paneled" id="dacde8b5">a new promise</span> <li><span class="dfn-paneled" id="d0b4a948">a promise rejected with</span> <li><span class="dfn-paneled" id="6c6b1005">any</span> <li><span class="dfn-paneled" id="5372cca8">boolean</span> <li><span class="dfn-paneled" id="f4813f78">byte</span> <li><span class="dfn-paneled" id="ae4bc361">converted to an ecmascript value</span> <li><span class="dfn-paneled" id="77996ab1">maplike</span> <li><span class="dfn-paneled" id="750a2f08">react</span> <li><span class="dfn-paneled" id="b262501e">reject</span> <li><span class="dfn-paneled" id="3b90bdcd">resolve</span> <li><span class="dfn-paneled" id="9cce47fd">sequence</span> <li><span class="dfn-paneled" id="4013a022">this</span> <li><span class="dfn-paneled" id="5f90bbfb">undefined</span> <li><span class="dfn-paneled" id="e97a9688">unsigned long</span> <li><span class="dfn-paneled" id="450958f7">unsigned short</span> <li><span class="dfn-paneled" id="24bd7d25">upon fulfillment</span> <li><span class="dfn-paneled" id="4986aca5">waiting for all</span> </ul> </ul> <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2> <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3> <dl> <dt id="biblio-bluetooth-assigned">[BLUETOOTH-ASSIGNED] <dd><a href="https://www.bluetooth.com/specifications/assigned-numbers/"><cite>Assigned Numbers</cite></a>. Living Standard. URL: <a href="https://www.bluetooth.com/specifications/assigned-numbers/">https://www.bluetooth.com/specifications/assigned-numbers/</a> <dt id="biblio-bluetooth-supplement6">[BLUETOOTH-SUPPLEMENT6] <dd><a href="https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=302735"><cite>Supplement to the Bluetooth Core Specification Version 6</cite></a>. 14 July 2015. URL: <a href="https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=302735">https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=302735</a> <dt id="biblio-bluetooth42">[BLUETOOTH42] <dd><a href="https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439"><cite>BLUETOOTH SPECIFICATION Version 4.2</cite></a>. 2 December 2014. URL: <a href="https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439">https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439</a> <dt id="biblio-dom">[DOM] <dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/"><cite>DOM Standard</cite></a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a> <dt id="biblio-ecmascript">[ECMAScript] <dd><a href="https://tc39.es/ecma262/multipage/"><cite>ECMAScript Language Specification</cite></a>. URL: <a href="https://tc39.es/ecma262/multipage/">https://tc39.es/ecma262/multipage/</a> <dt id="biblio-encoding">[ENCODING] <dd>Anne van Kesteren. <a href="https://encoding.spec.whatwg.org/"><cite>Encoding Standard</cite></a>. Living Standard. URL: <a href="https://encoding.spec.whatwg.org/">https://encoding.spec.whatwg.org/</a> <dt id="biblio-fingerprinting-guidance">[FINGERPRINTING-GUIDANCE] <dd>Nick Doty. <a href="https://w3c.github.io/fingerprinting-guidance/"><cite>Mitigating Browser Fingerprinting in Web Specifications</cite></a>. URL: <a href="https://w3c.github.io/fingerprinting-guidance/">https://w3c.github.io/fingerprinting-guidance/</a> <dt id="biblio-html">[HTML] <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/"><cite>HTML Standard</cite></a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a> <dt id="biblio-infra">[INFRA] <dd>Anne van Kesteren; Domenic Denicola. <a href="https://infra.spec.whatwg.org/"><cite>Infra Standard</cite></a>. Living Standard. URL: <a href="https://infra.spec.whatwg.org/">https://infra.spec.whatwg.org/</a> <dt id="biblio-page-visibility">[PAGE-VISIBILITY] <dd>Jatinder Mann; Arvind Jain. <a href="https://www.w3.org/TR/page-visibility/"><cite>Page Visibility (Second Edition)</cite></a>. 29 October 2013. REC. URL: <a href="https://www.w3.org/TR/page-visibility/">https://www.w3.org/TR/page-visibility/</a> <dt id="biblio-permissions">[PERMISSIONS] <dd>Marcos Caceres; Mike Taylor. <a href="https://w3c.github.io/permissions/"><cite>Permissions</cite></a>. URL: <a href="https://w3c.github.io/permissions/">https://w3c.github.io/permissions/</a> <dt id="biblio-permissions-policy-1">[PERMISSIONS-POLICY-1] <dd>Ian Clelland. <a href="https://w3c.github.io/webappsec-permissions-policy/"><cite>Permissions Policy</cite></a>. URL: <a href="https://w3c.github.io/webappsec-permissions-policy/">https://w3c.github.io/webappsec-permissions-policy/</a> <dt id="biblio-rfc2119">[RFC2119] <dd>S. Bradner. <a href="https://datatracker.ietf.org/doc/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a>. March 1997. Best Current Practice. URL: <a href="https://datatracker.ietf.org/doc/html/rfc2119">https://datatracker.ietf.org/doc/html/rfc2119</a> <dt id="biblio-rfc4122">[RFC4122] <dd>P. Leach; M. Mealling; R. Salz. <a href="https://www.rfc-editor.org/rfc/rfc4122"><cite>A Universally Unique IDentifier (UUID) URN Namespace</cite></a>. July 2005. Proposed Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc4122">https://www.rfc-editor.org/rfc/rfc4122</a> <dt id="biblio-webdriver-bidi">[WEBDRIVER-BIDI] <dd><a href="https://w3c.github.io/webdriver-bidi/"><cite>WebDriver BiDi</cite></a>. Editor's Draft. URL: <a href="https://w3c.github.io/webdriver-bidi/">https://w3c.github.io/webdriver-bidi/</a> <dt id="biblio-webdriver1">[WEBDRIVER1] <dd>Simon Stewart; David Burns. <a href="https://w3c.github.io/webdriver/"><cite>WebDriver</cite></a>. URL: <a href="https://w3c.github.io/webdriver/">https://w3c.github.io/webdriver/</a> <dt id="biblio-webdriver2">[WEBDRIVER2] <dd>Simon Stewart; David Burns. <a href="https://w3c.github.io/webdriver/"><cite>WebDriver</cite></a>. URL: <a href="https://w3c.github.io/webdriver/">https://w3c.github.io/webdriver/</a> <dt id="biblio-webhid">[WEBHID] <dd><a href="https://wicg.github.io/webhid/"><cite>WebHID API</cite></a>. Draft Community Group Report. URL: <a href="https://wicg.github.io/webhid/">https://wicg.github.io/webhid/</a> <dt id="biblio-webidl">[WEBIDL] <dd>Edgar Chen; Timothy Gu. <a href="https://webidl.spec.whatwg.org/"><cite>Web IDL Standard</cite></a>. Living Standard. URL: <a href="https://webidl.spec.whatwg.org/">https://webidl.spec.whatwg.org/</a> </dl> <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3> <dl> <dt id="biblio-csp3">[CSP3] <dd>Mike West; Antonio Sartori. <a href="https://w3c.github.io/webappsec-csp/"><cite>Content Security Policy Level 3</cite></a>. URL: <a href="https://w3c.github.io/webappsec-csp/">https://w3c.github.io/webappsec-csp/</a> </dl> <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2> <pre class="idl highlight def"><c- b>dictionary</c-> <a href="#dictdef-bluetoothdatafilterinit"><code><c- g>BluetoothDataFilterInit</c-></code></a> { <a data-link-type="idl-name" href="https://webidl.spec.whatwg.org/#BufferSource"><c- n>BufferSource</c-></a> <a data-type="BufferSource " href="#dom-bluetoothdatafilterinit-dataprefix"><code><c- g>dataPrefix</c-></code></a>; <a data-link-type="idl-name" href="https://webidl.spec.whatwg.org/#BufferSource"><c- n>BufferSource</c-></a> <a data-type="BufferSource " href="#dom-bluetoothdatafilterinit-mask"><code><c- g>mask</c-></code></a>; }; <c- b>dictionary</c-> <a href="#dictdef-bluetoothmanufacturerdatafilterinit"><code><c- g>BluetoothManufacturerDataFilterInit</c-></code></a> : <a data-link-type="idl-name" href="#dictdef-bluetoothdatafilterinit"><c- n>BluetoothDataFilterInit</c-></a> { <c- b>required</c-> [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#EnforceRange"><c- g>EnforceRange</c-></a>] <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short"><c- b>unsigned</c-> <c- b>short</c-></a> <a data-type="[EnforceRange] unsigned short " href="#dom-bluetoothmanufacturerdatafilterinit-companyidentifier"><code><c- g>companyIdentifier</c-></code></a>; }; <c- b>dictionary</c-> <a href="#dictdef-bluetoothservicedatafilterinit"><code><c- g>BluetoothServiceDataFilterInit</c-></code></a> : <a data-link-type="idl-name" href="#dictdef-bluetoothdatafilterinit"><c- n>BluetoothDataFilterInit</c-></a> { <c- b>required</c-> <a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid"><c- n>BluetoothServiceUUID</c-></a> <a data-type="BluetoothServiceUUID " href="#dom-bluetoothservicedatafilterinit-service"><code><c- g>service</c-></code></a>; }; <c- b>dictionary</c-> <a href="#dictdef-bluetoothlescanfilterinit"><code><c- g>BluetoothLEScanFilterInit</c-></code></a> { <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid"><c- n>BluetoothServiceUUID</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothServiceUUID> " href="#dom-bluetoothlescanfilterinit-services"><c- g>services</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="DOMString " href="#dom-bluetoothlescanfilterinit-name"><c- g>name</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="dict-member" data-type="DOMString " href="#dom-bluetoothlescanfilterinit-nameprefix"><c- g>namePrefix</c-></a>; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#dictdef-bluetoothmanufacturerdatafilterinit"><c- n>BluetoothManufacturerDataFilterInit</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothManufacturerDataFilterInit> " href="#dom-bluetoothlescanfilterinit-manufacturerdata"><c- g>manufacturerData</c-></a>; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#dictdef-bluetoothservicedatafilterinit"><c- n>BluetoothServiceDataFilterInit</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothServiceDataFilterInit> " href="#dom-bluetoothlescanfilterinit-servicedata"><c- g>serviceData</c-></a>; }; <c- b>dictionary</c-> <a href="#dictdef-requestdeviceoptions"><code><c- g>RequestDeviceOptions</c-></code></a> { <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#dictdef-bluetoothlescanfilterinit"><c- n>BluetoothLEScanFilterInit</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothLEScanFilterInit> " href="#dom-requestdeviceoptions-filters"><c- g>filters</c-></a>; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#dictdef-bluetoothlescanfilterinit"><c- n>BluetoothLEScanFilterInit</c-></a>> <a class="idl-code" data-link-type="dict-member" data-type="sequence<BluetoothLEScanFilterInit> " href="#dom-requestdeviceoptions-exclusionfilters"><c- g>exclusionFilters</c-></a>; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid"><c- n>BluetoothServiceUUID</c-></a>> <a class="idl-code" data-default="[]" data-link-type="dict-member" data-type="sequence<BluetoothServiceUUID> " href="#dom-requestdeviceoptions-optionalservices"><c- g>optionalServices</c-></a> = []; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short"><c- b>unsigned</c-> <c- b>short</c-></a>> <a class="idl-code" data-default="[]" data-link-type="dict-member" data-type="sequence<unsigned short> " href="#dom-requestdeviceoptions-optionalmanufacturerdata"><c- g>optionalManufacturerData</c-></a> = []; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a class="idl-code" data-default="false" data-link-type="dict-member" data-type="boolean " href="#dom-requestdeviceoptions-acceptalldevices"><c- g>acceptAllDevices</c-></a> = <c- b>false</c->; }; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <a href="#bluetooth"><code><c- g>Bluetooth</c-></code></a> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget"><c- n>EventTarget</c-></a> { <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetooth-getavailability"><c- g>getAvailability</c-></a>(); <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler"><c- n>EventHandler</c-></a> <a data-type="EventHandler" href="#dom-bluetooth-onavailabilitychanged"><code><c- g>onavailabilitychanged</c-></code></a>; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothdevice"><c- n>BluetoothDevice</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice?" href="#dom-bluetooth-referringdevice"><c- g>referringDevice</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothdevice"><c- n>BluetoothDevice</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-bluetooth-getdevices"><c- g>getDevices</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothdevice"><c- n>BluetoothDevice</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetooth-requestdevice"><c- g>requestDevice</c-></a>(<c- b>optional</c-> <a data-link-type="idl-name" href="#dictdef-requestdeviceoptions"><c- n>RequestDeviceOptions</c-></a> <a href="#dom-bluetooth-requestdevice-options-options"><code><c- g>options</c-></code></a> = {}); }; <a data-link-type="idl-name" href="#bluetooth"><c- n>Bluetooth</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#bluetoothdeviceeventhandlers"><c- n>BluetoothDeviceEventHandlers</c-></a>; <a data-link-type="idl-name" href="#bluetooth"><c- n>Bluetooth</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#characteristiceventhandlers"><c- n>CharacteristicEventHandlers</c-></a>; <a data-link-type="idl-name" href="#bluetooth"><c- n>Bluetooth</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#serviceeventhandlers"><c- n>ServiceEventHandlers</c-></a>; <c- b>dictionary</c-> <a href="#dictdef-bluetoothpermissiondescriptor"><code><c- g>BluetoothPermissionDescriptor</c-></code></a> : <a data-link-type="idl-name" href="https://w3c.github.io/permissions/#dom-permissiondescriptor"><c- n>PermissionDescriptor</c-></a> { <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-bluetoothpermissiondescriptor-deviceid"><code><c- g>deviceId</c-></code></a>; // These match RequestDeviceOptions. <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#dictdef-bluetoothlescanfilterinit"><c- n>BluetoothLEScanFilterInit</c-></a>> <a data-type="sequence<BluetoothLEScanFilterInit> " href="#dom-bluetoothpermissiondescriptor-filters"><code><c- g>filters</c-></code></a>; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid"><c- n>BluetoothServiceUUID</c-></a>> <a data-default="[]" data-type="sequence<BluetoothServiceUUID> " href="#dom-bluetoothpermissiondescriptor-optionalservices"><code><c- g>optionalServices</c-></code></a> = []; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short"><c- b>unsigned</c-> <c- b>short</c-></a>> <a data-default="[]" data-type="sequence<unsigned short> " href="#dom-bluetoothpermissiondescriptor-optionalmanufacturerdata"><code><c- g>optionalManufacturerData</c-></code></a> = []; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-bluetoothpermissiondescriptor-acceptalldevices"><code><c- g>acceptAllDevices</c-></code></a> = <c- b>false</c->; }; <c- b>dictionary</c-> <a href="#dictdef-allowedbluetoothdevice"><code><c- g>AllowedBluetoothDevice</c-></code></a> { <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-allowedbluetoothdevice-deviceid"><code><c- g>deviceId</c-></code></a>; <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a data-type="boolean " href="#dom-allowedbluetoothdevice-mayusegatt"><code><c- g>mayUseGATT</c-></code></a>; // An allowedServices of "all" means all services are allowed. <c- b>required</c-> (<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <c- b>or</c-> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#typedefdef-uuid"><c- n>UUID</c-></a>>) <a data-type="(DOMString or sequence<UUID>) " href="#dom-allowedbluetoothdevice-allowedservices"><code><c- g>allowedServices</c-></code></a>; <c- b>required</c-> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short"><c- b>unsigned</c-> <c- b>short</c-></a>> <a data-type="sequence<unsigned short> " href="#dom-allowedbluetoothdevice-allowedmanufacturerdata"><code><c- g>allowedManufacturerData</c-></code></a>; }; <c- b>dictionary</c-> <a href="#dictdef-bluetoothpermissionstorage"><code><c- g>BluetoothPermissionStorage</c-></code></a> { <c- b>required</c-> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#dictdef-allowedbluetoothdevice"><c- n>AllowedBluetoothDevice</c-></a>> <a data-type="sequence<AllowedBluetoothDevice> " href="#dom-bluetoothpermissionstorage-alloweddevices"><code><c- g>allowedDevices</c-></code></a>; }; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->] <c- b>interface</c-> <a href="#bluetoothpermissionresult"><code><c- g>BluetoothPermissionResult</c-></code></a> : <a data-link-type="idl-name" href="https://w3c.github.io/permissions/#dom-permissionstatus"><c- n>PermissionStatus</c-></a> { <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-frozen-array"><c- b>FrozenArray</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothdevice"><c- n>BluetoothDevice</c-></a>> <a data-type="FrozenArray<BluetoothDevice>" href="#dom-bluetoothpermissionresult-devices"><code><c- g>devices</c-></code></a>; }; [ <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a> ] <c- b>interface</c-> <a href="#valueevent"><code><c- g>ValueEvent</c-></code></a> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event"><c- n>Event</c-></a> { <a href="#dom-valueevent-valueevent"><code><c- g>constructor</c-></code></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <a href="#dom-valueevent-valueevent-type-initdict-type"><code><c- g>type</c-></code></a>, <c- b>optional</c-> <a data-link-type="idl-name" href="#dictdef-valueeventinit"><c- n>ValueEventInit</c-></a> <a href="#dom-valueevent-valueevent-type-initdict-initdict"><code><c- g>initDict</c-></code></a> = {}); <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-any"><c- b>any</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="any" href="#dom-valueevent-value"><c- g>value</c-></a>; }; <c- b>dictionary</c-> <a href="#dictdef-valueeventinit"><code><c- g>ValueEventInit</c-></code></a> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit"><c- n>EventInit</c-></a> { <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-any"><c- b>any</c-></a> <a data-default="null" data-type="any " href="#dom-valueeventinit-value"><code><c- g>value</c-></code></a> = <c- b>null</c->; }; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <a href="#bluetoothdevice"><code><c- g>BluetoothDevice</c-></code></a> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget"><c- n>EventTarget</c-></a> { <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#dom-bluetoothdevice-id"><c- g>id</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString?" href="#dom-bluetoothdevice-name"><c- g>name</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothremotegattserver"><c- n>BluetoothRemoteGATTServer</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothRemoteGATTServer?" href="#dom-bluetoothdevice-gatt"><c- g>gatt</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined"><c- b>undefined</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothdevice-forget"><c- g>forget</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined"><c- b>undefined</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothdevice-watchadvertisements"><c- g>watchAdvertisements</c-></a>( <c- b>optional</c-> <a data-link-type="idl-name" href="#dictdef-watchadvertisementsoptions"><c- n>WatchAdvertisementsOptions</c-></a> <a href="#dom-bluetoothdevice-watchadvertisements-options-options"><code><c- g>options</c-></code></a> = {}); <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-bluetoothdevice-watchingadvertisements"><c- g>watchingAdvertisements</c-></a>; }; <a data-link-type="idl-name" href="#bluetoothdevice"><c- n>BluetoothDevice</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#bluetoothdeviceeventhandlers"><c- n>BluetoothDeviceEventHandlers</c-></a>; <a data-link-type="idl-name" href="#bluetoothdevice"><c- n>BluetoothDevice</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#characteristiceventhandlers"><c- n>CharacteristicEventHandlers</c-></a>; <a data-link-type="idl-name" href="#bluetoothdevice"><c- n>BluetoothDevice</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#serviceeventhandlers"><c- n>ServiceEventHandlers</c-></a>; <c- b>dictionary</c-> <a href="#dictdef-watchadvertisementsoptions"><code><c- g>WatchAdvertisementsOptions</c-></code></a> { <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#abortsignal"><c- n>AbortSignal</c-></a> <a data-type="AbortSignal " href="#dom-watchadvertisementsoptions-signal"><code><c- g>signal</c-></code></a>; }; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothmanufacturerdatamap"><c- g>BluetoothManufacturerDataMap</c-></a> { <c- b>readonly</c-> <c- b>maplike</c->&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short"><c- b>unsigned</c-> <c- b>short</c-></a>, <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor"><c- b>DataView</c-></a>>; }; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#bluetoothservicedatamap"><c- g>BluetoothServiceDataMap</c-></a> { <c- b>readonly</c-> <c- b>maplike</c->&lt;<a data-link-type="idl-name" href="#typedefdef-uuid"><c- n>UUID</c-></a>, <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor"><c- b>DataView</c-></a>>; }; [ <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a> ] <c- b>interface</c-> <a href="#bluetoothadvertisingevent"><code><c- g>BluetoothAdvertisingEvent</c-></code></a> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event"><c- n>Event</c-></a> { <a class="idl-code" data-link-type="constructor" href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent"><c- g>constructor</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <a href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent-type-init-type"><code><c- g>type</c-></code></a>, <a data-link-type="idl-name" href="#dictdef-bluetoothadvertisingeventinit"><c- n>BluetoothAdvertisingEventInit</c-></a> <a href="#dom-bluetoothadvertisingevent-bluetoothadvertisingevent-type-init-init"><code><c- g>init</c-></code></a>); [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothdevice"><c- n>BluetoothDevice</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice" href="#dom-bluetoothadvertisingevent-device"><c- g>device</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-frozen-array"><c- b>FrozenArray</c-></a>&lt;<a data-link-type="idl-name" href="#typedefdef-uuid"><c- n>UUID</c-></a>> <a class="idl-code" data-link-type="attribute" data-readonly data-type="FrozenArray<UUID>" href="#dom-bluetoothadvertisingevent-uuids"><c- g>uuids</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString?" href="#dom-bluetoothadvertisingevent-name"><c- g>name</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short"><c- b>unsigned</c-> <c- b>short</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned short?" href="#dom-bluetoothadvertisingevent-appearance"><c- g>appearance</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-byte"><c- b>byte</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="byte?" href="#dom-bluetoothadvertisingevent-txpower"><c- g>txPower</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-byte"><c- b>byte</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="byte?" href="#dom-bluetoothadvertisingevent-rssi"><c- g>rssi</c-></a>; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothmanufacturerdatamap"><c- n>BluetoothManufacturerDataMap</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothManufacturerDataMap" href="#dom-bluetoothadvertisingevent-manufacturerdata"><c- g>manufacturerData</c-></a>; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothservicedatamap"><c- n>BluetoothServiceDataMap</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothServiceDataMap" href="#dom-bluetoothadvertisingevent-servicedata"><c- g>serviceData</c-></a>; }; <c- b>dictionary</c-> <a href="#dictdef-bluetoothadvertisingeventinit"><code><c- g>BluetoothAdvertisingEventInit</c-></code></a> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit"><c- n>EventInit</c-></a> { <c- b>required</c-> <a data-link-type="idl-name" href="#bluetoothdevice"><c- n>BluetoothDevice</c-></a> <a data-type="BluetoothDevice " href="#dom-bluetoothadvertisingeventinit-device"><code><c- g>device</c-></code></a>; <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long"><c- b>unsigned</c-> <c- b>long</c-></a>)> <a data-type="sequence<(DOMString or unsigned long)> " href="#dom-bluetoothadvertisingeventinit-uuids"><code><c- g>uuids</c-></code></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-bluetoothadvertisingeventinit-name"><code><c- g>name</c-></code></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-short"><c- b>unsigned</c-> <c- b>short</c-></a> <a data-type="unsigned short " href="#dom-bluetoothadvertisingeventinit-appearance"><code><c- g>appearance</c-></code></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-byte"><c- b>byte</c-></a> <a data-type="byte " href="#dom-bluetoothadvertisingeventinit-txpower"><code><c- g>txPower</c-></code></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-byte"><c- b>byte</c-></a> <a data-type="byte " href="#dom-bluetoothadvertisingeventinit-rssi"><code><c- g>rssi</c-></code></a>; <a data-link-type="idl-name" href="#bluetoothmanufacturerdatamap"><c- n>BluetoothManufacturerDataMap</c-></a> <a data-type="BluetoothManufacturerDataMap " href="#dom-bluetoothadvertisingeventinit-manufacturerdata"><code><c- g>manufacturerData</c-></code></a>; <a data-link-type="idl-name" href="#bluetoothservicedatamap"><c- n>BluetoothServiceDataMap</c-></a> <a data-type="BluetoothServiceDataMap " href="#dom-bluetoothadvertisingeventinit-servicedata"><code><c- g>serviceData</c-></code></a>; }; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <a href="#bluetoothremotegattserver"><code><c- g>BluetoothRemoteGATTServer</c-></code></a> { [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothdevice"><c- n>BluetoothDevice</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice" href="#dom-bluetoothremotegattserver-device"><c- g>device</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-bluetoothremotegattserver-connected"><c- g>connected</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattserver"><c- n>BluetoothRemoteGATTServer</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-connect"><c- g>connect</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined"><c- b>undefined</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-disconnect"><c- g>disconnect</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattservice"><c- n>BluetoothRemoteGATTService</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-getprimaryservice"><c- g>getPrimaryService</c-></a>(<a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid"><c- n>BluetoothServiceUUID</c-></a> <a href="#dom-bluetoothremotegattserver-getprimaryservice-service-service"><code><c- g>service</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattservice"><c- n>BluetoothRemoteGATTService</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattserver-getprimaryservices"><c- g>getPrimaryServices</c-></a>(<c- b>optional</c-> <a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid"><c- n>BluetoothServiceUUID</c-></a> <a href="#dom-bluetoothremotegattserver-getprimaryservices-service-service"><code><c- g>service</c-></code></a>); }; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <a href="#bluetoothremotegattservice"><code><c- g>BluetoothRemoteGATTService</c-></code></a> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget"><c- n>EventTarget</c-></a> { [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothdevice"><c- n>BluetoothDevice</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothDevice" href="#dom-bluetoothremotegattservice-device"><c- g>device</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#typedefdef-uuid"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="UUID" href="#dom-bluetoothremotegattservice-uuid"><c- g>uuid</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-bluetoothremotegattservice-isprimary"><c- g>isPrimary</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattcharacteristic"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getcharacteristic"><c- g>getCharacteristic</c-></a>(<a data-link-type="idl-name" href="#typedefdef-bluetoothcharacteristicuuid"><c- n>BluetoothCharacteristicUUID</c-></a> <a href="#dom-bluetoothremotegattservice-getcharacteristic-characteristic-characteristic"><code><c- g>characteristic</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattcharacteristic"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getcharacteristics"><c- g>getCharacteristics</c-></a>(<c- b>optional</c-> <a data-link-type="idl-name" href="#typedefdef-bluetoothcharacteristicuuid"><c- n>BluetoothCharacteristicUUID</c-></a> <a href="#dom-bluetoothremotegattservice-getcharacteristics-characteristic-characteristic"><code><c- g>characteristic</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattservice"><c- n>BluetoothRemoteGATTService</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getincludedservice"><c- g>getIncludedService</c-></a>(<a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid"><c- n>BluetoothServiceUUID</c-></a> <a href="#dom-bluetoothremotegattservice-getincludedservice-service-service"><code><c- g>service</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattservice"><c- n>BluetoothRemoteGATTService</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattservice-getincludedservices"><c- g>getIncludedServices</c-></a>(<c- b>optional</c-> <a data-link-type="idl-name" href="#typedefdef-bluetoothserviceuuid"><c- n>BluetoothServiceUUID</c-></a> <a href="#dom-bluetoothremotegattservice-getincludedservices-service-service"><code><c- g>service</c-></code></a>); }; <a data-link-type="idl-name" href="#bluetoothremotegattservice"><c- n>BluetoothRemoteGATTService</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#characteristiceventhandlers"><c- n>CharacteristicEventHandlers</c-></a>; <a data-link-type="idl-name" href="#bluetoothremotegattservice"><c- n>BluetoothRemoteGATTService</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#serviceeventhandlers"><c- n>ServiceEventHandlers</c-></a>; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <a href="#bluetoothremotegattcharacteristic"><code><c- g>BluetoothRemoteGATTCharacteristic</c-></code></a> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget"><c- n>EventTarget</c-></a> { [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothremotegattservice"><c- n>BluetoothRemoteGATTService</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothRemoteGATTService" href="#dom-bluetoothremotegattcharacteristic-service"><c- g>service</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#typedefdef-uuid"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="UUID" href="#dom-bluetoothremotegattcharacteristic-uuid"><c- g>uuid</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothcharacteristicproperties"><c- n>BluetoothCharacteristicProperties</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothCharacteristicProperties" href="#dom-bluetoothremotegattcharacteristic-properties"><c- g>properties</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor"><c- b>DataView</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DataView?" href="#dom-bluetoothremotegattcharacteristic-value"><c- g>value</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattdescriptor"><c- n>BluetoothRemoteGATTDescriptor</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-getdescriptor"><c- g>getDescriptor</c-></a>(<a data-link-type="idl-name" href="#typedefdef-bluetoothdescriptoruuid"><c- n>BluetoothDescriptorUUID</c-></a> <a href="#dom-bluetoothremotegattcharacteristic-getdescriptor-descriptor-descriptor"><code><c- g>descriptor</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattdescriptor"><c- n>BluetoothRemoteGATTDescriptor</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-getdescriptors"><c- g>getDescriptors</c-></a>(<c- b>optional</c-> <a data-link-type="idl-name" href="#typedefdef-bluetoothdescriptoruuid"><c- n>BluetoothDescriptorUUID</c-></a> <a href="#dom-bluetoothremotegattcharacteristic-getdescriptors-descriptor-descriptor"><code><c- g>descriptor</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor"><c- b>DataView</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-readvalue"><c- g>readValue</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined"><c- b>undefined</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-writevalue"><c- g>writeValue</c-></a>(<a data-link-type="idl-name" href="https://webidl.spec.whatwg.org/#BufferSource"><c- n>BufferSource</c-></a> <a href="#dom-bluetoothremotegattcharacteristic-writevalue-value-value"><code><c- g>value</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined"><c- b>undefined</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-writevaluewithresponse"><c- g>writeValueWithResponse</c-></a>(<a data-link-type="idl-name" href="https://webidl.spec.whatwg.org/#BufferSource"><c- n>BufferSource</c-></a> <a href="#dom-bluetoothremotegattcharacteristic-writevaluewithresponse-value-value"><code><c- g>value</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined"><c- b>undefined</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse"><c- g>writeValueWithoutResponse</c-></a>(<a data-link-type="idl-name" href="https://webidl.spec.whatwg.org/#BufferSource"><c- n>BufferSource</c-></a> <a href="#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse-value-value"><code><c- g>value</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattcharacteristic"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-startnotifications"><c- g>startNotifications</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#bluetoothremotegattcharacteristic"><c- n>BluetoothRemoteGATTCharacteristic</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattcharacteristic-stopnotifications"><c- g>stopNotifications</c-></a>(); }; <a data-link-type="idl-name" href="#bluetoothremotegattcharacteristic"><c- n>BluetoothRemoteGATTCharacteristic</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#characteristiceventhandlers"><c- n>CharacteristicEventHandlers</c-></a>; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <a href="#bluetoothcharacteristicproperties"><code><c- g>BluetoothCharacteristicProperties</c-></code></a> { <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-broadcast"><code><c- g>broadcast</c-></code></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-read"><code><c- g>read</c-></code></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-writewithoutresponse"><code><c- g>writeWithoutResponse</c-></code></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-write"><code><c- g>write</c-></code></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-notify"><code><c- g>notify</c-></code></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-indicate"><code><c- g>indicate</c-></code></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-authenticatedsignedwrites"><code><c- g>authenticatedSignedWrites</c-></code></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-reliablewrite"><code><c- g>reliableWrite</c-></code></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-bluetoothcharacteristicproperties-writableauxiliaries"><code><c- g>writableAuxiliaries</c-></code></a>; }; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <a href="#bluetoothremotegattdescriptor"><code><c- g>BluetoothRemoteGATTDescriptor</c-></code></a> { [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetoothremotegattcharacteristic"><c- n>BluetoothRemoteGATTCharacteristic</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BluetoothRemoteGATTCharacteristic" href="#dom-bluetoothremotegattdescriptor-characteristic"><c- g>characteristic</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#typedefdef-uuid"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="UUID" href="#dom-bluetoothremotegattdescriptor-uuid"><c- g>uuid</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor"><c- b>DataView</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DataView?" href="#dom-bluetoothremotegattdescriptor-value"><c- g>value</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://tc39.github.io/ecma262/#sec-dataview-constructor"><c- b>DataView</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattdescriptor-readvalue"><c- g>readValue</c-></a>(); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined"><c- b>undefined</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bluetoothremotegattdescriptor-writevalue"><c- g>writeValue</c-></a>(<a data-link-type="idl-name" href="https://webidl.spec.whatwg.org/#BufferSource"><c- n>BufferSource</c-></a> <a href="#dom-bluetoothremotegattdescriptor-writevalue-value-value"><code><c- g>value</c-></code></a>); }; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <c- b>mixin</c-> <a href="#characteristiceventhandlers"><code><c- g>CharacteristicEventHandlers</c-></code></a> { <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-characteristiceventhandlers-oncharacteristicvaluechanged"><c- g>oncharacteristicvaluechanged</c-></a>; }; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <c- b>mixin</c-> <a href="#bluetoothdeviceeventhandlers"><code><c- g>BluetoothDeviceEventHandlers</c-></code></a> { <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-bluetoothdeviceeventhandlers-onadvertisementreceived"><c- g>onadvertisementreceived</c-></a>; <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-bluetoothdeviceeventhandlers-ongattserverdisconnected"><c- g>ongattserverdisconnected</c-></a>; }; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>] <c- b>interface</c-> <c- b>mixin</c-> <a href="#serviceeventhandlers"><code><c- g>ServiceEventHandlers</c-></code></a> { <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-serviceeventhandlers-onserviceadded"><c- g>onserviceadded</c-></a>; <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-serviceeventhandlers-onservicechanged"><c- g>onservicechanged</c-></a>; <c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-serviceeventhandlers-onserviceremoved"><c- g>onserviceremoved</c-></a>; }; <c- b>typedef</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <a href="#typedefdef-uuid"><code><c- g>UUID</c-></code></a>; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->] <c- b>interface</c-> <a href="#bluetoothuuid"><code><c- g>BluetoothUUID</c-></code></a> { <c- b>static</c-> <a data-link-type="idl-name" href="#typedefdef-uuid"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-getservice"><c- g>getService</c-></a>((<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long"><c- b>unsigned</c-> <c- b>long</c-></a>) <a href="#dom-bluetoothuuid-getservice-name-name"><code><c- g>name</c-></code></a>); <c- b>static</c-> <a data-link-type="idl-name" href="#typedefdef-uuid"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-getcharacteristic"><c- g>getCharacteristic</c-></a>((<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long"><c- b>unsigned</c-> <c- b>long</c-></a>) <a href="#dom-bluetoothuuid-getcharacteristic-name-name"><code><c- g>name</c-></code></a>); <c- b>static</c-> <a data-link-type="idl-name" href="#typedefdef-uuid"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-getdescriptor"><c- g>getDescriptor</c-></a>((<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long"><c- b>unsigned</c-> <c- b>long</c-></a>) <a href="#dom-bluetoothuuid-getdescriptor-name-name"><code><c- g>name</c-></code></a>); <c- b>static</c-> <a data-link-type="idl-name" href="#typedefdef-uuid"><c- n>UUID</c-></a> <a class="idl-code" data-link-type="method" href="#dom-bluetoothuuid-canonicaluuid"><c- g>canonicalUUID</c-></a>([<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#EnforceRange"><c- g>EnforceRange</c-></a>] <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long"><c- b>unsigned</c-> <c- b>long</c-></a> <a href="#dom-bluetoothuuid-canonicaluuid-alias-alias"><code><c- g>alias</c-></code></a>); }; <c- b>typedef</c-> (<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long"><c- b>unsigned</c-> <c- b>long</c-></a>) <a class="idl-code" data-link-type="typedef" href="#typedefdef-bluetoothserviceuuid"><c- g>BluetoothServiceUUID</c-></a>; <c- b>typedef</c-> (<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long"><c- b>unsigned</c-> <c- b>long</c-></a>) <a class="idl-code" data-link-type="typedef" href="#typedefdef-bluetoothcharacteristicuuid"><c- g>BluetoothCharacteristicUUID</c-></a>; <c- b>typedef</c-> (<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-DOMString"><c- b>DOMString</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long"><c- b>unsigned</c-> <c- b>long</c-></a>) <a class="idl-code" data-link-type="typedef" href="#typedefdef-bluetoothdescriptoruuid"><c- g>BluetoothDescriptorUUID</c-></a>; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>] <c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator"><c- g>Navigator</c-></a> { [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#bluetooth"><c- n>Bluetooth</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Bluetooth" href="#dom-navigator-bluetooth"><c- g>bluetooth</c-></a>; }; </pre> <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2> <div style="counter-reset:issue"> <div class="issue"> See <a href="#privacy">§ 3 Privacy considerations</a> section. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/575">[Issue #575]</a> <a class="issue-return" href="#issue-965b39bd" title="Jump to section">↵</a></div> <div class="issue"> In practice, the device list is dynamically updated while a prompt is open. The spec text currently does not reflect that but this event might be emitted multiple times with the same <code>promptId</code> and the fresh device list. See https://github.com/WebBluetoothCG/web-bluetooth/issues/621. <a class="issue-return" href="#issue-65779758" title="Jump to section">↵</a></div> <div class="issue"> TODO: Nail down the amount of time. <a class="issue-return" href="#issue-2f91a41d" title="Jump to section">↵</a></div> <div class="issue"> Support asynchronous device discovery. <a class="issue-return" href="#issue-a6bf84e6" title="Jump to section">↵</a></div> <div class="issue"> Both <a data-link-type="dfn" href="#passive-scanning">passive scanning</a> and the <a data-link-type="dfn" href="#privacy-feature">Privacy Feature</a> avoid leaking the unique, immutable device ID. We ought to require UAs to use either one, but none of the OS APIs appear to expose either. Bluetooth also makes it hard to use <a data-link-type="dfn" href="#passive-scanning">passive scanning</a> since it doesn’t require <a data-link-type="dfn" href="#central">Central</a> devices to support the <a data-link-type="dfn" href="#observation-procedure">Observation Procedure</a>. <a class="issue-return" href="#issue-b71bd84d" title="Jump to section">↵</a></div> <div class="issue"> All forms of BR/EDR inquiry/discovery appear to leak the unique, immutable device address. <a class="issue-return" href="#issue-9bb159fd" title="Jump to section">↵</a></div> <div class="issue"> We need a way for a site to register to receive an event when an interesting device comes within range. <a class="issue-return" href="#issue-ad5723d8" title="Jump to section">↵</a></div> <div class="issue"> Such a generic event type belongs in <a data-link-type="biblio" href="#biblio-html" title="HTML Standard">[HTML]</a> or <a data-link-type="biblio" href="#biblio-dom" title="DOM Standard">[DOM]</a>, not here. <a class="issue-return" href="#issue-565fd2fa" title="Jump to section">↵</a></div> <div class="issue"> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror">NetworkError</a></code>, but for now sites need to serialize their use of this API and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">[Issue #188]</a> <a class="issue-return" href="#issue-f363405f" title="Jump to section">↵</a></div> <div class="issue"> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror">NetworkError</a></code>, but for now sites need to serialize their use of this API and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">[Issue #188]</a> <a class="issue-return" href="#issue-f363405f①" title="Jump to section">↵</a></div> <div class="issue"> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror">NetworkError</a></code>, but for now sites need to serialize their use of this API and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">[Issue #188]</a> <a class="issue-return" href="#issue-f363405f②" title="Jump to section">↵</a></div> <div class="issue"> This method is for backwards compatibility only. New implementations should not implement this method. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/238">[Issue #238]</a> <a class="issue-return" href="#issue-ea13fbb3" title="Jump to section">↵</a></div> <div class="issue"> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror">NetworkError</a></code>, but for now sites need to serialize their use of this API and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">[Issue #188]</a> <a class="issue-return" href="#issue-f363405f③" title="Jump to section">↵</a></div> <div class="issue"> <a data-link-type="dfn" href="#characteristic-extended-properties">Characteristic Extended Properties</a> isn’t clear whether the extended properties are immutable for a given Characteristic. If they are, the UA should be allowed to cache them. <a class="issue-return" href="#issue-997f7afd" title="Jump to section">↵</a></div> <div class="issue"> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror">NetworkError</a></code>, but for now sites need to serialize their use of this API and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">[Issue #188]</a> <a class="issue-return" href="#issue-f363405f④" title="Jump to section">↵</a></div> <div class="issue"> Implementations may be able to avoid this <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#networkerror">NetworkError</a></code>, but for now sites need to serialize their use of this API and/or give the user a way to retry failed operations. <a href="https://github.com/WebBluetoothCG/web-bluetooth/issues/188">[Issue #188]</a> <a class="issue-return" href="#issue-f363405f⑤" title="Jump to section">↵</a></div> <div class="issue"> CDDL snippetes use the "text" type instead of "browsingContext.BrowsingContext" to allow indepedent programmatic processing of CDDL snippets. Currently, other modules cannot be referenced. <a class="issue-return" href="#issue-194ad560" title="Jump to section">↵</a></div> <div class="issue"> Inserting data into variables from another algorithm is not well defined. The <a data-link-type="dfn" href="#scan-for-devices">scan for devices</a> algorithm needs to define asynchronous device discovery in order to match implementations. <a class="issue-return" href="#issue-6d693d48" title="Jump to section">↵</a></div> </div> <details class="mdn-anno unpositioned" data-anno-for="eventdef-bluetooth-availabilitychanged"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/availabilitychanged_event" title="The availabilitychanged event fires when the Bluetooth system as a whole becomes available or unavailable to the User Agent.">Bluetooth/availabilitychanged_event</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>None</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetooth-onavailabilitychanged"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/availabilitychanged_event" title="The availabilitychanged event fires when the Bluetooth system as a whole becomes available or unavailable to the User Agent.">Bluetooth/availabilitychanged_event</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>None</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetooth-getavailability"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/getAvailability" title="The getAvailability() method of the Bluetooth interface returns true if the device has a Bluetooth adapter, and false otherwise (unless the user has configured the browser to not expose a real value).">Bluetooth/getAvailability</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>78+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetooth-getdevices"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/getDevices" title="The getDevices() method of Bluetooth interface of Web Bluetooth API exposes the Bluetooth devices this origin is allowed to access. This method does not display any permission prompts.">Bluetooth/getDevices</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span title="Requires setting a user preference or runtime flag.">🔰 85+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span title="Requires setting a user preference or runtime flag.">🔰 85+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetooth-requestdevice"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/requestDevice" title="The Bluetooth.requestDevice() method of the Bluetooth interface returns a Promise to a BluetoothDevice object with the specified options. If there is no chooser UI, this method returns the first device matching the criteria.">Bluetooth/requestDevice</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="bluetooth"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth" title="The Bluetooth interface of the Web Bluetooth API returns a Promise to a BluetoothDevice object with the specified options.">Bluetooth</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>None</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android yes"><span>Chrome for Android</span><span>56+</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothcharacteristicproperties-authenticatedsignedwrites"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/authenticatedSignedWrites" title="The authenticatedSignedWrites read-only property of the BluetoothCharacteristicProperties interface returns a boolean that is true if signed writing to the characteristic value is permitted.">BluetoothCharacteristicProperties/authenticatedSignedWrites</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothcharacteristicproperties-broadcast"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/broadcast" title="The broadcast read-only property of the BluetoothCharacteristicProperties interface returns a boolean that is true if the broadcast of the characteristic value is permitted using the Server Characteristic Configuration Descriptor.">BluetoothCharacteristicProperties/broadcast</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothcharacteristicproperties-indicate"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/indicate" title="The indicate read-only property of the BluetoothCharacteristicProperties interface returns a boolean that is true if indications of the characteristic value with acknowledgement is permitted.">BluetoothCharacteristicProperties/indicate</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothcharacteristicproperties-notify"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/notify" title="The notify read-only property of the BluetoothCharacteristicProperties interface returns a boolean that is true if notifications of the characteristic value without acknowledgement is permitted.">BluetoothCharacteristicProperties/notify</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothcharacteristicproperties-read"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/read" title="The read read-only property of the BluetoothCharacteristicProperties interface returns a boolean that is true if the reading of the characteristic value is permitted.">BluetoothCharacteristicProperties/read</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothcharacteristicproperties-reliablewrite"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/reliableWrite" title="The reliableWrite read-only property of the BluetoothCharacteristicProperties interface returns a boolean that is true if reliable writes to the characteristic is permitted.">BluetoothCharacteristicProperties/reliableWrite</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothcharacteristicproperties-writableauxiliaries"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/writableAuxiliaries" title="The writableAuxiliaries read-only property of the BluetoothCharacteristicProperties interface returns a boolean that is true if reliable writes to the characteristic descriptor is permitted.">BluetoothCharacteristicProperties/writableAuxiliaries</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothcharacteristicproperties-write"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/write" title="The write read-only property of the BluetoothCharacteristicProperties interface returns a boolean that is true if the writing to the characteristic with response is permitted.">BluetoothCharacteristicProperties/write</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothcharacteristicproperties-writewithoutresponse"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/writeWithoutResponse" title="The writeWithoutResponse read-only property of the BluetoothCharacteristicProperties interface returns a boolean that is true if the writing to the characteristic without response is permitted.">BluetoothCharacteristicProperties/writeWithoutResponse</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="characteristicproperties-interface"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties" title="The BluetoothCharacteristicProperties interface of the Web Bluetooth API provides the operations that are valid on the given BluetoothRemoteGATTCharacteristic.">BluetoothCharacteristicProperties</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>None</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android yes"><span>Chrome for Android</span><span>56+</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothdevice-gatt"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/gatt" title="The BluetoothDevice.gatt read-only property returns a reference to the device&apos;s BluetoothRemoteGATTServer.">BluetoothDevice/gatt</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothdevice-id"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/id" title="The BluetoothDevice.id read-only property returns a string that uniquely identifies a device.">BluetoothDevice/id</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothdevice-name"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/name" title="The BluetoothDevice.name read-only property returns a string that provides a human-readable name for the device.">BluetoothDevice/name</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="bluetoothdevice-interface"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice" title="The BluetoothDevice interface of the Web Bluetooth API represents a Bluetooth device inside a particular script execution environment.">BluetoothDevice</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>None</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android yes"><span>Chrome for Android</span><span>56+</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattcharacteristic-getdescriptor"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/getDescriptor" title="The BluetoothRemoteGATTCharacteristic.getDescriptor() method returns a Promise that resolves to the first BluetoothRemoteGATTDescriptor for a given descriptor UUID.">BluetoothRemoteGATTCharacteristic/getDescriptor</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>57+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattcharacteristic-getdescriptors"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/getDescriptors" title="The BluetoothRemoteGATTCharacteristic.getDescriptors() method returns a Promise that resolves to an Array of all BluetoothRemoteGATTDescriptor objects for a given descriptor UUID.">BluetoothRemoteGATTCharacteristic/getDescriptors</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>57+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattcharacteristic-properties"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/properties" title="The BluetoothRemoteGATTCharacteristic.properties read-only property returns a BluetoothCharacteristicProperties instance containing the properties of this characteristic.">BluetoothRemoteGATTCharacteristic/properties</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattcharacteristic-readvalue"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/readValue" title="The BluetoothRemoteGATTCharacteristic.readValue() method returns a Promise that resolves to a DataView holding a duplicate of the value property if it is available and supported. Otherwise it throws an error.">BluetoothRemoteGATTCharacteristic/readValue</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattcharacteristic-service"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/service" title="The BluetoothRemoteGATTCharacteristic.service read-only property returns the BluetoothRemoteGATTService this characteristic belongs to.">BluetoothRemoteGATTCharacteristic/service</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattcharacteristic-startnotifications"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/startNotifications" title="The BluetoothRemoteGATTCharacteristic.startNotifications() method returns a Promise to the BluetoothRemoteGATTCharacteristic instance when there is an active notification on it.">BluetoothRemoteGATTCharacteristic/startNotifications</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattcharacteristic-stopnotifications"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/stopNotifications" title="The BluetoothRemoteGATTCharacteristic.stopNotifications() method returns a Promise to the BluetoothRemoteGATTCharacteristic instance when there is no longer an active notification on it.">BluetoothRemoteGATTCharacteristic/stopNotifications</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattcharacteristic-uuid"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/uuid" title="The BluetoothRemoteGATTCharacteristic.uuid read-only property returns a string containing the UUID of the characteristic, for example &apos;00002a37-0000-1000-8000-00805f9b34fb&apos; for the Heart Rate Measurement characteristic.">BluetoothRemoteGATTCharacteristic/uuid</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattcharacteristic-value"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/value" title="The BluetoothRemoteGATTCharacteristic.value read-only property returns currently cached characteristic value. This value gets updated when the value of the characteristic is read or updated via a notification or indication.">BluetoothRemoteGATTCharacteristic/value</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValueWithoutResponse" title="The BluetoothRemoteGATTCharacteristic.writeValueWithoutResponse() method sets a BluetoothRemoteGATTCharacteristic object&apos;s value property to the bytes contained in a given ArrayBuffer, calls WriteCharacteristicValue(this=this, value=value, response=&quot;never&quot;), and returns the resulting Promise.">BluetoothRemoteGATTCharacteristic/writeValueWithoutResponse</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>85+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>85+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattcharacteristic-writevaluewithresponse"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValueWithResponse" title="The BluetoothRemoteGATTCharacteristic.writeValueWithResponse() method sets a BluetoothRemoteGATTCharacteristic object&apos;s value property to the bytes contained in a given ArrayBuffer, calls WriteCharacteristicValue(this=this, value=value, response=&quot;required&quot;), and returns the resulting Promise.">BluetoothRemoteGATTCharacteristic/writeValueWithResponse</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>85+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>85+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="bluetoothgattcharacteristic-interface"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic" title="The BluetoothRemoteGattCharacteristic interface of the Web Bluetooth API represents a GATT Characteristic, which is a basic data element that provides further information about a peripheral&apos;s service.">BluetoothRemoteGATTCharacteristic</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>None</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android yes"><span>Chrome for Android</span><span>56+</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattdescriptor-characteristic"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor/characteristic" title="The BluetoothRemoteGATTDescriptor.characteristic read-only property returns the BluetoothRemoteGATTCharacteristic this descriptor belongs to.">BluetoothRemoteGATTDescriptor/characteristic</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>57+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>44+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattdescriptor-readvalue"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor/readValue" title="The BluetoothRemoteGATTDescriptor.readValue() method returns a Promise that resolves to an ArrayBuffer holding a duplicate of the value property if it is available and supported. Otherwise it throws an error.">BluetoothRemoteGATTDescriptor/readValue</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>57+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>44+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattdescriptor-uuid"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor/uuid" title="The BluetoothRemoteGATTDescriptor.uuid read-only property returns the UUID of the characteristic descriptor. For example &apos;00002902-0000-1000-8000-00805f9b34fb&apos; for theClient Characteristic Configuration descriptor.">BluetoothRemoteGATTDescriptor/uuid</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>57+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>44+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattdescriptor-value"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor/value" title="The BluetoothRemoteGATTDescriptor.value read-only property returns an ArrayBuffer containing the currently cached descriptor value. This value gets updated when the value of the descriptor is read.">BluetoothRemoteGATTDescriptor/value</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>57+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>44+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattdescriptor-writevalue"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor/writeValue" title="The BluetoothRemoteGATTDescriptor.writeValue() method sets the value property to the bytes contained in an ArrayBuffer and returns a Promise.">BluetoothRemoteGATTDescriptor/writeValue</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>57+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>44+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="bluetoothgattdescriptor-interface"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor" title="The BluetoothRemoteGATTDescriptor interface of the Web Bluetooth API provides a GATT Descriptor, which provides further information about a characteristic&apos;s value.">BluetoothRemoteGATTDescriptor</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>57+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>None</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android yes"><span>Chrome for Android</span><span>57+</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>44+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattserver-connect"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/connect" title="The BluetoothRemoteGATTServer.connect() method causes the script execution environment to connect to this.device.">BluetoothRemoteGATTServer/connect</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattserver-connected"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/connected" title="The BluetoothRemoteGATTServer.connected read-only property returns a boolean value that returns true while this script execution environment is connected to this.device. It can be false while the user agent is physically connected.">BluetoothRemoteGATTServer/connected</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattserver-device"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/device" title="The BluetoothRemoteGATTServer.device read-only property returns a reference to the BluetoothDevice running the server.">BluetoothRemoteGATTServer/device</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattserver-disconnect"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/disconnect" title="The BluetoothRemoteGATTServer.disconnect() method causes the script execution environment to disconnect from this.device.">BluetoothRemoteGATTServer/disconnect</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattserver-getprimaryservice"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/getPrimaryService" title="The BluetoothRemoteGATTServer.getPrimaryService() method returns a promise to the primary BluetoothRemoteGATTService offered by the Bluetooth device for a specified bluetooth service UUID.">BluetoothRemoteGATTServer/getPrimaryService</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattserver-getprimaryservices"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/getPrimaryServices" title="The BluetoothRemoteGATTServer.getPrimaryServices() method returns a promise to a list of primary BluetoothRemoteGATTService objects offered by the Bluetooth device for a specified BluetoothServiceUUID.">BluetoothRemoteGATTServer/getPrimaryServices</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="bluetoothgattremoteserver-interface"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer" title="The BluetoothRemoteGATTServer interface of the Web Bluetooth API represents a GATT Server on a remote device.">BluetoothRemoteGATTServer</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>None</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android yes"><span>Chrome for Android</span><span>56+</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattservice-device"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/device" title="The BluetoothGATTService.device read-only property returns information about a Bluetooth device through an instance of BluetoothDevice.">BluetoothRemoteGATTService/device</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattservice-getcharacteristic"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/getCharacteristic" title="The BluetoothGATTService.getCharacteristic() method returns a Promise to an instance of BluetoothRemoteGATTCharacteristic for a given universally unique identifier (UUID).">BluetoothRemoteGATTService/getCharacteristic</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattservice-getcharacteristics"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/getCharacteristics" title="The BluetoothGATTService.getCharacteristics() method returns a Promise to a list of BluetoothRemoteGATTCharacteristic instances for a given universally unique identifier (UUID).">BluetoothRemoteGATTService/getCharacteristics</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattservice-isprimary"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/isPrimary" title="The BluetoothGATTService.isPrimary read-only property returns a boolean value that indicates whether this is a primary service. If it is not a primary service, it is a secondary service.">BluetoothRemoteGATTService/isPrimary</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothremotegattservice-uuid"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/uuid" title="The BluetoothGATTService.uuid read-only property returns a string representing the UUID of this service.">BluetoothRemoteGATTService/uuid</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="bluetoothgattservice-interface"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService" title="The BluetoothRemoteGATTService interface of the Web Bluetooth API represents a service provided by a GATT server, including a device, a list of referenced services, and a list of the characteristics of this service.">BluetoothRemoteGATTService</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>None</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android yes"><span>Chrome for Android</span><span>56+</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothuuid-canonicaluuid"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/canonicalUUID_static" title="The canonicalUUID() static method of the BluetoothUUID interface returns the 128-bit UUID when passed a 16- or 32-bit UUID alias.">BluetoothUUID/canonicalUUID_static</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothuuid-getcharacteristic"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getCharacteristic_static" title="The getCharacteristic() static method of the BluetoothUUID interface returns a UUID representing a registered characteristic when passed a name or the 16- or 32-bit UUID alias.">BluetoothUUID/getCharacteristic_static</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothuuid-getdescriptor"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getDescriptor_static" title="The getDescriptor() static method of the BluetoothUUID interface returns a UUID representing a registered descriptor when passed a name or the 16- or 32-bit UUID alias.">BluetoothUUID/getDescriptor_static</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-bluetoothuuid-getservice"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getService_static" title="The getService() static method of the BluetoothUUID interface returns a UUID representing a registered service when passed a name or the 16- or 32-bit UUID alias.">BluetoothUUID/getService_static</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="bluetoothuuid"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID" title="The BluetoothUUID interface of the Web Bluetooth API provides a way to look up Universally Unique Identifier (UUID) values by name in the registry maintained by the Bluetooth SIG.">BluetoothUUID</a></p> <p class="less-than-two-engines-text">In only one current engine.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>None</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>56+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>None</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android yes"><span>Chrome for Android</span><span>56+</span></span><span class="webview_android no"><span>Android WebView</span><span>None</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <script>/* Boilerplate: script-dfn-panel */ "use strict"; { const dfnsJson = window.dfnsJson || {}; function genDfnPanel({dfnID, url, dfnText, refSections, external}) { return mk.aside({ class: "dfn-panel", id: `infopanel-for-${dfnID}`, "data-for": dfnID, "aria-labelled-by":`infopaneltitle-for-${dfnID}`, }, mk.span({id:`infopaneltitle-for-${dfnID}`, style:"display:none"}, `Info about the '${dfnText}' ${external?"external":""} reference.`), mk.a({href:url}, url), mk.b({}, "Referenced in:"), mk.ul({}, ...refSections.map(section=> mk.li({}, ...section.refs.map((ref, refI)=> [ mk.a({ href: `#${ref.id}` }, (refI == 0) ? section.title : `(${refI + 1})` ), " ", ] ), ), ), ), ); } function genAllDfnPanels() { for(const panelData of Object.values(window.dfnpanelData)) { const dfnID = panelData.dfnID; const dfn = document.getElementById(dfnID); if(!dfn) { console.log(`Can't find dfn#${dfnID}.`, panelData); } else { const panel = genDfnPanel(panelData); append(document.body, panel); insertDfnPopupAction(dfn, panel) } } } document.addEventListener("DOMContentLoaded", ()=>{ genAllDfnPanels(); // Add popup behavior to all dfns to show the corresponding dfn-panel. var dfns = queryAll('.dfn-paneled'); for(let dfn of dfns) { ; } document.body.addEventListener("click", (e) => { // If not handled already, just hide all dfn panels. hideAllDfnPanels(); }); }) function hideAllDfnPanels() { // Turn off any currently "on" or "activated" panels. queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(el=>hideDfnPanel(el)); } function showDfnPanel(dfnPanel, dfn) { hideAllDfnPanels(); // Only display one at this time. dfn.setAttribute("aria-expanded", "true"); dfnPanel.classList.add("on"); dfnPanel.style.left = "5px"; dfnPanel.style.top = "0px"; const panelRect = dfnPanel.getBoundingClientRect(); const panelWidth = panelRect.right - panelRect.left; if (panelRect.right > document.body.scrollWidth) { // Panel's overflowing the screen. // Just drop it below the dfn and flip it rightward instead. // This still wont' fix things if the screen is *really* wide, // but fixing that's a lot harder without 'anchor()'. dfnPanel.style.top = "1.5em"; dfnPanel.style.left = "auto"; dfnPanel.style.right = "0px"; } } function pinDfnPanel(dfnPanel) { // Switch it to "activated" state, which pins it. dfnPanel.classList.add("activated"); dfnPanel.style.left = null; dfnPanel.style.top = null; } function hideDfnPanel(dfnPanel, dfn) { if(!dfn) { dfn = document.getElementById(dfnPanel.getAttribute("data-for")); } dfn.setAttribute("aria-expanded", "false") dfnPanel.classList.remove("on"); dfnPanel.classList.remove("activated"); } function toggleDfnPanel(dfnPanel, dfn) { if(dfnPanel.classList.contains("on")) { hideDfnPanel(dfnPanel, dfn); } else { showDfnPanel(dfnPanel, dfn); } } function insertDfnPopupAction(dfn, dfnPanel) { // Find dfn panel const panelWrapper = document.createElement('span'); panelWrapper.appendChild(dfnPanel); panelWrapper.style.position = "relative"; panelWrapper.style.height = "0px"; dfn.insertAdjacentElement("afterend", panelWrapper); dfn.setAttribute('role', 'button'); dfn.setAttribute('aria-expanded', 'false') dfn.tabIndex = 0; dfn.classList.add('has-dfn-panel'); dfn.addEventListener('click', (event) => { showDfnPanel(dfnPanel, dfn); event.stopPropagation(); }); dfn.addEventListener('keypress', (event) => { const kc = event.keyCode; // 32->Space, 13->Enter if(kc == 32 || kc == 13) { toggleDfnPanel(dfnPanel, dfn); event.stopPropagation(); event.preventDefault(); } }); dfnPanel.addEventListener('click', (event) => { if (event.target.nodeName == 'A') { pinDfnPanel(dfnPanel); } event.stopPropagation(); }); dfnPanel.addEventListener('keydown', (event) => { if(event.keyCode == 27) { // Escape key hideDfnPanel(dfnPanel, dfn); event.stopPropagation(); event.preventDefault(); } }) } } </script> <script>/* Boilerplate: script-dfn-panel */ "use strict"; { const dfnsJson = window.dfnsJson || {}; function genDfnPanel({dfnID, url, dfnText, refSections, external}) { return mk.aside({ class: "dfn-panel", id: `infopanel-for-${dfnID}`, "data-for": dfnID, "aria-labelled-by":`infopaneltitle-for-${dfnID}`, }, mk.span({id:`infopaneltitle-for-${dfnID}`, style:"display:none"}, `Info about the '${dfnText}' ${external?"external":""} reference.`), mk.a({href:url}, url), mk.b({}, "Referenced in:"), mk.ul({}, ...refSections.map(section=> mk.li({}, ...section.refs.map((ref, refI)=> [ mk.a({ href: `#${ref.id}` }, (refI == 0) ? section.title : `(${refI + 1})` ), " ", ] ), ), ), ), ); } function genAllDfnPanels() { for(const panelData of Object.values(window.dfnpanelData)) { const dfnID = panelData.dfnID; const dfn = document.getElementById(dfnID); if(!dfn) { console.log(`Can't find dfn#${dfnID}.`, panelData); } else { const panel = genDfnPanel(panelData); append(document.body, panel); insertDfnPopupAction(dfn, panel) } } } document.addEventListener("DOMContentLoaded", ()=>{ genAllDfnPanels(); // Add popup behavior to all dfns to show the corresponding dfn-panel. var dfns = queryAll('.dfn-paneled'); for(let dfn of dfns) { ; } document.body.addEventListener("click", (e) => { // If not handled already, just hide all dfn panels. hideAllDfnPanels(); }); }) function hideAllDfnPanels() { // Turn off any currently "on" or "activated" panels. queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(el=>hideDfnPanel(el)); } function showDfnPanel(dfnPanel, dfn) { hideAllDfnPanels(); // Only display one at this time. dfn.setAttribute("aria-expanded", "true"); dfnPanel.classList.add("on"); dfnPanel.style.left = "5px"; dfnPanel.style.top = "0px"; const panelRect = dfnPanel.getBoundingClientRect(); const panelWidth = panelRect.right - panelRect.left; if (panelRect.right > document.body.scrollWidth) { // Panel's overflowing the screen. // Just drop it below the dfn and flip it rightward instead. // This still wont' fix things if the screen is *really* wide, // but fixing that's a lot harder without 'anchor()'. dfnPanel.style.top = "1.5em"; dfnPanel.style.left = "auto"; dfnPanel.style.right = "0px"; } } function pinDfnPanel(dfnPanel) { // Switch it to "activated" state, which pins it. dfnPanel.classList.add("activated"); dfnPanel.style.left = null; dfnPanel.style.top = null; } function hideDfnPanel(dfnPanel, dfn) { if(!dfn) { dfn = document.getElementById(dfnPanel.getAttribute("data-for")); } dfn.setAttribute("aria-expanded", "false") dfnPanel.classList.remove("on"); dfnPanel.classList.remove("activated"); } function toggleDfnPanel(dfnPanel, dfn) { if(dfnPanel.classList.contains("on")) { hideDfnPanel(dfnPanel, dfn); } else { showDfnPanel(dfnPanel, dfn); } } function insertDfnPopupAction(dfn, dfnPanel) { // Find dfn panel const panelWrapper = document.createElement('span'); panelWrapper.appendChild(dfnPanel); panelWrapper.style.position = "relative"; panelWrapper.style.height = "0px"; dfn.insertAdjacentElement("afterend", panelWrapper); dfn.setAttribute('role', 'button'); dfn.setAttribute('aria-expanded', 'false') dfn.tabIndex = 0; dfn.classList.add('has-dfn-panel'); dfn.addEventListener('click', (event) => { showDfnPanel(dfnPanel, dfn); event.stopPropagation(); }); dfn.addEventListener('keypress', (event) => { const kc = event.keyCode; // 32->Space, 13->Enter if(kc == 32 || kc == 13) { toggleDfnPanel(dfnPanel, dfn); event.stopPropagation(); event.preventDefault(); } }); dfnPanel.addEventListener('click', (event) => { if (event.target.nodeName == 'A') { pinDfnPanel(dfnPanel); } event.stopPropagation(); }); dfnPanel.addEventListener('keydown', (event) => { if(event.keyCode == 27) { // Escape key hideDfnPanel(dfnPanel, dfn); event.stopPropagation(); event.preventDefault(); } }) } } </script> <script>/* Boilerplate: script-dfn-panel-json */ window.dfnpanelData = {}; window.dfnpanelData['ebe1c949'] = {"dfnID": "ebe1c949", "url": "https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=body_sensor_location", "dfnText": "body_sensor_location", "refSections": [{"refs": [{"id": "ref-for-:~:text=body_sensor_location"}], "title": "1.1. Examples"}], "external": true}; window.dfnpanelData['ddcccb57'] = {"dfnID": "ddcccb57", "url": "https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_services.txt#:~:text=cycling_power", "dfnText": "cycling_power", "refSections": [{"refs": [{"id": "ref-for-:~:text=cycling_power"}], "title": "7.1. Standardized UUIDs"}], "external": true}; window.dfnpanelData['faaed345'] = {"dfnID": "faaed345", "url": "https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=gap.appearance", "dfnText": "gap.appearance", "refSections": [{"refs": [{"id": "ref-for-:~:text=gap.appearance"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-:~:text=gap.appearance\u2460"}], "title": "12.2.1.4. The bluetooth.ScanRecord Type"}], "external": true}; window.dfnpanelData['cdd7910f'] = {"dfnID": "cdd7910f", "url": "https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_descriptors.txt#:~:text=gatt.characteristic_presentation_format", "dfnText": "gatt.characteristic_presentation_format", "refSections": [{"refs": [{"id": "ref-for-:~:text=gatt.characteristic_presentation_format"}], "title": "7.1. Standardized UUIDs"}], "external": true}; window.dfnpanelData['4186adc1'] = {"dfnID": "4186adc1", "url": "https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_descriptors.txt#:~:text=gatt.client_characteristic_configuration", "dfnText": "gatt.client_characteristic_configuration", "refSections": [{"refs": [{"id": "ref-for-:~:text=gatt.client_characteristic_configuration"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": true}; window.dfnpanelData['04e37f16'] = {"dfnID": "04e37f16", "url": "https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_services.txt#:~:text=heart_rate", "dfnText": "heart_rate", "refSections": [{"refs": [{"id": "ref-for-:~:text=heart_rate"}], "title": "1.1. Examples"}, {"refs": [{"id": "ref-for-:~:text=heart_rate\u2460"}], "title": "6.3. BluetoothRemoteGATTService"}], "external": true}; window.dfnpanelData['c0a36310'] = {"dfnID": "c0a36310", "url": "https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=heart_rate_control_point", "dfnText": "heart_rate_control_point", "refSections": [{"refs": [{"id": "ref-for-:~:text=heart_rate_control_point"}, {"id": "ref-for-:~:text=heart_rate_control_point\u2460"}], "title": "1.1. Examples"}], "external": true}; window.dfnpanelData['074dc840'] = {"dfnID": "074dc840", "url": "https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=heart_rate_measurement", "dfnText": "heart_rate_measurement", "refSections": [{"refs": [{"id": "ref-for-:~:text=heart_rate_measurement"}, {"id": "ref-for-:~:text=heart_rate_measurement\u2460"}], "title": "1.1. Examples"}, {"refs": [{"id": "ref-for-:~:text=heart_rate_measurement\u2461"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": true}; window.dfnpanelData['25b9cf35'] = {"dfnID": "25b9cf35", "url": "https://github.com/WebBluetoothCG/registries/blob/master/gatt_assigned_characteristics.txt#:~:text=ieee_11073-20601_regulatory_certification_data_list", "dfnText": "ieee_11073-20601_regulatory_certification_data_list", "refSections": [{"refs": [{"id": "ref-for-:~:text=ieee_11073-20601_regulatory_certification_data_list"}], "title": "7.1. Standardized UUIDs"}], "external": true}; window.dfnpanelData['317eda45'] = {"dfnID": "317eda45", "url": "https://www.bluetooth.com/specifications/assigned-numbers/#:~:text=Generic%20Access%20Profile", "dfnText": "shortened local name", "refSections": [{"refs": [{"id": "ref-for-:~:text=Generic%20Access%20Profile"}], "title": "5.1. Global Bluetooth device properties"}], "external": true}; window.dfnpanelData['2e66eaf1'] = {"dfnID": "2e66eaf1", "url": "https://dom.spec.whatwg.org/#abortcontroller", "dfnText": "AbortController", "refSections": [{"refs": [{"id": "ref-for-abortcontroller"}], "title": "5.2. BluetoothDevice"}], "external": true}; window.dfnpanelData['cca3cdb2'] = {"dfnID": "cca3cdb2", "url": "https://dom.spec.whatwg.org/#abortsignal", "dfnText": "AbortSignal", "refSections": [{"refs": [{"id": "ref-for-abortsignal"}, {"id": "ref-for-abortsignal\u2460"}, {"id": "ref-for-abortsignal\u2461"}, {"id": "ref-for-abortsignal\u2462"}], "title": "5.2. BluetoothDevice"}], "external": true}; window.dfnpanelData['129bdae8'] = {"dfnID": "129bdae8", "url": "https://dom.spec.whatwg.org/#event", "dfnText": "Event", "refSections": [{"refs": [{"id": "ref-for-event"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-event\u2460"}], "title": "5.2.3. Responding to Advertising Events"}], "external": true}; window.dfnpanelData['44a7708c'] = {"dfnID": "44a7708c", "url": "https://dom.spec.whatwg.org/#dictdef-eventinit", "dfnText": "EventInit", "refSections": [{"refs": [{"id": "ref-for-dictdef-eventinit"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-dictdef-eventinit\u2460"}], "title": "5.2.3. Responding to Advertising Events"}], "external": true}; window.dfnpanelData['2bc0cdf4'] = {"dfnID": "2bc0cdf4", "url": "https://dom.spec.whatwg.org/#eventtarget", "dfnText": "EventTarget", "refSections": [{"refs": [{"id": "ref-for-eventtarget"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-eventtarget\u2460"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-eventtarget\u2461"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-eventtarget\u2462"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": true}; window.dfnpanelData['535dd335'] = {"dfnID": "535dd335", "url": "https://dom.spec.whatwg.org/#abortsignal-aborted", "dfnText": "aborted", "refSections": [{"refs": [{"id": "ref-for-abortsignal-aborted"}], "title": "5.2. BluetoothDevice"}], "external": true}; window.dfnpanelData['87bc23a5'] = {"dfnID": "87bc23a5", "url": "https://dom.spec.whatwg.org/#abortsignal-add", "dfnText": "add", "refSections": [{"refs": [{"id": "ref-for-abortsignal-add"}], "title": "5.2. BluetoothDevice"}], "external": true}; window.dfnpanelData['0c0ceb78'] = {"dfnID": "0c0ceb78", "url": "https://dom.spec.whatwg.org/#dom-event-bubbles", "dfnText": "bubbles", "refSections": [{"refs": [{"id": "ref-for-dom-event-bubbles"}], "title": "6.6.3. Responding to Disconnection"}], "external": true}; window.dfnpanelData['92b2d7da'] = {"dfnID": "92b2d7da", "url": "https://dom.spec.whatwg.org/#concept-tree-child", "dfnText": "children", "refSections": [{"refs": [{"id": "ref-for-concept-tree-child"}, {"id": "ref-for-concept-tree-child\u2460"}, {"id": "ref-for-concept-tree-child\u2461"}, {"id": "ref-for-concept-tree-child\u2462"}], "title": "6.6.1. Bluetooth Tree"}], "external": true}; window.dfnpanelData['a973e0fe'] = {"dfnID": "a973e0fe", "url": "https://dom.spec.whatwg.org/#concept-document", "dfnText": "document", "refSections": [{"refs": [{"id": "ref-for-concept-document"}, {"id": "ref-for-concept-document\u2460"}], "title": "5.2.1. Handling Visibility Change"}, {"refs": [{"id": "ref-for-concept-document\u2461"}, {"id": "ref-for-concept-document\u2462"}], "title": "5.2.2. Handling Document Loss of Full Activity"}], "external": true}; window.dfnpanelData['5fd23811'] = {"dfnID": "5fd23811", "url": "https://dom.spec.whatwg.org/#concept-event-fire", "dfnText": "fire an event", "refSections": [{"refs": [{"id": "ref-for-concept-event-fire"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-concept-event-fire\u2460"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-concept-event-fire\u2461"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-concept-event-fire\u2462"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-concept-event-fire\u2463"}], "title": "6.6.4. Responding to Notifications and Indications"}, {"refs": [{"id": "ref-for-concept-event-fire\u2464"}, {"id": "ref-for-concept-event-fire\u2465"}, {"id": "ref-for-concept-event-fire\u2466"}], "title": "6.6.5. Responding to Service Changes"}], "external": true}; window.dfnpanelData['838900a7'] = {"dfnID": "838900a7", "url": "https://dom.spec.whatwg.org/#dom-event-istrusted", "dfnText": "isTrusted", "refSections": [{"refs": [{"id": "ref-for-dom-event-istrusted"}], "title": "5.2.3. Responding to Advertising Events"}], "external": true}; window.dfnpanelData['ea3f6646'] = {"dfnID": "ea3f6646", "url": "https://dom.spec.whatwg.org/#concept-tree-participate", "dfnText": "participate in a tree", "refSections": [{"refs": [{"id": "ref-for-concept-tree-participate"}], "title": "6.6.1. Bluetooth Tree"}], "external": true}; window.dfnpanelData['134c93cc'] = {"dfnID": "134c93cc", "url": "https://tc39.github.io/ecma262/#sec-array-objects", "dfnText": "Array", "refSections": [{"refs": [{"id": "ref-for-sec-array-objects"}, {"id": "ref-for-sec-array-objects\u2460"}, {"id": "ref-for-sec-array-objects\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-sec-array-objects\u2462"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['a1d620f3'] = {"dfnID": "a1d620f3", "url": "https://tc39.github.io/ecma262/#sec-array.prototype.map", "dfnText": "Array.prototype.map", "refSections": [{"refs": [{"id": "ref-for-sec-array.prototype.map"}, {"id": "ref-for-sec-array.prototype.map\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-sec-array.prototype.map\u2461"}, {"id": "ref-for-sec-array.prototype.map\u2462"}], "title": "13. Terminology and Conventions"}], "external": true}; window.dfnpanelData['e6d90a77'] = {"dfnID": "e6d90a77", "url": "https://tc39.github.io/ecma262/#sec-arraybuffer-constructor", "dfnText": "ArrayBuffer", "refSections": [{"refs": [{"id": "ref-for-sec-arraybuffer-constructor"}, {"id": "ref-for-sec-arraybuffer-constructor\u2460"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-sec-arraybuffer-constructor\u2461"}, {"id": "ref-for-sec-arraybuffer-constructor\u2462"}, {"id": "ref-for-sec-arraybuffer-constructor\u2463"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-sec-arraybuffer-constructor\u2464"}, {"id": "ref-for-sec-arraybuffer-constructor\u2465"}, {"id": "ref-for-sec-arraybuffer-constructor\u2466"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-sec-arraybuffer-constructor\u2467"}], "title": "6.6.4. Responding to Notifications and Indications"}, {"refs": [{"id": "ref-for-sec-arraybuffer-constructor\u2468"}, {"id": "ref-for-sec-arraybuffer-constructor\u2460\u24ea"}], "title": "13. Terminology and Conventions"}], "external": true}; window.dfnpanelData['71aace1c'] = {"dfnID": "71aace1c", "url": "https://tc39.github.io/ecma262/#sec-dataview-constructor", "dfnText": "DataView", "refSections": [{"refs": [{"id": "ref-for-sec-dataview-constructor"}], "title": "1.1. Examples"}, {"refs": [{"id": "ref-for-sec-dataview-constructor\u2460"}, {"id": "ref-for-sec-dataview-constructor\u2461"}, {"id": "ref-for-sec-dataview-constructor\u2462"}, {"id": "ref-for-sec-dataview-constructor\u2463"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-sec-dataview-constructor\u2464"}], "title": "5.2.3.1. BluetoothManufacturerDataMap"}, {"refs": [{"id": "ref-for-sec-dataview-constructor\u2465"}], "title": "5.2.3.2. BluetoothServiceDataMap"}, {"refs": [{"id": "ref-for-sec-dataview-constructor\u2466"}, {"id": "ref-for-sec-dataview-constructor\u2467"}, {"id": "ref-for-sec-dataview-constructor\u2468"}, {"id": "ref-for-sec-dataview-constructor\u2460\u24ea"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-sec-dataview-constructor\u2460\u2460"}, {"id": "ref-for-sec-dataview-constructor\u2460\u2461"}, {"id": "ref-for-sec-dataview-constructor\u2460\u2462"}, {"id": "ref-for-sec-dataview-constructor\u2460\u2463"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-sec-dataview-constructor\u2460\u2464"}], "title": "6.6.4. Responding to Notifications and Indications"}, {"refs": [{"id": "ref-for-sec-dataview-constructor\u2460\u2465"}], "title": "13. Terminology and Conventions"}], "external": true}; window.dfnpanelData['724da416'] = {"dfnID": "724da416", "url": "https://tc39.github.io/ecma262/#sec-promise-objects", "dfnText": "Promise", "refSections": [{"refs": [{"id": "ref-for-sec-promise-objects"}], "title": "3.5. Exposing Bluetooth availability"}, {"refs": [{"id": "ref-for-sec-promise-objects\u2460"}, {"id": "ref-for-sec-promise-objects\u2461"}, {"id": "ref-for-sec-promise-objects\u2462"}, {"id": "ref-for-sec-promise-objects\u2463"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-sec-promise-objects\u2464"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-sec-promise-objects\u2465"}, {"id": "ref-for-sec-promise-objects\u2466"}, {"id": "ref-for-sec-promise-objects\u2467"}, {"id": "ref-for-sec-promise-objects\u2468"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": true}; window.dfnpanelData['7716447b'] = {"dfnID": "7716447b", "url": "https://tc39.es/ecma262/multipage/text-processing.html#sec-regexp-regular-expression-objects", "dfnText": "RegExp", "refSections": [{"refs": [{"id": "ref-for-sec-regexp-regular-expression-objects"}], "title": "9. The Blocklist"}], "external": true}; window.dfnpanelData['4b12cf9e'] = {"dfnID": "4b12cf9e", "url": "https://tc39.github.io/ecma262/#sec-set-objects", "dfnText": "Set", "refSections": [{"refs": [{"id": "ref-for-sec-set-objects"}, {"id": "ref-for-sec-set-objects\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-sec-set-objects\u2461"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": true}; window.dfnpanelData['58788f9d'] = {"dfnID": "58788f9d", "url": "https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror", "dfnText": "TypeError", "refSections": [{"refs": [{"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2460"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2461"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2462"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2463"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2464"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2465"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2466"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2467"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2468"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2460\u24ea"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2460\u2460"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2460\u2461"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2460\u2462"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2460\u2463"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2460\u2464"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2460\u2465"}, {"id": "ref-for-sec-native-error-types-used-in-this-standard-typeerror\u2460\u2466"}], "title": "7.1. Standardized UUIDs"}], "external": true}; window.dfnpanelData['0c99fb90'] = {"dfnID": "0c99fb90", "url": "https://tc39.github.io/ecma262/#sec-typedarray-constructors", "dfnText": "TypedArray", "refSections": [{"refs": [{"id": "ref-for-sec-typedarray-constructors"}], "title": "13. Terminology and Conventions"}], "external": true}; window.dfnpanelData['b107f911'] = {"dfnID": "b107f911", "url": "https://tc39.github.io/ecma262/#current-realm", "dfnText": "current realm", "refSections": [{"refs": [{"id": "ref-for-current-realm"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['1bd9bfdc'] = {"dfnID": "1bd9bfdc", "url": "https://tc39.es/ecma262/multipage/text-processing.html#sec-regexp.prototype.exec", "dfnText": "exec(string)", "refSections": [{"refs": [{"id": "ref-for-sec-regexp.prototype.exec"}], "title": "9. The Blocklist"}], "external": true}; window.dfnpanelData['c15f1628'] = {"dfnID": "c15f1628", "url": "https://tc39.github.io/ecma262/#sec-object-internal-methods-and-internal-slots", "dfnText": "internal slot", "refSections": [{"refs": [{"id": "ref-for-sec-object-internal-methods-and-internal-slots"}, {"id": "ref-for-sec-object-internal-methods-and-internal-slots\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-sec-object-internal-methods-and-internal-slots\u2461"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-sec-object-internal-methods-and-internal-slots\u2462"}, {"id": "ref-for-sec-object-internal-methods-and-internal-slots\u2463"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-sec-object-internal-methods-and-internal-slots\u2464"}, {"id": "ref-for-sec-object-internal-methods-and-internal-slots\u2465"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-sec-object-internal-methods-and-internal-slots\u2466"}, {"id": "ref-for-sec-object-internal-methods-and-internal-slots\u2467"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-sec-object-internal-methods-and-internal-slots\u2468"}, {"id": "ref-for-sec-object-internal-methods-and-internal-slots\u2460\u24ea"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-sec-object-internal-methods-and-internal-slots\u2460\u2460"}, {"id": "ref-for-sec-object-internal-methods-and-internal-slots\u2460\u2461"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": true}; window.dfnpanelData['a262536f'] = {"dfnID": "a262536f", "url": "https://tc39.github.io/ecma262/#sec-code-realms", "dfnText": "realm", "refSections": [{"refs": [{"id": "ref-for-sec-code-realms"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-sec-code-realms\u2460"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-sec-code-realms\u2461"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-sec-code-realms\u2462"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-sec-code-realms\u2463"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-sec-code-realms\u2464"}, {"id": "ref-for-sec-code-realms\u2465"}, {"id": "ref-for-sec-code-realms\u2466"}], "title": "6.6.3. Responding to Disconnection"}], "external": true}; window.dfnpanelData['7ec42884'] = {"dfnID": "7ec42884", "url": "https://tc39.es/ecma262/multipage/text-processing.html#sec-string.prototype.split", "dfnText": "split(separator, limit)", "refSections": [{"refs": [{"id": "ref-for-sec-string.prototype.split"}], "title": "9. The Blocklist"}], "external": true}; window.dfnpanelData['a3033be5'] = {"dfnID": "a3033be5", "url": "https://encoding.spec.whatwg.org/#utf-8-decode-without-bom", "dfnText": "utf-8 decode without bom", "refSections": [{"refs": [{"id": "ref-for-utf-8-decode-without-bom"}], "title": "5.1. Global Bluetooth device properties"}, {"refs": [{"id": "ref-for-utf-8-decode-without-bom\u2460"}], "title": "5.2.3. Responding to Advertising Events"}], "external": true}; window.dfnpanelData['0303e8e5'] = {"dfnID": "0303e8e5", "url": "https://encoding.spec.whatwg.org/#utf-8-encode", "dfnText": "utf-8 encode", "refSections": [{"refs": [{"id": "ref-for-utf-8-encode"}, {"id": "ref-for-utf-8-encode\u2460"}], "title": "4. Device Discovery"}], "external": true}; window.dfnpanelData['836b9827'] = {"dfnID": "836b9827", "url": "https://w3c.github.io/fingerprinting-guidance/#dfn-fingerprinting-surface", "dfnText": "fingerprinting surface", "refSections": [{"refs": [{"id": "ref-for-dfn-fingerprinting-surface"}], "title": "3.5. Exposing Bluetooth availability"}], "external": true}; window.dfnpanelData['f0951476'] = {"dfnID": "f0951476", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler", "dfnText": "EventHandler", "refSections": [{"refs": [{"id": "ref-for-eventhandler"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-eventhandler\u2460"}, {"id": "ref-for-eventhandler\u2461"}, {"id": "ref-for-eventhandler\u2462"}, {"id": "ref-for-eventhandler\u2463"}, {"id": "ref-for-eventhandler\u2464"}, {"id": "ref-for-eventhandler\u2465"}], "title": "6.6.6. IDL event handlers"}], "external": true}; window.dfnpanelData['be0c27b2'] = {"dfnID": "be0c27b2", "url": "https://html.spec.whatwg.org/multipage/system-state.html#navigator", "dfnText": "Navigator", "refSections": [{"refs": [{"id": "ref-for-navigator"}, {"id": "ref-for-navigator\u2460"}, {"id": "ref-for-navigator\u2461"}, {"id": "ref-for-navigator\u2462"}, {"id": "ref-for-navigator\u2463"}], "title": "10. Extensions to the Navigator Interface"}, {"refs": [{"id": "ref-for-navigator\u2464"}], "title": "11.1. Permissions Policy"}], "external": true}; window.dfnpanelData['35972864'] = {"dfnID": "35972864", "url": "https://html.spec.whatwg.org/multipage/document-sequences.html#nav-document", "dfnText": "active document", "refSections": [{"refs": [{"id": "ref-for-nav-document"}, {"id": "ref-for-nav-document\u2460"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['101c721c'] = {"dfnID": "101c721c", "url": "https://html.spec.whatwg.org/multipage/document-sequences.html#nav-window", "dfnText": "active window", "refSections": [{"refs": [{"id": "ref-for-nav-window"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['3610bd67'] = {"dfnID": "3610bd67", "url": "https://html.spec.whatwg.org/multipage/iframe-embed-object.html#allowed-to-use", "dfnText": "allowed to use", "refSections": [{"refs": [{"id": "ref-for-allowed-to-use"}, {"id": "ref-for-allowed-to-use\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-allowed-to-use\u2461"}], "title": "4.2. Overall Bluetooth availability"}], "external": true}; window.dfnpanelData['3349d69f'] = {"dfnID": "3349d69f", "url": "https://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-document-window", "dfnText": "associated document", "refSections": [{"refs": [{"id": "ref-for-concept-document-window"}, {"id": "ref-for-concept-document-window\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-concept-document-window\u2461"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-concept-document-window\u2462"}, {"id": "ref-for-concept-document-window\u2463"}], "title": "5.2.1. Handling Visibility Change"}, {"refs": [{"id": "ref-for-concept-document-window\u2464"}], "title": "5.2.2. Handling Document Loss of Full Activity"}], "external": true}; window.dfnpanelData['9604bc39'] = {"dfnID": "9604bc39", "url": "https://html.spec.whatwg.org/multipage/system-state.html#associated-navigator", "dfnText": "associated navigator", "refSections": [{"refs": [{"id": "ref-for-associated-navigator"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['0d0390b4'] = {"dfnID": "0d0390b4", "url": "https://html.spec.whatwg.org/multipage/document-sequences.html#browsing-context", "dfnText": "browsing context", "refSections": [{"refs": [{"id": "ref-for-browsing-context"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-browsing-context\u2460"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": true}; window.dfnpanelData['12b8dfc0'] = {"dfnID": "12b8dfc0", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object", "dfnText": "current settings object", "refSections": [{"refs": [{"id": "ref-for-current-settings-object"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-current-settings-object\u2460"}, {"id": "ref-for-current-settings-object\u2461"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-current-settings-object\u2462"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-current-settings-object\u2463"}, {"id": "ref-for-current-settings-object\u2464"}], "title": "5.2.1. Handling Visibility Change"}, {"refs": [{"id": "ref-for-current-settings-object\u2465"}], "title": "5.2.2. Handling Document Loss of Full Activity"}], "external": true}; window.dfnpanelData['102df61f'] = {"dfnID": "102df61f", "url": "https://html.spec.whatwg.org/multipage/infrastructure.html#enqueue-the-following-steps", "dfnText": "enqueue the following steps", "refSections": [{"refs": [{"id": "ref-for-enqueue-the-following-steps"}, {"id": "ref-for-enqueue-the-following-steps\u2460"}], "title": "5.2. BluetoothDevice"}], "external": true}; window.dfnpanelData['3e12e042'] = {"dfnID": "3e12e042", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object", "dfnText": "environment settings object", "refSections": [{"refs": [{"id": "ref-for-environment-settings-object"}], "title": "6.6.5. Responding to Service Changes"}], "external": true}; window.dfnpanelData['03675365'] = {"dfnID": "03675365", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes", "dfnText": "event handler idl attribute", "refSections": [{"refs": [{"id": "ref-for-event-handler-idl-attributes"}, {"id": "ref-for-event-handler-idl-attributes\u2460"}, {"id": "ref-for-event-handler-idl-attributes\u2461"}, {"id": "ref-for-event-handler-idl-attributes\u2462"}, {"id": "ref-for-event-handler-idl-attributes\u2463"}, {"id": "ref-for-event-handler-idl-attributes\u2464"}], "title": "6.6.6. IDL event handlers"}], "external": true}; window.dfnpanelData['0e3ba9f8'] = {"dfnID": "0e3ba9f8", "url": "https://html.spec.whatwg.org/multipage/document-sequences.html#fully-active", "dfnText": "fully active", "refSections": [{"refs": [{"id": "ref-for-fully-active"}, {"id": "ref-for-fully-active\u2460"}, {"id": "ref-for-fully-active\u2461"}], "title": "5.2.2. Handling Document Loss of Full Activity"}], "external": true}; window.dfnpanelData['4b6086d7'] = {"dfnID": "4b6086d7", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#global-object", "dfnText": "global object", "refSections": [{"refs": [{"id": "ref-for-global-object"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-global-object\u2460"}], "title": "5. Device Representation"}, {"refs": [{"id": "ref-for-global-object\u2461"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-global-object\u2462"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": true}; window.dfnpanelData['8a30477b'] = {"dfnID": "8a30477b", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global", "dfnText": "global object (for environment settings object)", "refSections": [{"refs": [{"id": "ref-for-concept-settings-object-global"}], "title": "6.6.5. Responding to Service Changes"}], "external": true}; window.dfnpanelData['a72449dd'] = {"dfnID": "a72449dd", "url": "https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel", "dfnText": "in parallel", "refSections": [{"refs": [{"id": "ref-for-in-parallel"}, {"id": "ref-for-in-parallel\u2460"}, {"id": "ref-for-in-parallel\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-in-parallel\u2462"}, {"id": "ref-for-in-parallel\u2463"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-in-parallel\u2464"}, {"id": "ref-for-in-parallel\u2465"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-in-parallel\u2466"}, {"id": "ref-for-in-parallel\u2467"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-in-parallel\u2468"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-in-parallel\u2460\u24ea"}, {"id": "ref-for-in-parallel\u2460\u2460"}, {"id": "ref-for-in-parallel\u2460\u2461"}, {"id": "ref-for-in-parallel\u2460\u2462"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-in-parallel\u2460\u2463"}], "title": "6.4.1. BluetoothCharacteristicProperties"}, {"refs": [{"id": "ref-for-in-parallel\u2460\u2464"}, {"id": "ref-for-in-parallel\u2460\u2465"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": true}; window.dfnpanelData['dbdbb853'] = {"dfnID": "dbdbb853", "url": "https://html.spec.whatwg.org/multipage/document-sequences.html#inclusive-descendant-navigables", "dfnText": "inclusive descendant navigables", "refSections": [{"refs": [{"id": "ref-for-inclusive-descendant-navigables"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['cfcf5fb7'] = {"dfnID": "cfcf5fb7", "url": "https://html.spec.whatwg.org/multipage/browsing-the-web.html#initialise-the-document-object", "dfnText": "initializing the document object", "refSections": [{"refs": [{"id": "ref-for-initialise-the-document-object"}, {"id": "ref-for-initialise-the-document-object\u2460"}], "title": "4. Device Discovery"}], "external": true}; window.dfnpanelData['9c19b7fc'] = {"dfnID": "9c19b7fc", "url": "https://html.spec.whatwg.org/multipage/document-sequences.html#navigable", "dfnText": "navigable", "refSections": [{"refs": [{"id": "ref-for-navigable"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-navigable\u2460"}], "title": "12.2.4.1. The bluetooth.requestDevicePromptUpdated Event"}], "external": true}; window.dfnpanelData['228be966'] = {"dfnID": "228be966", "url": "https://html.spec.whatwg.org/multipage/nav-history-apis.html#window-navigable", "dfnText": "navigable (for Window)", "refSections": [{"refs": [{"id": "ref-for-window-navigable"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-window-navigable\u2460"}], "title": "4.2. Overall Bluetooth availability"}], "external": true}; window.dfnpanelData['2594e562'] = {"dfnID": "2594e562", "url": "https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate", "dfnText": "navigate", "refSections": [{"refs": [{"id": "ref-for-navigate"}], "title": "4. Device Discovery"}], "external": true}; window.dfnpanelData['5155c2d3'] = {"dfnID": "5155c2d3", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#non-secure-context", "dfnText": "non-secure context", "refSections": [{"refs": [{"id": "ref-for-non-secure-context"}, {"id": "ref-for-non-secure-context\u2460"}], "title": "4. Device Discovery"}], "external": true}; window.dfnpanelData['8603b31a'] = {"dfnID": "8603b31a", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint", "dfnText": "perform a microtask checkpoint", "refSections": [{"refs": [{"id": "ref-for-perform-a-microtask-checkpoint"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": true}; window.dfnpanelData['9a517a7d'] = {"dfnID": "9a517a7d", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task", "dfnText": "queue a task", "refSections": [{"refs": [{"id": "ref-for-queue-a-task"}, {"id": "ref-for-queue-a-task\u2460"}, {"id": "ref-for-queue-a-task\u2461"}, {"id": "ref-for-queue-a-task\u2462"}, {"id": "ref-for-queue-a-task\u2463"}, {"id": "ref-for-queue-a-task\u2464"}, {"id": "ref-for-queue-a-task\u2465"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-queue-a-task\u2466"}, {"id": "ref-for-queue-a-task\u2467"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-queue-a-task\u2468"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-queue-a-task\u2460\u24ea"}, {"id": "ref-for-queue-a-task\u2460\u2460"}, {"id": "ref-for-queue-a-task\u2460\u2461"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-queue-a-task\u2460\u2462"}, {"id": "ref-for-queue-a-task\u2460\u2463"}, {"id": "ref-for-queue-a-task\u2460\u2464"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-queue-a-task\u2460\u2465"}, {"id": "ref-for-queue-a-task\u2460\u2466"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-queue-a-task\u2460\u2467"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-queue-a-task\u2460\u2468"}], "title": "6.6.4. Responding to Notifications and Indications"}, {"refs": [{"id": "ref-for-queue-a-task\u2461\u24ea"}, {"id": "ref-for-queue-a-task\u2461\u2460"}], "title": "6.6.5. Responding to Service Changes"}, {"refs": [{"id": "ref-for-queue-a-task\u2461\u2461"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['e99bd18e'] = {"dfnID": "e99bd18e", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global", "dfnText": "relevant global object", "refSections": [{"refs": [{"id": "ref-for-concept-relevant-global"}, {"id": "ref-for-concept-relevant-global\u2460"}, {"id": "ref-for-concept-relevant-global\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-concept-relevant-global\u2462"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-concept-relevant-global\u2463"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-concept-relevant-global\u2464"}, {"id": "ref-for-concept-relevant-global\u2465"}], "title": "5.2.1. Handling Visibility Change"}, {"refs": [{"id": "ref-for-concept-relevant-global\u2466"}], "title": "5.2.2. Handling Document Loss of Full Activity"}, {"refs": [{"id": "ref-for-concept-relevant-global\u2467"}], "title": "6.6.5. Responding to Service Changes"}], "external": true}; window.dfnpanelData['5991ccfb'] = {"dfnID": "5991ccfb", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm", "dfnText": "relevant realm", "refSections": [{"refs": [{"id": "ref-for-concept-relevant-realm"}], "title": "10. Extensions to the Navigator Interface"}], "external": true}; window.dfnpanelData['9c4c1e66'] = {"dfnID": "9c4c1e66", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object", "dfnText": "relevant settings object", "refSections": [{"refs": [{"id": "ref-for-relevant-settings-object"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-relevant-settings-object\u2460"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-relevant-settings-object\u2461"}], "title": "6.6.1. Bluetooth Tree"}, {"refs": [{"id": "ref-for-relevant-settings-object\u2462"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-relevant-settings-object\u2463"}, {"id": "ref-for-relevant-settings-object\u2464"}, {"id": "ref-for-relevant-settings-object\u2465"}], "title": "6.6.5. Responding to Service Changes"}, {"refs": [{"id": "ref-for-relevant-settings-object\u2466"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['e3288657'] = {"dfnID": "e3288657", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop", "dfnText": "responsible event loop", "refSections": [{"refs": [{"id": "ref-for-responsible-event-loop"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-responsible-event-loop\u2460"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-responsible-event-loop\u2461"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-responsible-event-loop\u2462"}, {"id": "ref-for-responsible-event-loop\u2463"}], "title": "6.6.5. Responding to Service Changes"}, {"refs": [{"id": "ref-for-responsible-event-loop\u2464"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['65181da8'] = {"dfnID": "65181da8", "url": "https://html.spec.whatwg.org/multipage/webappapis.html#secure-context", "dfnText": "secure context", "refSections": [{"refs": [{"id": "ref-for-secure-context"}], "title": "3.1. Device access is powerful"}], "external": true}; window.dfnpanelData['8219d486'] = {"dfnID": "8219d486", "url": "https://html.spec.whatwg.org/multipage/infrastructure.html#starting-a-new-parallel-queue", "dfnText": "starting a new parallel queue", "refSections": [{"refs": [{"id": "ref-for-starting-a-new-parallel-queue"}], "title": "5.2. BluetoothDevice"}], "external": true}; window.dfnpanelData['30717154'] = {"dfnID": "30717154", "url": "https://html.spec.whatwg.org/multipage/document-sequences.html#nav-top", "dfnText": "top-level traversable", "refSections": [{"refs": [{"id": "ref-for-nav-top"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-nav-top\u2460"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-nav-top\u2461"}], "title": "12. Automated testing"}, {"refs": [{"id": "ref-for-nav-top\u2462"}], "title": "12.2.3.2. The bluetooth.simulateAdapter Command"}, {"refs": [{"id": "ref-for-nav-top\u2463"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}, {"refs": [{"id": "ref-for-nav-top\u2464"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['1adcc035'] = {"dfnID": "1adcc035", "url": "https://infra.spec.whatwg.org/#abort-when", "dfnText": "abort when", "refSections": [{"refs": [{"id": "ref-for-abort-when"}], "title": "5.2. BluetoothDevice"}], "external": true}; window.dfnpanelData['53275e46'] = {"dfnID": "53275e46", "url": "https://infra.spec.whatwg.org/#list-append", "dfnText": "append", "refSections": [{"refs": [{"id": "ref-for-list-append"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}], "external": true}; window.dfnpanelData['b7f60025'] = {"dfnID": "b7f60025", "url": "https://infra.spec.whatwg.org/#ascii-lower-hex-digit", "dfnText": "ascii lower hex digit", "refSections": [{"refs": [{"id": "ref-for-ascii-lower-hex-digit"}], "title": "8. Advertising Data Filter"}, {"refs": [{"id": "ref-for-ascii-lower-hex-digit\u2460"}], "title": "9. The Blocklist"}], "external": true}; window.dfnpanelData['3de9e659'] = {"dfnID": "3de9e659", "url": "https://infra.spec.whatwg.org/#byte-sequence", "dfnText": "byte sequence", "refSections": [{"refs": [{"id": "ref-for-byte-sequence"}], "title": "12.1. Definitions"}, {"refs": [{"id": "ref-for-byte-sequence\u2460"}], "title": "12.2.1.4. The bluetooth.ScanRecord Type"}], "external": true}; window.dfnpanelData['1243a891'] = {"dfnID": "1243a891", "url": "https://infra.spec.whatwg.org/#map-exists", "dfnText": "exist", "refSections": [{"refs": [{"id": "ref-for-map-exists"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}, {"refs": [{"id": "ref-for-map-exists\u2460"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}, {"refs": [{"id": "ref-for-map-exists\u2461"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['45209803'] = {"dfnID": "45209803", "url": "https://infra.spec.whatwg.org/#map-iterate", "dfnText": "for each", "refSections": [{"refs": [{"id": "ref-for-map-iterate"}], "title": "5.2. BluetoothDevice"}], "external": true}; window.dfnpanelData['73e75483'] = {"dfnID": "73e75483", "url": "https://infra.spec.whatwg.org/#forgiving-base64-decode", "dfnText": "forgiving-base64 decode", "refSections": [{"refs": [{"id": "ref-for-forgiving-base64-decode"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}], "external": true}; window.dfnpanelData['d5890b17'] = {"dfnID": "d5890b17", "url": "https://infra.spec.whatwg.org/#map-getting-the-values", "dfnText": "getting the values", "refSections": [{"refs": [{"id": "ref-for-map-getting-the-values"}], "title": "4. Device Discovery"}], "external": true}; window.dfnpanelData['715f22e4'] = {"dfnID": "715f22e4", "url": "https://infra.spec.whatwg.org/#if-aborted", "dfnText": "if aborted", "refSections": [{"refs": [{"id": "ref-for-if-aborted"}], "title": "5.2. BluetoothDevice"}], "external": true}; window.dfnpanelData['649608b9'] = {"dfnID": "649608b9", "url": "https://infra.spec.whatwg.org/#list", "dfnText": "list", "refSections": [{"refs": [{"id": "ref-for-list"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-list\u2460"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}], "external": true}; window.dfnpanelData['3fca5a9e'] = {"dfnID": "3fca5a9e", "url": "https://infra.spec.whatwg.org/#ordered-map", "dfnText": "map", "refSections": [{"refs": [{"id": "ref-for-ordered-map"}], "title": "12. Automated testing"}, {"refs": [{"id": "ref-for-ordered-map\u2460"}], "title": "12.2.1.2. The bluetooth.RequestDeviceInfo Type"}, {"refs": [{"id": "ref-for-ordered-map\u2461"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}, {"refs": [{"id": "ref-for-ordered-map\u2462"}, {"id": "ref-for-ordered-map\u2463"}], "title": "12.2.4.1. The bluetooth.requestDevicePromptUpdated Event"}], "external": true}; window.dfnpanelData['84b454ff'] = {"dfnID": "84b454ff", "url": "https://infra.spec.whatwg.org/#ordered-map", "dfnText": "ordered map", "refSections": [{"refs": [{"id": "ref-for-ordered-map"}], "title": "12. Automated testing"}, {"refs": [{"id": "ref-for-ordered-map\u2460"}], "title": "12.2.1.2. The bluetooth.RequestDeviceInfo Type"}, {"refs": [{"id": "ref-for-ordered-map\u2461"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}, {"refs": [{"id": "ref-for-ordered-map\u2462"}, {"id": "ref-for-ordered-map\u2463"}], "title": "12.2.4.1. The bluetooth.requestDevicePromptUpdated Event"}], "external": true}; window.dfnpanelData['7d4424b2'] = {"dfnID": "7d4424b2", "url": "https://infra.spec.whatwg.org/#map-remove", "dfnText": "remove", "refSections": [{"refs": [{"id": "ref-for-map-remove"}], "title": "4. Device Discovery"}], "external": true}; window.dfnpanelData['15e48c39'] = {"dfnID": "15e48c39", "url": "https://infra.spec.whatwg.org/#ordered-set", "dfnText": "set", "refSections": [{"refs": [{"id": "ref-for-ordered-set"}], "title": "12.2.1.1. The bluetooth.RequestDevice Type"}, {"refs": [{"id": "ref-for-ordered-set\u2460"}, {"id": "ref-for-ordered-set\u2461"}], "title": "12.2.4.1. The bluetooth.requestDevicePromptUpdated Event"}], "external": true}; window.dfnpanelData['e5fc5b88'] = {"dfnID": "e5fc5b88", "url": "https://infra.spec.whatwg.org/#strictly-split", "dfnText": "strictly split", "refSections": [{"refs": [{"id": "ref-for-strictly-split"}], "title": "8. Advertising Data Filter"}], "external": true}; window.dfnpanelData['0698d556'] = {"dfnID": "0698d556", "url": "https://infra.spec.whatwg.org/#string", "dfnText": "string", "refSections": [{"refs": [{"id": "ref-for-string"}], "title": "8. Advertising Data Filter"}], "external": true}; window.dfnpanelData['0e8de730'] = {"dfnID": "0e8de730", "url": "https://infra.spec.whatwg.org/#tuple", "dfnText": "tuple", "refSections": [{"refs": [{"id": "ref-for-tuple"}], "title": "12.2.1.1. The bluetooth.RequestDevice Type"}], "external": true}; window.dfnpanelData['5afde8ae'] = {"dfnID": "5afde8ae", "url": "https://www.w3.org/TR/page-visibility-2/#dom-visibilitystate", "dfnText": "document visibility state", "refSections": [{"refs": [{"id": "ref-for-dom-visibilitystate"}, {"id": "ref-for-dom-visibilitystate\u2460"}, {"id": "ref-for-dom-visibilitystate\u2461"}], "title": "5.2.1. Handling Visibility Change"}], "external": true}; window.dfnpanelData['ebb01253'] = {"dfnID": "ebb01253", "url": "https://w3c.github.io/permissions/#dom-permissiondescriptor", "dfnText": "PermissionDescriptor", "refSections": [{"refs": [{"id": "ref-for-dom-permissiondescriptor"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['dbf8e074'] = {"dfnID": "dbf8e074", "url": "https://w3c.github.io/permissions/#dom-permissionstatus", "dfnText": "PermissionStatus", "refSections": [{"refs": [{"id": "ref-for-dom-permissionstatus"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['2cb28cb0'] = {"dfnID": "2cb28cb0", "url": "https://w3c.github.io/permissions/#dom-permissionstate-denied", "dfnText": "denied", "refSections": [{"refs": [{"id": "ref-for-dom-permissionstate-denied"}, {"id": "ref-for-dom-permissionstate-denied\u2460"}, {"id": "ref-for-dom-permissionstate-denied\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-permissionstate-denied\u2462"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['c1460964'] = {"dfnID": "c1460964", "url": "https://w3c.github.io/permissions/#dfn-extra-permission-data", "dfnText": "extra permission data", "refSections": [{"refs": [{"id": "ref-for-dfn-extra-permission-data"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dfn-extra-permission-data\u2460"}, {"id": "ref-for-dfn-extra-permission-data\u2461"}, {"id": "ref-for-dfn-extra-permission-data\u2462"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dfn-extra-permission-data\u2463"}, {"id": "ref-for-dfn-extra-permission-data\u2464"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-dfn-extra-permission-data\u2465"}], "title": "6.6.1. Bluetooth Tree"}], "external": true}; window.dfnpanelData['287bee7a'] = {"dfnID": "287bee7a", "url": "https://w3c.github.io/permissions/#dfn-extra-permission-data-constraints", "dfnText": "extra permission data constraints", "refSections": [{"refs": [{"id": "ref-for-dfn-extra-permission-data-constraints"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['0cc28b31'] = {"dfnID": "0cc28b31", "url": "https://w3c.github.io/permissions/#dfn-extra-permission-data-type", "dfnText": "extra permission data type", "refSections": [{"refs": [{"id": "ref-for-dfn-extra-permission-data-type"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['0310eecd'] = {"dfnID": "0310eecd", "url": "https://w3c.github.io/permissions/#dom-permissiondescriptor-name", "dfnText": "name (for PermissionDescriptor)", "refSections": [{"refs": [{"id": "ref-for-dom-permissiondescriptor-name"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['e740d7e5'] = {"dfnID": "e740d7e5", "url": "https://w3c.github.io/permissions/#dfn-name", "dfnText": "name (for powerful feature)", "refSections": [{"refs": [{"id": "ref-for-dfn-name"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['4b7ca52a'] = {"dfnID": "4b7ca52a", "url": "https://w3c.github.io/permissions/#dfn-permission-descriptor-type", "dfnText": "permission descriptor type", "refSections": [{"refs": [{"id": "ref-for-dfn-permission-descriptor-type"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['7ee1f942'] = {"dfnID": "7ee1f942", "url": "https://w3c.github.io/permissions/#dfn-permission-query-algorithm", "dfnText": "permission query algorithm", "refSections": [{"refs": [{"id": "ref-for-dfn-permission-query-algorithm"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['a6da7e16'] = {"dfnID": "a6da7e16", "url": "https://w3c.github.io/permissions/#dfn-permission-result-type", "dfnText": "permission result type", "refSections": [{"refs": [{"id": "ref-for-dfn-permission-result-type"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['409a61ca'] = {"dfnID": "409a61ca", "url": "https://w3c.github.io/permissions/#dfn-permission-revocation-algorithm", "dfnText": "permission revocation algorithm", "refSections": [{"refs": [{"id": "ref-for-dfn-permission-revocation-algorithm"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['d124397f'] = {"dfnID": "d124397f", "url": "https://w3c.github.io/permissions/#dfn-permission-state", "dfnText": "permission state", "refSections": [{"refs": [{"id": "ref-for-dfn-permission-state"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dfn-permission-state\u2460"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['6c2d7879'] = {"dfnID": "6c2d7879", "url": "https://w3c.github.io/permissions/#dfn-powerful-feature", "dfnText": "powerful feature", "refSections": [{"refs": [{"id": "ref-for-dfn-powerful-feature"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['c2430fbb'] = {"dfnID": "c2430fbb", "url": "https://w3c.github.io/permissions/#dfn-prompt-the-user-to-choose", "dfnText": "prompt the user to choose", "refSections": [{"refs": [{"id": "ref-for-dfn-prompt-the-user-to-choose"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dfn-prompt-the-user-to-choose\u2460"}], "title": "12.2.1.1. The bluetooth.RequestDevice Type"}], "external": true}; window.dfnpanelData['78f04503'] = {"dfnID": "78f04503", "url": "https://w3c.github.io/permissions/#dom-permissions-query", "dfnText": "query()", "refSections": [{"refs": [{"id": "ref-for-dom-permissions-query"}, {"id": "ref-for-dom-permissions-query\u2460"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dom-permissions-query\u2461"}], "title": "4.2. Overall Bluetooth availability"}], "external": true}; window.dfnpanelData['620f832e'] = {"dfnID": "620f832e", "url": "https://w3c.github.io/permissions/#dom-permissionstatus-state", "dfnText": "state", "refSections": [{"refs": [{"id": "ref-for-dom-permissionstatus-state"}, {"id": "ref-for-dom-permissionstatus-state\u2460"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['1570624a'] = {"dfnID": "1570624a", "url": "https://w3c.github.io/webappsec-permissions-policy/#policy-controlled-feature-default-allowlist", "dfnText": "default allowlist", "refSections": [{"refs": [{"id": "ref-for-policy-controlled-feature-default-allowlist"}], "title": "11.1. Permissions Policy"}], "external": true}; window.dfnpanelData['cc890cc1'] = {"dfnID": "cc890cc1", "url": "https://w3c.github.io/webappsec-permissions-policy/#policy-controlled-feature", "dfnText": "policy-controlled feature", "refSections": [{"refs": [{"id": "ref-for-policy-controlled-feature"}, {"id": "ref-for-policy-controlled-feature\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-policy-controlled-feature\u2461"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-policy-controlled-feature\u2462"}], "title": "11.1. Permissions Policy"}], "external": true}; window.dfnpanelData['db84aa06'] = {"dfnID": "db84aa06", "url": "https://w3c.github.io/webdriver-bidi/#emit-an-event", "dfnText": "emit an event", "refSections": [{"refs": [{"id": "ref-for-emit-an-event"}], "title": "12.2.4.1. The bluetooth.requestDevicePromptUpdated Event"}], "external": true}; window.dfnpanelData['be79cdb1'] = {"dfnID": "be79cdb1", "url": "https://w3c.github.io/webdriver-bidi/#get-a-navigable", "dfnText": "get a navigable", "refSections": [{"refs": [{"id": "ref-for-get-a-navigable"}], "title": "12.2.3.2. The bluetooth.simulateAdapter Command"}, {"refs": [{"id": "ref-for-get-a-navigable\u2460"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}, {"refs": [{"id": "ref-for-get-a-navigable\u2461"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['5d727956'] = {"dfnID": "5d727956", "url": "https://w3c.github.io/webdriver-bidi/#navigable-id", "dfnText": "navigable id", "refSections": [{"refs": [{"id": "ref-for-navigable-id"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-navigable-id\u2460"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}, {"refs": [{"id": "ref-for-navigable-id\u2461"}], "title": "12.2.4.1. The bluetooth.requestDevicePromptUpdated Event"}], "external": true}; window.dfnpanelData['23af542f'] = {"dfnID": "23af542f", "url": "https://w3c.github.io/webdriver-bidi/#set-of-sessions-for-which-an-event-is-enabled", "dfnText": "set of sessions for which an event is enabled", "refSections": [{"refs": [{"id": "ref-for-set-of-sessions-for-which-an-event-is-enabled"}], "title": "12.2.4.1. The bluetooth.requestDevicePromptUpdated Event"}], "external": true}; window.dfnpanelData['bb4c269e'] = {"dfnID": "bb4c269e", "url": "https://w3c.github.io/webdriver/#dfn-error", "dfnText": "error", "refSections": [{"refs": [{"id": "ref-for-dfn-error"}, {"id": "ref-for-dfn-error\u2460"}, {"id": "ref-for-dfn-error\u2461"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}, {"refs": [{"id": "ref-for-dfn-error\u2462"}], "title": "12.2.3.2. The bluetooth.simulateAdapter Command"}, {"refs": [{"id": "ref-for-dfn-error\u2463"}, {"id": "ref-for-dfn-error\u2464"}, {"id": "ref-for-dfn-error\u2465"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}, {"refs": [{"id": "ref-for-dfn-error\u2466"}, {"id": "ref-for-dfn-error\u2467"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['9a707b42'] = {"dfnID": "9a707b42", "url": "https://w3c.github.io/webdriver/#dfn-local-ends", "dfnText": "local end", "refSections": [{"refs": [{"id": "ref-for-dfn-local-ends"}], "title": "12.2.3.1. The bluetooth.handleRequestDevicePrompt Command"}, {"refs": [{"id": "ref-for-dfn-local-ends\u2460"}], "title": "12.2.3.2. The bluetooth.simulateAdapter Command"}, {"refs": [{"id": "ref-for-dfn-local-ends\u2461"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}, {"refs": [{"id": "ref-for-dfn-local-ends\u2462"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['c8ff8493'] = {"dfnID": "c8ff8493", "url": "https://w3c.github.io/webdriver/#dfn-error-code", "dfnText": "error code", "refSections": [{"refs": [{"id": "ref-for-dfn-error-code"}, {"id": "ref-for-dfn-error-code\u2460"}, {"id": "ref-for-dfn-error-code\u2461"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}, {"refs": [{"id": "ref-for-dfn-error-code\u2462"}], "title": "12.2.2. Errors"}, {"refs": [{"id": "ref-for-dfn-error-code\u2463"}], "title": "12.2.3.2. The bluetooth.simulateAdapter Command"}, {"refs": [{"id": "ref-for-dfn-error-code\u2464"}, {"id": "ref-for-dfn-error-code\u2465"}, {"id": "ref-for-dfn-error-code\u2466"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}, {"refs": [{"id": "ref-for-dfn-error-code\u2467"}, {"id": "ref-for-dfn-error-code\u2468"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['8da4d1e3'] = {"dfnID": "8da4d1e3", "url": "https://w3c.github.io/webdriver/#dfn-invalid-argument", "dfnText": "invalid argument", "refSections": [{"refs": [{"id": "ref-for-dfn-invalid-argument"}], "title": "12.2.3.2. The bluetooth.simulateAdapter Command"}, {"refs": [{"id": "ref-for-dfn-invalid-argument\u2460"}, {"id": "ref-for-dfn-invalid-argument\u2461"}, {"id": "ref-for-dfn-invalid-argument\u2462"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}, {"refs": [{"id": "ref-for-dfn-invalid-argument\u2463"}, {"id": "ref-for-dfn-invalid-argument\u2464"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['82c23298'] = {"dfnID": "82c23298", "url": "https://w3c.github.io/webdriver/#dfn-remote-end-steps", "dfnText": "remote end steps", "refSections": [{"refs": [{"id": "ref-for-dfn-remote-end-steps"}], "title": "12.2.3.1. The bluetooth.handleRequestDevicePrompt Command"}, {"refs": [{"id": "ref-for-dfn-remote-end-steps\u2460"}], "title": "12.2.3.2. The bluetooth.simulateAdapter Command"}, {"refs": [{"id": "ref-for-dfn-remote-end-steps\u2461"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}, {"refs": [{"id": "ref-for-dfn-remote-end-steps\u2462"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['4be6272b'] = {"dfnID": "4be6272b", "url": "https://w3c.github.io/webdriver/#dfn-success", "dfnText": "success", "refSections": [{"refs": [{"id": "ref-for-dfn-success"}, {"id": "ref-for-dfn-success\u2460"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}, {"refs": [{"id": "ref-for-dfn-success\u2461"}], "title": "12.2.3.1. The bluetooth.handleRequestDevicePrompt Command"}, {"refs": [{"id": "ref-for-dfn-success\u2462"}], "title": "12.2.3.2. The bluetooth.simulateAdapter Command"}, {"refs": [{"id": "ref-for-dfn-success\u2463"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}, {"refs": [{"id": "ref-for-dfn-success\u2464"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['7aa9c8e0'] = {"dfnID": "7aa9c8e0", "url": "https://w3c.github.io/webdriver/#dfn-try", "dfnText": "trying", "refSections": [{"refs": [{"id": "ref-for-dfn-try"}, {"id": "ref-for-dfn-try\u2460"}], "title": "12.2.3.1. The bluetooth.handleRequestDevicePrompt Command"}, {"refs": [{"id": "ref-for-dfn-try\u2461"}], "title": "12.2.3.2. The bluetooth.simulateAdapter Command"}, {"refs": [{"id": "ref-for-dfn-try\u2462"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}, {"refs": [{"id": "ref-for-dfn-try\u2463"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": true}; window.dfnpanelData['0c0fa736'] = {"dfnID": "0c0fa736", "url": "https://wicg.github.io/webhid/#dom-hidreportitem-strings", "dfnText": "strings", "refSections": [{"refs": [{"id": "ref-for-dom-hidreportitem-strings"}], "title": "12. Automated testing"}], "external": true}; window.dfnpanelData['d25dfb2c'] = {"dfnID": "d25dfb2c", "url": "https://webidl.spec.whatwg.org/#aborterror", "dfnText": "AbortError", "refSections": [{"refs": [{"id": "ref-for-aborterror"}, {"id": "ref-for-aborterror\u2460"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-aborterror\u2461"}, {"id": "ref-for-aborterror\u2462"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": true}; window.dfnpanelData['3aff2fb3'] = {"dfnID": "3aff2fb3", "url": "https://webidl.spec.whatwg.org/#BufferSource", "dfnText": "BufferSource", "refSections": [{"refs": [{"id": "ref-for-BufferSource"}, {"id": "ref-for-BufferSource\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-BufferSource\u2461"}, {"id": "ref-for-BufferSource\u2462"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-BufferSource\u2463"}, {"id": "ref-for-BufferSource\u2464"}, {"id": "ref-for-BufferSource\u2465"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-BufferSource\u2466"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": true}; window.dfnpanelData['dca2de17'] = {"dfnID": "dca2de17", "url": "https://webidl.spec.whatwg.org/#idl-DOMException", "dfnText": "DOMException", "refSections": [{"refs": [{"id": "ref-for-idl-DOMException"}], "title": "4.1. Permission API Integration"}], "external": true}; window.dfnpanelData['8855a9aa'] = {"dfnID": "8855a9aa", "url": "https://webidl.spec.whatwg.org/#idl-DOMString", "dfnText": "DOMString", "refSections": [{"refs": [{"id": "ref-for-idl-DOMString"}, {"id": "ref-for-idl-DOMString\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-idl-DOMString\u2461"}, {"id": "ref-for-idl-DOMString\u2462"}, {"id": "ref-for-idl-DOMString\u2463"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-idl-DOMString\u2464"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-idl-DOMString\u2465"}, {"id": "ref-for-idl-DOMString\u2466"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-idl-DOMString\u2467"}, {"id": "ref-for-idl-DOMString\u2468"}, {"id": "ref-for-idl-DOMString\u2460\u24ea"}, {"id": "ref-for-idl-DOMString\u2460\u2460"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-idl-DOMString\u2460\u2461"}], "title": "7. UUIDs"}, {"refs": [{"id": "ref-for-idl-DOMString\u2460\u2462"}, {"id": "ref-for-idl-DOMString\u2460\u2463"}, {"id": "ref-for-idl-DOMString\u2460\u2464"}, {"id": "ref-for-idl-DOMString\u2460\u2465"}, {"id": "ref-for-idl-DOMString\u2460\u2466"}, {"id": "ref-for-idl-DOMString\u2460\u2467"}], "title": "7.1. Standardized UUIDs"}], "external": true}; window.dfnpanelData['c01cbda0'] = {"dfnID": "c01cbda0", "url": "https://webidl.spec.whatwg.org/#EnforceRange", "dfnText": "EnforceRange", "refSections": [{"refs": [{"id": "ref-for-EnforceRange"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-EnforceRange\u2460"}], "title": "7.1. Standardized UUIDs"}], "external": true}; window.dfnpanelData['889e932f'] = {"dfnID": "889e932f", "url": "https://webidl.spec.whatwg.org/#Exposed", "dfnText": "Exposed", "refSections": [{"refs": [{"id": "ref-for-Exposed"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-Exposed\u2460"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-Exposed\u2461"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-Exposed\u2462"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-Exposed\u2463"}, {"id": "ref-for-Exposed\u2464"}, {"id": "ref-for-Exposed\u2465"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-Exposed\u2466"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-Exposed\u2467"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-Exposed\u2468"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-Exposed\u2460\u24ea"}], "title": "6.4.1. BluetoothCharacteristicProperties"}, {"refs": [{"id": "ref-for-Exposed\u2460\u2460"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-Exposed\u2460\u2461"}], "title": "7.1. Standardized UUIDs"}], "external": true}; window.dfnpanelData['dcf5fafa'] = {"dfnID": "dcf5fafa", "url": "https://webidl.spec.whatwg.org/#idl-frozen-array", "dfnText": "FrozenArray", "refSections": [{"refs": [{"id": "ref-for-idl-frozen-array"}, {"id": "ref-for-idl-frozen-array\u2460"}, {"id": "ref-for-idl-frozen-array\u2461"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-idl-frozen-array\u2462"}, {"id": "ref-for-idl-frozen-array\u2463"}, {"id": "ref-for-idl-frozen-array\u2464"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-idl-frozen-array\u2465"}, {"id": "ref-for-idl-frozen-array\u2466"}], "title": "13. Terminology and Conventions"}], "external": true}; window.dfnpanelData['cae6bf57'] = {"dfnID": "cae6bf57", "url": "https://webidl.spec.whatwg.org/#invalidmodificationerror", "dfnText": "InvalidModificationError", "refSections": [{"refs": [{"id": "ref-for-invalidmodificationerror"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-invalidmodificationerror\u2460"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-invalidmodificationerror\u2461"}, {"id": "ref-for-invalidmodificationerror\u2462"}, {"id": "ref-for-invalidmodificationerror\u2463"}], "title": "6.7. Error handling"}], "external": true}; window.dfnpanelData['797018a7'] = {"dfnID": "797018a7", "url": "https://webidl.spec.whatwg.org/#invalidstateerror", "dfnText": "InvalidStateError", "refSections": [{"refs": [{"id": "ref-for-invalidstateerror"}, {"id": "ref-for-invalidstateerror\u2460"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-invalidstateerror\u2461"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}, {"refs": [{"id": "ref-for-invalidstateerror\u2462"}, {"id": "ref-for-invalidstateerror\u2463"}, {"id": "ref-for-invalidstateerror\u2464"}, {"id": "ref-for-invalidstateerror\u2465"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-invalidstateerror\u2466"}, {"id": "ref-for-invalidstateerror\u2467"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-invalidstateerror\u2468"}], "title": "6.7. Error handling"}], "external": true}; window.dfnpanelData['c74f29b9'] = {"dfnID": "c74f29b9", "url": "https://webidl.spec.whatwg.org/#networkerror", "dfnText": "NetworkError", "refSections": [{"refs": [{"id": "ref-for-networkerror"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}, {"refs": [{"id": "ref-for-networkerror\u2460"}, {"id": "ref-for-networkerror\u2461"}, {"id": "ref-for-networkerror\u2462"}, {"id": "ref-for-networkerror\u2463"}, {"id": "ref-for-networkerror\u2464"}, {"id": "ref-for-networkerror\u2465"}, {"id": "ref-for-networkerror\u2466"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-networkerror\u2467"}, {"id": "ref-for-networkerror\u2468"}, {"id": "ref-for-networkerror\u2460\u24ea"}, {"id": "ref-for-networkerror\u2460\u2460"}, {"id": "ref-for-networkerror\u2460\u2461"}, {"id": "ref-for-networkerror\u2460\u2462"}, {"id": "ref-for-networkerror\u2460\u2463"}, {"id": "ref-for-networkerror\u2460\u2464"}, {"id": "ref-for-networkerror\u2460\u2465"}, {"id": "ref-for-networkerror\u2460\u2466"}, {"id": "ref-for-networkerror\u2460\u2467"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-networkerror\u2460\u2468"}, {"id": "ref-for-networkerror\u2461\u24ea"}, {"id": "ref-for-networkerror\u2461\u2460"}, {"id": "ref-for-networkerror\u2461\u2461"}, {"id": "ref-for-networkerror\u2461\u2462"}, {"id": "ref-for-networkerror\u2461\u2463"}, {"id": "ref-for-networkerror\u2461\u2464"}, {"id": "ref-for-networkerror\u2461\u2465"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-networkerror\u2461\u2466"}], "title": "6.7. Error handling"}], "external": true}; window.dfnpanelData['9eda9b58'] = {"dfnID": "9eda9b58", "url": "https://webidl.spec.whatwg.org/#notfounderror", "dfnText": "NotFoundError", "refSections": [{"refs": [{"id": "ref-for-notfounderror"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-notfounderror\u2460"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-notfounderror\u2461"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}], "external": true}; window.dfnpanelData['3182eb71'] = {"dfnID": "3182eb71", "url": "https://webidl.spec.whatwg.org/#notsupportederror", "dfnText": "NotSupportedError", "refSections": [{"refs": [{"id": "ref-for-notsupportederror"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-notsupportederror\u2460"}, {"id": "ref-for-notsupportederror\u2461"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-notsupportederror\u2462"}, {"id": "ref-for-notsupportederror\u2463"}, {"id": "ref-for-notsupportederror\u2464"}, {"id": "ref-for-notsupportederror\u2465"}], "title": "6.7. Error handling"}], "external": true}; window.dfnpanelData['bdbd19d1'] = {"dfnID": "bdbd19d1", "url": "https://webidl.spec.whatwg.org/#idl-promise", "dfnText": "Promise", "refSections": [{"refs": [{"id": "ref-for-idl-promise"}, {"id": "ref-for-idl-promise\u2460"}, {"id": "ref-for-idl-promise\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-idl-promise\u2462"}, {"id": "ref-for-idl-promise\u2463"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-idl-promise\u2464"}, {"id": "ref-for-idl-promise\u2465"}, {"id": "ref-for-idl-promise\u2466"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-idl-promise\u2467"}, {"id": "ref-for-idl-promise\u2468"}, {"id": "ref-for-idl-promise\u2460\u24ea"}, {"id": "ref-for-idl-promise\u2460\u2460"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-idl-promise\u2460\u2461"}, {"id": "ref-for-idl-promise\u2460\u2462"}, {"id": "ref-for-idl-promise\u2460\u2463"}, {"id": "ref-for-idl-promise\u2460\u2464"}, {"id": "ref-for-idl-promise\u2460\u2465"}, {"id": "ref-for-idl-promise\u2460\u2466"}, {"id": "ref-for-idl-promise\u2460\u2467"}, {"id": "ref-for-idl-promise\u2460\u2468"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-idl-promise\u2461\u24ea"}, {"id": "ref-for-idl-promise\u2461\u2460"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": true}; window.dfnpanelData['a5c91173'] = {"dfnID": "a5c91173", "url": "https://webidl.spec.whatwg.org/#SameObject", "dfnText": "SameObject", "refSections": [{"refs": [{"id": "ref-for-SameObject"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-SameObject\u2460"}, {"id": "ref-for-SameObject\u2461"}, {"id": "ref-for-SameObject\u2462"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-SameObject\u2463"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-SameObject\u2464"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-SameObject\u2465"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-SameObject\u2466"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-SameObject\u2467"}], "title": "10. Extensions to the Navigator Interface"}], "external": true}; window.dfnpanelData['b75bb3bd'] = {"dfnID": "b75bb3bd", "url": "https://webidl.spec.whatwg.org/#SecureContext", "dfnText": "SecureContext", "refSections": [{"refs": [{"id": "ref-for-SecureContext"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-SecureContext\u2460"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-SecureContext\u2461"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-SecureContext\u2462"}, {"id": "ref-for-SecureContext\u2463"}, {"id": "ref-for-SecureContext\u2464"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-SecureContext\u2465"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-SecureContext\u2466"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-SecureContext\u2467"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-SecureContext\u2468"}], "title": "6.4.1. BluetoothCharacteristicProperties"}, {"refs": [{"id": "ref-for-SecureContext\u2460\u24ea"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-SecureContext\u2460\u2460"}, {"id": "ref-for-SecureContext\u2460\u2461"}, {"id": "ref-for-SecureContext\u2460\u2462"}], "title": "6.6.6. IDL event handlers"}, {"refs": [{"id": "ref-for-SecureContext\u2460\u2463"}], "title": "10. Extensions to the Navigator Interface"}], "external": true}; window.dfnpanelData['c3e881ef'] = {"dfnID": "c3e881ef", "url": "https://webidl.spec.whatwg.org/#securityerror", "dfnText": "SecurityError", "refSections": [{"refs": [{"id": "ref-for-securityerror"}, {"id": "ref-for-securityerror\u2460"}, {"id": "ref-for-securityerror\u2461"}, {"id": "ref-for-securityerror\u2462"}, {"id": "ref-for-securityerror\u2463"}, {"id": "ref-for-securityerror\u2464"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-securityerror\u2465"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-securityerror\u2466"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}, {"refs": [{"id": "ref-for-securityerror\u2467"}, {"id": "ref-for-securityerror\u2468"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-securityerror\u2460\u24ea"}, {"id": "ref-for-securityerror\u2460\u2460"}, {"id": "ref-for-securityerror\u2460\u2461"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-securityerror\u2460\u2462"}, {"id": "ref-for-securityerror\u2460\u2463"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-securityerror\u2460\u2464"}, {"id": "ref-for-securityerror\u2460\u2465"}], "title": "6.7. Error handling"}], "external": true}; window.dfnpanelData['95d7775a'] = {"dfnID": "95d7775a", "url": "https://webidl.spec.whatwg.org/#idl-Uint8Array", "dfnText": "Uint8Array", "refSections": [{"refs": [{"id": "ref-for-idl-Uint8Array"}, {"id": "ref-for-idl-Uint8Array\u2460"}], "title": "8. Advertising Data Filter"}], "external": true}; window.dfnpanelData['81dd847b'] = {"dfnID": "81dd847b", "url": "https://webidl.spec.whatwg.org/#unknownerror", "dfnText": "UnknownError", "refSections": [{"refs": [{"id": "ref-for-unknownerror"}], "title": "5.2. BluetoothDevice"}], "external": true}; window.dfnpanelData['d72eb9fa'] = {"dfnID": "d72eb9fa", "url": "https://heycam.github.io/webidl/#dfn-get-buffer-source-copy", "dfnText": "a copy of the bytes held", "refSections": [{"refs": [{"id": "ref-for-dfn-get-buffer-source-copy"}, {"id": "ref-for-dfn-get-buffer-source-copy\u2460"}, {"id": "ref-for-dfn-get-buffer-source-copy\u2461"}, {"id": "ref-for-dfn-get-buffer-source-copy\u2462"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dfn-get-buffer-source-copy\u2463"}, {"id": "ref-for-dfn-get-buffer-source-copy\u2464"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-dfn-get-buffer-source-copy\u2465"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-dfn-get-buffer-source-copy\u2466"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": true}; window.dfnpanelData['dacde8b5'] = {"dfnID": "dacde8b5", "url": "https://webidl.spec.whatwg.org/#a-new-promise", "dfnText": "a new promise", "refSections": [{"refs": [{"id": "ref-for-a-new-promise"}, {"id": "ref-for-a-new-promise\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-a-new-promise\u2461"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-a-new-promise\u2462"}, {"id": "ref-for-a-new-promise\u2463"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-a-new-promise\u2464"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-a-new-promise\u2465"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-a-new-promise\u2466"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-a-new-promise\u2467"}, {"id": "ref-for-a-new-promise\u2468"}, {"id": "ref-for-a-new-promise\u2460\u24ea"}, {"id": "ref-for-a-new-promise\u2460\u2460"}, {"id": "ref-for-a-new-promise\u2460\u2461"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-a-new-promise\u2460\u2462"}], "title": "6.4.1. BluetoothCharacteristicProperties"}, {"refs": [{"id": "ref-for-a-new-promise\u2460\u2463"}, {"id": "ref-for-a-new-promise\u2460\u2464"}, {"id": "ref-for-a-new-promise\u2460\u2465"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": true}; window.dfnpanelData['d0b4a948'] = {"dfnID": "d0b4a948", "url": "https://webidl.spec.whatwg.org/#a-promise-rejected-with", "dfnText": "a promise rejected with", "refSections": [{"refs": [{"id": "ref-for-a-promise-rejected-with"}, {"id": "ref-for-a-promise-rejected-with\u2460"}, {"id": "ref-for-a-promise-rejected-with\u2461"}, {"id": "ref-for-a-promise-rejected-with\u2462"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}, {"refs": [{"id": "ref-for-a-promise-rejected-with\u2463"}, {"id": "ref-for-a-promise-rejected-with\u2464"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-a-promise-rejected-with\u2465"}, {"id": "ref-for-a-promise-rejected-with\u2466"}, {"id": "ref-for-a-promise-rejected-with\u2467"}, {"id": "ref-for-a-promise-rejected-with\u2468"}, {"id": "ref-for-a-promise-rejected-with\u2460\u24ea"}, {"id": "ref-for-a-promise-rejected-with\u2460\u2460"}, {"id": "ref-for-a-promise-rejected-with\u2460\u2461"}, {"id": "ref-for-a-promise-rejected-with\u2460\u2462"}, {"id": "ref-for-a-promise-rejected-with\u2460\u2463"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-a-promise-rejected-with\u2460\u2464"}, {"id": "ref-for-a-promise-rejected-with\u2460\u2465"}, {"id": "ref-for-a-promise-rejected-with\u2460\u2466"}, {"id": "ref-for-a-promise-rejected-with\u2460\u2467"}, {"id": "ref-for-a-promise-rejected-with\u2460\u2468"}, {"id": "ref-for-a-promise-rejected-with\u2461\u24ea"}, {"id": "ref-for-a-promise-rejected-with\u2461\u2460"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-a-promise-rejected-with\u2461\u2461"}], "title": "7. UUIDs"}], "external": true}; window.dfnpanelData['6c6b1005'] = {"dfnID": "6c6b1005", "url": "https://webidl.spec.whatwg.org/#idl-any", "dfnText": "any", "refSections": [{"refs": [{"id": "ref-for-idl-any"}, {"id": "ref-for-idl-any\u2460"}], "title": "4.2. Overall Bluetooth availability"}], "external": true}; window.dfnpanelData['5372cca8'] = {"dfnID": "5372cca8", "url": "https://webidl.spec.whatwg.org/#idl-boolean", "dfnText": "boolean", "refSections": [{"refs": [{"id": "ref-for-idl-boolean"}, {"id": "ref-for-idl-boolean\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-idl-boolean\u2461"}, {"id": "ref-for-idl-boolean\u2462"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-idl-boolean\u2463"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-idl-boolean\u2464"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-idl-boolean\u2465"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-idl-boolean\u2466"}, {"id": "ref-for-idl-boolean\u2467"}, {"id": "ref-for-idl-boolean\u2468"}, {"id": "ref-for-idl-boolean\u2460\u24ea"}, {"id": "ref-for-idl-boolean\u2460\u2460"}, {"id": "ref-for-idl-boolean\u2460\u2461"}, {"id": "ref-for-idl-boolean\u2460\u2462"}, {"id": "ref-for-idl-boolean\u2460\u2463"}, {"id": "ref-for-idl-boolean\u2460\u2464"}], "title": "6.4.1. BluetoothCharacteristicProperties"}], "external": true}; window.dfnpanelData['f4813f78'] = {"dfnID": "f4813f78", "url": "https://webidl.spec.whatwg.org/#idl-byte", "dfnText": "byte", "refSections": [{"refs": [{"id": "ref-for-idl-byte"}, {"id": "ref-for-idl-byte\u2460"}, {"id": "ref-for-idl-byte\u2461"}, {"id": "ref-for-idl-byte\u2462"}], "title": "5.2.3. Responding to Advertising Events"}], "external": true}; window.dfnpanelData['ae4bc361'] = {"dfnID": "ae4bc361", "url": "https://webidl.spec.whatwg.org/#dfn-convert-idl-to-javascript-value", "dfnText": "converted to an ecmascript value", "refSections": [{"refs": [{"id": "ref-for-dfn-convert-idl-to-javascript-value"}, {"id": "ref-for-dfn-convert-idl-to-javascript-value\u2460"}], "title": "4. Device Discovery"}], "external": true}; window.dfnpanelData['77996ab1'] = {"dfnID": "77996ab1", "url": "https://webidl.spec.whatwg.org/#dfn-maplike", "dfnText": "maplike", "refSections": [{"refs": [{"id": "ref-for-dfn-maplike"}], "title": "5.2.3.1. BluetoothManufacturerDataMap"}, {"refs": [{"id": "ref-for-dfn-maplike\u2460"}], "title": "5.2.3.2. BluetoothServiceDataMap"}], "external": true}; window.dfnpanelData['750a2f08'] = {"dfnID": "750a2f08", "url": "https://webidl.spec.whatwg.org/#dfn-perform-steps-once-promise-is-settled", "dfnText": "react", "refSections": [{"refs": [{"id": "ref-for-dfn-perform-steps-once-promise-is-settled"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": true}; window.dfnpanelData['b262501e'] = {"dfnID": "b262501e", "url": "https://webidl.spec.whatwg.org/#reject", "dfnText": "reject", "refSections": [{"refs": [{"id": "ref-for-reject"}, {"id": "ref-for-reject\u2460"}, {"id": "ref-for-reject\u2461"}, {"id": "ref-for-reject\u2462"}, {"id": "ref-for-reject\u2463"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-reject\u2464"}, {"id": "ref-for-reject\u2465"}, {"id": "ref-for-reject\u2466"}, {"id": "ref-for-reject\u2467"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-reject\u2468"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-reject\u2460\u24ea"}, {"id": "ref-for-reject\u2460\u2460"}, {"id": "ref-for-reject\u2460\u2461"}, {"id": "ref-for-reject\u2460\u2462"}, {"id": "ref-for-reject\u2460\u2463"}, {"id": "ref-for-reject\u2460\u2464"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-reject\u2460\u2465"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-reject\u2460\u2466"}, {"id": "ref-for-reject\u2460\u2467"}, {"id": "ref-for-reject\u2460\u2468"}, {"id": "ref-for-reject\u2461\u24ea"}, {"id": "ref-for-reject\u2461\u2460"}, {"id": "ref-for-reject\u2461\u2461"}, {"id": "ref-for-reject\u2461\u2462"}, {"id": "ref-for-reject\u2461\u2463"}, {"id": "ref-for-reject\u2461\u2464"}, {"id": "ref-for-reject\u2461\u2465"}, {"id": "ref-for-reject\u2461\u2466"}, {"id": "ref-for-reject\u2461\u2467"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-reject\u2461\u2468"}], "title": "6.4.1. BluetoothCharacteristicProperties"}, {"refs": [{"id": "ref-for-reject\u2462\u24ea"}, {"id": "ref-for-reject\u2462\u2460"}, {"id": "ref-for-reject\u2462\u2461"}, {"id": "ref-for-reject\u2462\u2462"}, {"id": "ref-for-reject\u2462\u2463"}, {"id": "ref-for-reject\u2462\u2464"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": true}; window.dfnpanelData['3b90bdcd'] = {"dfnID": "3b90bdcd", "url": "https://webidl.spec.whatwg.org/#resolve", "dfnText": "resolve", "refSections": [{"refs": [{"id": "ref-for-resolve"}, {"id": "ref-for-resolve\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-resolve\u2461"}, {"id": "ref-for-resolve\u2462"}, {"id": "ref-for-resolve\u2463"}, {"id": "ref-for-resolve\u2464"}, {"id": "ref-for-resolve\u2465"}, {"id": "ref-for-resolve\u2466"}, {"id": "ref-for-resolve\u2467"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-resolve\u2468"}, {"id": "ref-for-resolve\u2460\u24ea"}, {"id": "ref-for-resolve\u2460\u2460"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-resolve\u2460\u2461"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-resolve\u2460\u2462"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-resolve\u2460\u2463"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-resolve\u2460\u2464"}, {"id": "ref-for-resolve\u2460\u2465"}, {"id": "ref-for-resolve\u2460\u2466"}, {"id": "ref-for-resolve\u2460\u2467"}, {"id": "ref-for-resolve\u2460\u2468"}, {"id": "ref-for-resolve\u2461\u24ea"}, {"id": "ref-for-resolve\u2461\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-resolve\u2461\u2461"}], "title": "6.4.1. BluetoothCharacteristicProperties"}, {"refs": [{"id": "ref-for-resolve\u2461\u2462"}, {"id": "ref-for-resolve\u2461\u2463"}, {"id": "ref-for-resolve\u2461\u2464"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": true}; window.dfnpanelData['9cce47fd'] = {"dfnID": "9cce47fd", "url": "https://webidl.spec.whatwg.org/#idl-sequence", "dfnText": "sequence", "refSections": [{"refs": [{"id": "ref-for-idl-sequence"}, {"id": "ref-for-idl-sequence\u2460"}, {"id": "ref-for-idl-sequence\u2461"}, {"id": "ref-for-idl-sequence\u2462"}, {"id": "ref-for-idl-sequence\u2463"}, {"id": "ref-for-idl-sequence\u2464"}, {"id": "ref-for-idl-sequence\u2465"}, {"id": "ref-for-idl-sequence\u2466"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-idl-sequence\u2467"}, {"id": "ref-for-idl-sequence\u2468"}, {"id": "ref-for-idl-sequence\u2460\u24ea"}, {"id": "ref-for-idl-sequence\u2460\u2460"}, {"id": "ref-for-idl-sequence\u2460\u2461"}, {"id": "ref-for-idl-sequence\u2460\u2462"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-idl-sequence\u2460\u2463"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-idl-sequence\u2460\u2464"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-idl-sequence\u2460\u2465"}, {"id": "ref-for-idl-sequence\u2460\u2466"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-idl-sequence\u2460\u2467"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": true}; window.dfnpanelData['4013a022'] = {"dfnID": "4013a022", "url": "https://webidl.spec.whatwg.org/#this", "dfnText": "this", "refSections": [{"refs": [{"id": "ref-for-this"}, {"id": "ref-for-this\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-this\u2461"}, {"id": "ref-for-this\u2462"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-this\u2463"}], "title": "10. Extensions to the Navigator Interface"}], "external": true}; window.dfnpanelData['5f90bbfb'] = {"dfnID": "5f90bbfb", "url": "https://webidl.spec.whatwg.org/#idl-undefined", "dfnText": "undefined", "refSections": [{"refs": [{"id": "ref-for-idl-undefined"}, {"id": "ref-for-idl-undefined\u2460"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-idl-undefined\u2461"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-idl-undefined\u2462"}, {"id": "ref-for-idl-undefined\u2463"}, {"id": "ref-for-idl-undefined\u2464"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-idl-undefined\u2465"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": true}; window.dfnpanelData['e97a9688'] = {"dfnID": "e97a9688", "url": "https://webidl.spec.whatwg.org/#idl-unsigned-long", "dfnText": "unsigned long", "refSections": [{"refs": [{"id": "ref-for-idl-unsigned-long"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-idl-unsigned-long\u2460"}, {"id": "ref-for-idl-unsigned-long\u2461"}, {"id": "ref-for-idl-unsigned-long\u2462"}, {"id": "ref-for-idl-unsigned-long\u2463"}, {"id": "ref-for-idl-unsigned-long\u2464"}, {"id": "ref-for-idl-unsigned-long\u2465"}, {"id": "ref-for-idl-unsigned-long\u2466"}], "title": "7.1. Standardized UUIDs"}], "external": true}; window.dfnpanelData['450958f7'] = {"dfnID": "450958f7", "url": "https://webidl.spec.whatwg.org/#idl-unsigned-short", "dfnText": "unsigned short", "refSections": [{"refs": [{"id": "ref-for-idl-unsigned-short"}, {"id": "ref-for-idl-unsigned-short\u2460"}, {"id": "ref-for-idl-unsigned-short\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-idl-unsigned-short\u2462"}, {"id": "ref-for-idl-unsigned-short\u2463"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-idl-unsigned-short\u2464"}, {"id": "ref-for-idl-unsigned-short\u2465"}, {"id": "ref-for-idl-unsigned-short\u2466"}, {"id": "ref-for-idl-unsigned-short\u2467"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-idl-unsigned-short\u2468"}], "title": "12.2.1.4. The bluetooth.ScanRecord Type"}], "external": true}; window.dfnpanelData['24bd7d25'] = {"dfnID": "24bd7d25", "url": "https://webidl.spec.whatwg.org/#upon-fulfillment", "dfnText": "upon fulfillment", "refSections": [{"refs": [{"id": "ref-for-upon-fulfillment"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}], "external": true}; window.dfnpanelData['4986aca5'] = {"dfnID": "4986aca5", "url": "https://webidl.spec.whatwg.org/#wait-for-all", "dfnText": "waiting for all", "refSections": [{"refs": [{"id": "ref-for-wait-for-all"}], "title": "6.1.2. The Bluetooth cache"}], "external": true}; window.dfnpanelData['dictdef-bluetoothdatafilterinit'] = {"dfnID": "dictdef-bluetoothdatafilterinit", "url": "#dictdef-bluetoothdatafilterinit", "dfnText": "BluetoothDataFilterInit", "refSections": [{"refs": [{"id": "ref-for-dictdef-bluetoothdatafilterinit"}, {"id": "ref-for-dictdef-bluetoothdatafilterinit\u2460"}, {"id": "ref-for-dictdef-bluetoothdatafilterinit\u2461"}, {"id": "ref-for-dictdef-bluetoothdatafilterinit\u2462"}, {"id": "ref-for-dictdef-bluetoothdatafilterinit\u2463"}, {"id": "ref-for-dictdef-bluetoothdatafilterinit\u2464"}, {"id": "ref-for-dictdef-bluetoothdatafilterinit\u2465"}, {"id": "ref-for-dictdef-bluetoothdatafilterinit\u2466"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dictdef-bluetoothdatafilterinit\u2467"}], "title": "8. Advertising Data Filter"}, {"refs": [{"id": "ref-for-dictdef-bluetoothdatafilterinit\u2468"}], "title": "9. The Blocklist"}], "external": false}; window.dfnpanelData['dom-bluetoothdatafilterinit-dataprefix'] = {"dfnID": "dom-bluetoothdatafilterinit-dataprefix", "url": "#dom-bluetoothdatafilterinit-dataprefix", "dfnText": "dataPrefix", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdatafilterinit-dataprefix"}, {"id": "ref-for-dom-bluetoothdatafilterinit-dataprefix\u2460"}, {"id": "ref-for-dom-bluetoothdatafilterinit-dataprefix\u2461"}, {"id": "ref-for-dom-bluetoothdatafilterinit-dataprefix\u2462"}, {"id": "ref-for-dom-bluetoothdatafilterinit-dataprefix\u2463"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-bluetoothdatafilterinit-dataprefix\u2464"}], "title": "8. Advertising Data Filter"}], "external": false}; window.dfnpanelData['dom-bluetoothdatafilterinit-mask'] = {"dfnID": "dom-bluetoothdatafilterinit-mask", "url": "#dom-bluetoothdatafilterinit-mask", "dfnText": "mask", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdatafilterinit-mask"}, {"id": "ref-for-dom-bluetoothdatafilterinit-mask\u2460"}, {"id": "ref-for-dom-bluetoothdatafilterinit-mask\u2461"}, {"id": "ref-for-dom-bluetoothdatafilterinit-mask\u2462"}, {"id": "ref-for-dom-bluetoothdatafilterinit-mask\u2463"}, {"id": "ref-for-dom-bluetoothdatafilterinit-mask\u2464"}, {"id": "ref-for-dom-bluetoothdatafilterinit-mask\u2465"}, {"id": "ref-for-dom-bluetoothdatafilterinit-mask\u2466"}, {"id": "ref-for-dom-bluetoothdatafilterinit-mask\u2467"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-bluetoothdatafilterinit-mask\u2468"}], "title": "8. Advertising Data Filter"}], "external": false}; window.dfnpanelData['dictdef-bluetoothmanufacturerdatafilterinit'] = {"dfnID": "dictdef-bluetoothmanufacturerdatafilterinit", "url": "#dictdef-bluetoothmanufacturerdatafilterinit", "dfnText": "BluetoothManufacturerDataFilterInit", "refSections": [{"refs": [{"id": "ref-for-dictdef-bluetoothmanufacturerdatafilterinit"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-bluetoothmanufacturerdatafilterinit-companyidentifier'] = {"dfnID": "dom-bluetoothmanufacturerdatafilterinit-companyidentifier", "url": "#dom-bluetoothmanufacturerdatafilterinit-companyidentifier", "dfnText": "companyIdentifier", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothmanufacturerdatafilterinit-companyidentifier"}, {"id": "ref-for-dom-bluetoothmanufacturerdatafilterinit-companyidentifier\u2460"}, {"id": "ref-for-dom-bluetoothmanufacturerdatafilterinit-companyidentifier\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-bluetoothmanufacturerdatafilterinit-companyidentifier\u2462"}], "title": "9. The Blocklist"}], "external": false}; window.dfnpanelData['dictdef-bluetoothservicedatafilterinit'] = {"dfnID": "dictdef-bluetoothservicedatafilterinit", "url": "#dictdef-bluetoothservicedatafilterinit", "dfnText": "BluetoothServiceDataFilterInit", "refSections": [{"refs": [{"id": "ref-for-dictdef-bluetoothservicedatafilterinit"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-bluetoothservicedatafilterinit-service'] = {"dfnID": "dom-bluetoothservicedatafilterinit-service", "url": "#dom-bluetoothservicedatafilterinit-service", "dfnText": "service", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothservicedatafilterinit-service"}, {"id": "ref-for-dom-bluetoothservicedatafilterinit-service\u2460"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dictdef-bluetoothlescanfilterinit'] = {"dfnID": "dictdef-bluetoothlescanfilterinit", "url": "#dictdef-bluetoothlescanfilterinit", "dfnText": "BluetoothLEScanFilterInit", "refSections": [{"refs": [{"id": "ref-for-dictdef-bluetoothlescanfilterinit"}, {"id": "ref-for-dictdef-bluetoothlescanfilterinit\u2460"}, {"id": "ref-for-dictdef-bluetoothlescanfilterinit\u2461"}, {"id": "ref-for-dictdef-bluetoothlescanfilterinit\u2462"}, {"id": "ref-for-dictdef-bluetoothlescanfilterinit\u2463"}, {"id": "ref-for-dictdef-bluetoothlescanfilterinit\u2464"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dictdef-bluetoothlescanfilterinit\u2465"}], "title": "4.1. Permission API Integration"}], "external": false}; window.dfnpanelData['dictdef-requestdeviceoptions'] = {"dfnID": "dictdef-requestdeviceoptions", "url": "#dictdef-requestdeviceoptions", "dfnText": "RequestDeviceOptions", "refSections": [{"refs": [{"id": "ref-for-dictdef-requestdeviceoptions"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['bluetooth'] = {"dfnID": "bluetooth", "url": "#bluetooth", "dfnText": "Bluetooth", "refSections": [{"refs": [{"id": "ref-for-bluetooth"}, {"id": "ref-for-bluetooth\u2460"}, {"id": "ref-for-bluetooth\u2461"}, {"id": "ref-for-bluetooth\u2462"}, {"id": "ref-for-bluetooth\u2463"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-bluetooth\u2464"}, {"id": "ref-for-bluetooth\u2465"}, {"id": "ref-for-bluetooth\u2466"}, {"id": "ref-for-bluetooth\u2467"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-bluetooth\u2468"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-bluetooth\u2460\u24ea"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-bluetooth\u2460\u2460"}], "title": "6.6.2. Event types"}, {"refs": [{"id": "ref-for-bluetooth\u2460\u2461"}, {"id": "ref-for-bluetooth\u2460\u2462"}, {"id": "ref-for-bluetooth\u2460\u2463"}], "title": "10. Extensions to the Navigator Interface"}], "external": false}; window.dfnpanelData['dom-requestdeviceoptions-filters'] = {"dfnID": "dom-requestdeviceoptions-filters", "url": "#dom-requestdeviceoptions-filters", "dfnText": "filters", "refSections": [{"refs": [{"id": "ref-for-dom-requestdeviceoptions-filters"}, {"id": "ref-for-dom-requestdeviceoptions-filters\u2460"}, {"id": "ref-for-dom-requestdeviceoptions-filters\u2461"}, {"id": "ref-for-dom-requestdeviceoptions-filters\u2462"}, {"id": "ref-for-dom-requestdeviceoptions-filters\u2463"}, {"id": "ref-for-dom-requestdeviceoptions-filters\u2464"}, {"id": "ref-for-dom-requestdeviceoptions-filters\u2465"}, {"id": "ref-for-dom-requestdeviceoptions-filters\u2466"}, {"id": "ref-for-dom-requestdeviceoptions-filters\u2467"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-requestdeviceoptions-exclusionfilters'] = {"dfnID": "dom-requestdeviceoptions-exclusionfilters", "url": "#dom-requestdeviceoptions-exclusionfilters", "dfnText": "exclusionFilters", "refSections": [{"refs": [{"id": "ref-for-dom-requestdeviceoptions-exclusionfilters"}, {"id": "ref-for-dom-requestdeviceoptions-exclusionfilters\u2460"}, {"id": "ref-for-dom-requestdeviceoptions-exclusionfilters\u2461"}, {"id": "ref-for-dom-requestdeviceoptions-exclusionfilters\u2462"}, {"id": "ref-for-dom-requestdeviceoptions-exclusionfilters\u2463"}, {"id": "ref-for-dom-requestdeviceoptions-exclusionfilters\u2464"}, {"id": "ref-for-dom-requestdeviceoptions-exclusionfilters\u2465"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-bluetoothlescanfilterinit-services'] = {"dfnID": "dom-bluetoothlescanfilterinit-services", "url": "#dom-bluetoothlescanfilterinit-services", "dfnText": "services", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothlescanfilterinit-services"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-services\u2460"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-services\u2461"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-services\u2462"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-bluetoothlescanfilterinit-name'] = {"dfnID": "dom-bluetoothlescanfilterinit-name", "url": "#dom-bluetoothlescanfilterinit-name", "dfnText": "name", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothlescanfilterinit-name"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-name\u2460"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-name\u2461"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-bluetoothlescanfilterinit-nameprefix'] = {"dfnID": "dom-bluetoothlescanfilterinit-nameprefix", "url": "#dom-bluetoothlescanfilterinit-nameprefix", "dfnText": "namePrefix", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothlescanfilterinit-nameprefix"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-nameprefix\u2460"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-nameprefix\u2461"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-bluetoothlescanfilterinit-manufacturerdata'] = {"dfnID": "dom-bluetoothlescanfilterinit-manufacturerdata", "url": "#dom-bluetoothlescanfilterinit-manufacturerdata", "dfnText": "manufacturerData", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothlescanfilterinit-manufacturerdata"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-manufacturerdata\u2460"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-manufacturerdata\u2461"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-manufacturerdata\u2462"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-manufacturerdata\u2463"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-bluetoothlescanfilterinit-servicedata'] = {"dfnID": "dom-bluetoothlescanfilterinit-servicedata", "url": "#dom-bluetoothlescanfilterinit-servicedata", "dfnText": "serviceData", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothlescanfilterinit-servicedata"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-servicedata\u2460"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-servicedata\u2461"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-servicedata\u2462"}, {"id": "ref-for-dom-bluetoothlescanfilterinit-servicedata\u2463"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-requestdeviceoptions-acceptalldevices'] = {"dfnID": "dom-requestdeviceoptions-acceptalldevices", "url": "#dom-requestdeviceoptions-acceptalldevices", "dfnText": "acceptAllDevices", "refSections": [{"refs": [{"id": "ref-for-dom-requestdeviceoptions-acceptalldevices"}, {"id": "ref-for-dom-requestdeviceoptions-acceptalldevices\u2460"}, {"id": "ref-for-dom-requestdeviceoptions-acceptalldevices\u2461"}, {"id": "ref-for-dom-requestdeviceoptions-acceptalldevices\u2462"}, {"id": "ref-for-dom-requestdeviceoptions-acceptalldevices\u2463"}, {"id": "ref-for-dom-requestdeviceoptions-acceptalldevices\u2464"}, {"id": "ref-for-dom-requestdeviceoptions-acceptalldevices\u2465"}, {"id": "ref-for-dom-requestdeviceoptions-acceptalldevices\u2466"}, {"id": "ref-for-dom-requestdeviceoptions-acceptalldevices\u2467"}, {"id": "ref-for-dom-requestdeviceoptions-acceptalldevices\u2468"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-requestdeviceoptions-optionalservices'] = {"dfnID": "dom-requestdeviceoptions-optionalservices", "url": "#dom-requestdeviceoptions-optionalservices", "dfnText": "optionalServices", "refSections": [{"refs": [{"id": "ref-for-dom-requestdeviceoptions-optionalservices"}, {"id": "ref-for-dom-requestdeviceoptions-optionalservices\u2460"}, {"id": "ref-for-dom-requestdeviceoptions-optionalservices\u2461"}, {"id": "ref-for-dom-requestdeviceoptions-optionalservices\u2462"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-requestdeviceoptions-optionalmanufacturerdata'] = {"dfnID": "dom-requestdeviceoptions-optionalmanufacturerdata", "url": "#dom-requestdeviceoptions-optionalmanufacturerdata", "dfnText": "optionalManufacturerData", "refSections": [{"refs": [{"id": "ref-for-dom-requestdeviceoptions-optionalmanufacturerdata"}, {"id": "ref-for-dom-requestdeviceoptions-optionalmanufacturerdata\u2460"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-bluetooth-deviceinstancemap-slot'] = {"dfnID": "dom-bluetooth-deviceinstancemap-slot", "url": "#dom-bluetooth-deviceinstancemap-slot", "dfnText": "[[deviceInstanceMap]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetooth-deviceinstancemap-slot"}, {"id": "ref-for-dom-bluetooth-deviceinstancemap-slot\u2460"}, {"id": "ref-for-dom-bluetooth-deviceinstancemap-slot\u2461"}, {"id": "ref-for-dom-bluetooth-deviceinstancemap-slot\u2462"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-dom-bluetooth-deviceinstancemap-slot\u2463"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": false}; window.dfnpanelData['dom-bluetooth-attributeinstancemap-slot'] = {"dfnID": "dom-bluetooth-attributeinstancemap-slot", "url": "#dom-bluetooth-attributeinstancemap-slot", "dfnText": "[[attributeInstanceMap]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetooth-attributeinstancemap-slot"}, {"id": "ref-for-dom-bluetooth-attributeinstancemap-slot\u2460"}, {"id": "ref-for-dom-bluetooth-attributeinstancemap-slot\u2461"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-dom-bluetooth-attributeinstancemap-slot\u2462"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-dom-bluetooth-attributeinstancemap-slot\u2463"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['dom-bluetooth-referringdevice-slot'] = {"dfnID": "dom-bluetooth-referringdevice-slot", "url": "#dom-bluetooth-referringdevice-slot", "dfnText": "[[referringDevice]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetooth-referringdevice-slot"}, {"id": "ref-for-dom-bluetooth-referringdevice-slot\u2460"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-bluetooth-referringdevice'] = {"dfnID": "dom-bluetooth-referringdevice", "url": "#dom-bluetooth-referringdevice", "dfnText": "referringDevice", "refSections": [{"refs": [{"id": "ref-for-dom-bluetooth-referringdevice"}, {"id": "ref-for-dom-bluetooth-referringdevice\u2460"}, {"id": "ref-for-dom-bluetooth-referringdevice\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-bluetooth-referringdevice\u2462"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['matches-a-filter'] = {"dfnID": "matches-a-filter", "url": "#matches-a-filter", "dfnText": "matches a filter", "refSections": [{"refs": [{"id": "ref-for-matches-a-filter"}, {"id": "ref-for-matches-a-filter\u2460"}, {"id": "ref-for-matches-a-filter\u2461"}, {"id": "ref-for-matches-a-filter\u2462"}, {"id": "ref-for-matches-a-filter\u2463"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-matches-a-filter\u2464"}], "title": "4.1. Permission API Integration"}], "external": false}; window.dfnpanelData['bluetoothdatafilterinit-matches'] = {"dfnID": "bluetoothdatafilterinit-matches", "url": "#bluetoothdatafilterinit-matches", "dfnText": "matches", "refSections": [{"refs": [{"id": "ref-for-bluetoothdatafilterinit-matches"}, {"id": "ref-for-bluetoothdatafilterinit-matches\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-bluetoothdatafilterinit-matches\u2461"}], "title": "9. The Blocklist"}], "external": false}; window.dfnpanelData['bluetoothdatafilterinit-strict-subset'] = {"dfnID": "bluetoothdatafilterinit-strict-subset", "url": "#bluetoothdatafilterinit-strict-subset", "dfnText": "strict subset", "refSections": [{"refs": [{"id": "ref-for-bluetoothdatafilterinit-strict-subset"}], "title": "9. The Blocklist"}], "external": false}; window.dfnpanelData['dom-bluetooth-getdevices'] = {"dfnID": "dom-bluetooth-getdevices", "url": "#dom-bluetooth-getdevices", "dfnText": "getDevices()", "refSections": [{"refs": [{"id": "ref-for-dom-bluetooth-getdevices"}, {"id": "ref-for-dom-bluetooth-getdevices\u2460"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['dom-bluetooth-requestdevice'] = {"dfnID": "dom-bluetooth-requestdevice", "url": "#dom-bluetooth-requestdevice", "dfnText": "requestDevice(options)\n", "refSections": [{"refs": [{"id": "ref-for-dom-bluetooth-requestdevice"}], "title": "1.1. Examples"}, {"refs": [{"id": "ref-for-dom-bluetooth-requestdevice\u2460"}], "title": "3.1. Device access is powerful"}, {"refs": [{"id": "ref-for-dom-bluetooth-requestdevice\u2461"}, {"id": "ref-for-dom-bluetooth-requestdevice\u2462"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-bluetooth-requestdevice\u2463"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-dom-bluetooth-requestdevice\u2464"}], "title": "13. Terminology and Conventions"}], "external": false}; window.dfnpanelData['request-bluetooth-devices'] = {"dfnID": "request-bluetooth-devices", "url": "#request-bluetooth-devices", "dfnText": "request Bluetooth devices", "refSections": [{"refs": [{"id": "ref-for-request-bluetooth-devices"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['bluetoothlescanfilterinit-canonicalizing'] = {"dfnID": "bluetoothlescanfilterinit-canonicalizing", "url": "#bluetoothlescanfilterinit-canonicalizing", "dfnText": "canonicalizing", "refSections": [{"refs": [{"id": "ref-for-bluetoothlescanfilterinit-canonicalizing"}, {"id": "ref-for-bluetoothlescanfilterinit-canonicalizing\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-bluetoothlescanfilterinit-canonicalizing\u2461"}], "title": "4.1. Permission API Integration"}], "external": false}; window.dfnpanelData['bluetoothdatafilterinit-canonicalizing'] = {"dfnID": "bluetoothdatafilterinit-canonicalizing", "url": "#bluetoothdatafilterinit-canonicalizing", "dfnText": "canonicalizing", "refSections": [{"refs": [{"id": "ref-for-bluetoothdatafilterinit-canonicalizing"}, {"id": "ref-for-bluetoothdatafilterinit-canonicalizing\u2460"}, {"id": "ref-for-bluetoothdatafilterinit-canonicalizing\u2461"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['scan-for-devices'] = {"dfnID": "scan-for-devices", "url": "#scan-for-devices", "dfnText": "scan for devices", "refSections": [{"refs": [{"id": "ref-for-scan-for-devices"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-scan-for-devices\u2460"}, {"id": "ref-for-scan-for-devices\u2461"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": false}; window.dfnpanelData['add-device-to-storage'] = {"dfnID": "add-device-to-storage", "url": "#add-device-to-storage", "dfnText": "add an allowed\nBluetooth device", "refSections": [{"refs": [{"id": "ref-for-add-device-to-storage"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['remove-device-from-storage'] = {"dfnID": "remove-device-from-storage", "url": "#remove-device-from-storage", "dfnText": "remove an allowed Bluetooth\ndevice", "refSections": [{"refs": [{"id": "ref-for-remove-device-from-storage"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['permissiondef-bluetooth'] = {"dfnID": "permissiondef-bluetooth", "url": "#permissiondef-bluetooth", "dfnText": "\"bluetooth\"", "refSections": [{"refs": [{"id": "ref-for-permissiondef-bluetooth"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-permissiondef-bluetooth\u2460"}, {"id": "ref-for-permissiondef-bluetooth\u2461"}, {"id": "ref-for-permissiondef-bluetooth\u2462"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-permissiondef-bluetooth\u2463"}, {"id": "ref-for-permissiondef-bluetooth\u2464"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-permissiondef-bluetooth\u2465"}], "title": "6.6.1. Bluetooth Tree"}], "external": false}; window.dfnpanelData['dictdef-bluetoothpermissiondescriptor'] = {"dfnID": "dictdef-bluetoothpermissiondescriptor", "url": "#dictdef-bluetoothpermissiondescriptor", "dfnText": "BluetoothPermissionDescriptor", "refSections": [{"refs": [{"id": "ref-for-dictdef-bluetoothpermissiondescriptor"}], "title": "4.1. Permission API Integration"}], "external": false}; window.dfnpanelData['dictdef-allowedbluetoothdevice'] = {"dfnID": "dictdef-allowedbluetoothdevice", "url": "#dictdef-allowedbluetoothdevice", "dfnText": "AllowedBluetoothDevice", "refSections": [{"refs": [{"id": "ref-for-dictdef-allowedbluetoothdevice"}, {"id": "ref-for-dictdef-allowedbluetoothdevice\u2460"}, {"id": "ref-for-dictdef-allowedbluetoothdevice\u2461"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dictdef-allowedbluetoothdevice\u2462"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['dom-allowedbluetoothdevice-deviceid'] = {"dfnID": "dom-allowedbluetoothdevice-deviceid", "url": "#dom-allowedbluetoothdevice-deviceid", "dfnText": "deviceId", "refSections": [{"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-deviceid"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-deviceid\u2460"}, {"id": "ref-for-dom-allowedbluetoothdevice-deviceid\u2461"}, {"id": "ref-for-dom-allowedbluetoothdevice-deviceid\u2462"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-deviceid\u2463"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['dom-allowedbluetoothdevice-mayusegatt'] = {"dfnID": "dom-allowedbluetoothdevice-mayusegatt", "url": "#dom-allowedbluetoothdevice-mayusegatt", "dfnText": "mayUseGATT", "refSections": [{"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-mayusegatt"}, {"id": "ref-for-dom-allowedbluetoothdevice-mayusegatt\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-mayusegatt\u2461"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-mayusegatt\u2462"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['dom-allowedbluetoothdevice-allowedservices'] = {"dfnID": "dom-allowedbluetoothdevice-allowedservices", "url": "#dom-allowedbluetoothdevice-allowedservices", "dfnText": "allowedServices", "refSections": [{"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-allowedservices"}, {"id": "ref-for-dom-allowedbluetoothdevice-allowedservices\u2460"}, {"id": "ref-for-dom-allowedbluetoothdevice-allowedservices\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-allowedservices\u2462"}, {"id": "ref-for-dom-allowedbluetoothdevice-allowedservices\u2463"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-allowedservices\u2464"}, {"id": "ref-for-dom-allowedbluetoothdevice-allowedservices\u2465"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-allowedservices\u2466"}], "title": "6.6.1. Bluetooth Tree"}], "external": false}; window.dfnpanelData['dom-allowedbluetoothdevice-allowedmanufacturerdata'] = {"dfnID": "dom-allowedbluetoothdevice-allowedmanufacturerdata", "url": "#dom-allowedbluetoothdevice-allowedmanufacturerdata", "dfnText": "allowedManufacturerData", "refSections": [{"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-allowedmanufacturerdata"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-allowedmanufacturerdata\u2460"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-allowedmanufacturerdata\u2461"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['dictdef-bluetoothpermissionstorage'] = {"dfnID": "dictdef-bluetoothpermissionstorage", "url": "#dictdef-bluetoothpermissionstorage", "dfnText": "BluetoothPermissionStorage", "refSections": [{"refs": [{"id": "ref-for-dictdef-bluetoothpermissionstorage"}, {"id": "ref-for-dictdef-bluetoothpermissionstorage\u2460"}, {"id": "ref-for-dictdef-bluetoothpermissionstorage\u2461"}, {"id": "ref-for-dictdef-bluetoothpermissionstorage\u2462"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dictdef-bluetoothpermissionstorage\u2463"}, {"id": "ref-for-dictdef-bluetoothpermissionstorage\u2464"}, {"id": "ref-for-dictdef-bluetoothpermissionstorage\u2465"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dictdef-bluetoothpermissionstorage\u2466"}, {"id": "ref-for-dictdef-bluetoothpermissionstorage\u2467"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['dom-bluetoothpermissionstorage-alloweddevices'] = {"dfnID": "dom-bluetoothpermissionstorage-alloweddevices", "url": "#dom-bluetoothpermissionstorage-alloweddevices", "dfnText": "allowedDevices", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothpermissionstorage-alloweddevices"}, {"id": "ref-for-dom-bluetoothpermissionstorage-alloweddevices\u2460"}, {"id": "ref-for-dom-bluetoothpermissionstorage-alloweddevices\u2461"}, {"id": "ref-for-dom-bluetoothpermissionstorage-alloweddevices\u2462"}, {"id": "ref-for-dom-bluetoothpermissionstorage-alloweddevices\u2463"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-bluetoothpermissionstorage-alloweddevices\u2464"}, {"id": "ref-for-dom-bluetoothpermissionstorage-alloweddevices\u2465"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dom-bluetoothpermissionstorage-alloweddevices\u2466"}, {"id": "ref-for-dom-bluetoothpermissionstorage-alloweddevices\u2467"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-dom-bluetoothpermissionstorage-alloweddevices\u2468"}], "title": "6.6.1. Bluetooth Tree"}], "external": false}; window.dfnpanelData['dom-allowedbluetoothdevice-device-slot'] = {"dfnID": "dom-allowedbluetoothdevice-device-slot", "url": "#dom-allowedbluetoothdevice-device-slot", "dfnText": "[[device]]", "refSections": [{"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-device-slot"}, {"id": "ref-for-dom-allowedbluetoothdevice-device-slot\u2460"}, {"id": "ref-for-dom-allowedbluetoothdevice-device-slot\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-device-slot\u2462"}, {"id": "ref-for-dom-allowedbluetoothdevice-device-slot\u2463"}, {"id": "ref-for-dom-allowedbluetoothdevice-device-slot\u2464"}, {"id": "ref-for-dom-allowedbluetoothdevice-device-slot\u2465"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dom-allowedbluetoothdevice-device-slot\u2466"}, {"id": "ref-for-dom-allowedbluetoothdevice-device-slot\u2467"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['bluetoothpermissionresult'] = {"dfnID": "bluetoothpermissionresult", "url": "#bluetoothpermissionresult", "dfnText": "BluetoothPermissionResult", "refSections": [{"refs": [{"id": "ref-for-bluetoothpermissionresult"}], "title": "4.1. Permission API Integration"}], "external": false}; window.dfnpanelData['dom-bluetoothpermissionresult-devices'] = {"dfnID": "dom-bluetoothpermissionresult-devices", "url": "#dom-bluetoothpermissionresult-devices", "dfnText": "devices", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothpermissionresult-devices"}], "title": "4.1. Permission API Integration"}], "external": false}; window.dfnpanelData['revoke-bluetooth-access'] = {"dfnID": "revoke-bluetooth-access", "url": "#revoke-bluetooth-access", "dfnText": "revoke Bluetooth access", "refSections": [{"refs": [{"id": "ref-for-revoke-bluetooth-access"}], "title": "3.1. Device access is powerful"}, {"refs": [{"id": "ref-for-revoke-bluetooth-access\u2460"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['dom-bluetooth-getavailability'] = {"dfnID": "dom-bluetooth-getavailability", "url": "#dom-bluetooth-getavailability", "dfnText": "getAvailability()", "refSections": [{"refs": [{"id": "ref-for-dom-bluetooth-getavailability"}], "title": "3.5. Exposing Bluetooth availability"}, {"refs": [{"id": "ref-for-dom-bluetooth-getavailability\u2460"}, {"id": "ref-for-dom-bluetooth-getavailability\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-bluetooth-getavailability\u2462"}, {"id": "ref-for-dom-bluetooth-getavailability\u2463"}, {"id": "ref-for-dom-bluetooth-getavailability\u2464"}, {"id": "ref-for-dom-bluetooth-getavailability\u2465"}, {"id": "ref-for-dom-bluetooth-getavailability\u2466"}, {"id": "ref-for-dom-bluetooth-getavailability\u2467"}], "title": "4.2. Overall Bluetooth availability"}], "external": false}; window.dfnpanelData['valueevent'] = {"dfnID": "valueevent", "url": "#valueevent", "dfnText": "ValueEvent", "refSections": [{"refs": [{"id": "ref-for-valueevent"}, {"id": "ref-for-valueevent\u2460"}], "title": "4.2. Overall Bluetooth availability"}], "external": false}; window.dfnpanelData['dictdef-valueeventinit'] = {"dfnID": "dictdef-valueeventinit", "url": "#dictdef-valueeventinit", "dfnText": "ValueEventInit", "refSections": [{"refs": [{"id": "ref-for-dictdef-valueeventinit"}], "title": "4.2. Overall Bluetooth availability"}], "external": false}; window.dfnpanelData['dom-valueevent-value'] = {"dfnID": "dom-valueevent-value", "url": "#dom-valueevent-value", "dfnText": "value", "refSections": [{"refs": [{"id": "ref-for-dom-valueevent-value"}, {"id": "ref-for-dom-valueevent-value\u2460"}], "title": "4.2. Overall Bluetooth availability"}], "external": false}; window.dfnpanelData['bluetooth-device'] = {"dfnID": "bluetooth-device", "url": "#bluetooth-device", "dfnText": "Bluetooth device", "refSections": [{"refs": [{"id": "ref-for-bluetooth-device"}, {"id": "ref-for-bluetooth-device\u2460"}, {"id": "ref-for-bluetooth-device\u2461"}, {"id": "ref-for-bluetooth-device\u2462"}, {"id": "ref-for-bluetooth-device\u2463"}, {"id": "ref-for-bluetooth-device\u2464"}, {"id": "ref-for-bluetooth-device\u2465"}, {"id": "ref-for-bluetooth-device\u2466"}, {"id": "ref-for-bluetooth-device\u2467"}, {"id": "ref-for-bluetooth-device\u2468"}, {"id": "ref-for-bluetooth-device\u2460\u24ea"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-bluetooth-device\u2460\u2460"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-bluetooth-device\u2460\u2461"}], "title": "5.1. Global Bluetooth device properties"}, {"refs": [{"id": "ref-for-bluetooth-device\u2460\u2462"}, {"id": "ref-for-bluetooth-device\u2460\u2463"}, {"id": "ref-for-bluetooth-device\u2460\u2464"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-bluetooth-device\u2460\u2465"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-bluetooth-device\u2460\u2466"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-bluetooth-device\u2460\u2467"}], "title": "6.6.5. Responding to Service Changes"}, {"refs": [{"id": "ref-for-bluetooth-device\u2460\u2468"}], "title": "12. Automated testing"}, {"refs": [{"id": "ref-for-bluetooth-device\u2461\u24ea"}], "title": "12.2.1.1. The bluetooth.RequestDevice Type"}, {"refs": [{"id": "ref-for-bluetooth-device\u2461\u2460"}, {"id": "ref-for-bluetooth-device\u2461\u2461"}, {"id": "ref-for-bluetooth-device\u2461\u2462"}], "title": "12.2.1.4. The bluetooth.ScanRecord Type"}, {"refs": [{"id": "ref-for-bluetooth-device\u2461\u2463"}], "title": "12.2.4.1. The bluetooth.requestDevicePromptUpdated Event"}], "external": false}; window.dfnpanelData['supported-physical-transports'] = {"dfnID": "supported-physical-transports", "url": "#supported-physical-transports", "dfnText": "supported physical transports", "refSections": [{"refs": [{"id": "ref-for-supported-physical-transports"}, {"id": "ref-for-supported-physical-transports\u2460"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['same-bluetooth-device'] = {"dfnID": "same-bluetooth-device", "url": "#same-bluetooth-device", "dfnText": "same Bluetooth device", "refSections": [{"refs": [{"id": "ref-for-same-bluetooth-device"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-same-bluetooth-device\u2460"}, {"id": "ref-for-same-bluetooth-device\u2461"}, {"id": "ref-for-same-bluetooth-device\u2462"}, {"id": "ref-for-same-bluetooth-device\u2463"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-same-bluetooth-device\u2464"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-same-bluetooth-device\u2465"}, {"id": "ref-for-same-bluetooth-device\u2466"}], "title": "6.1.4. Identifying Services, Characteristics, and Descriptors"}, {"refs": [{"id": "ref-for-same-bluetooth-device\u2467"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-same-bluetooth-device\u2468"}], "title": "6.6.3. Responding to Disconnection"}], "external": false}; window.dfnpanelData['bluetoothdevice'] = {"dfnID": "bluetoothdevice", "url": "#bluetoothdevice", "dfnText": "BluetoothDevice", "refSections": [{"refs": [{"id": "ref-for-bluetoothdevice"}, {"id": "ref-for-bluetoothdevice\u2460"}, {"id": "ref-for-bluetoothdevice\u2461"}, {"id": "ref-for-bluetoothdevice\u2462"}, {"id": "ref-for-bluetoothdevice\u2463"}, {"id": "ref-for-bluetoothdevice\u2464"}, {"id": "ref-for-bluetoothdevice\u2465"}, {"id": "ref-for-bluetoothdevice\u2466"}, {"id": "ref-for-bluetoothdevice\u2467"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2468"}, {"id": "ref-for-bluetoothdevice\u2460\u24ea"}, {"id": "ref-for-bluetoothdevice\u2460\u2460"}, {"id": "ref-for-bluetoothdevice\u2460\u2461"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2460\u2462"}, {"id": "ref-for-bluetoothdevice\u2460\u2463"}, {"id": "ref-for-bluetoothdevice\u2460\u2464"}, {"id": "ref-for-bluetoothdevice\u2460\u2465"}, {"id": "ref-for-bluetoothdevice\u2460\u2466"}, {"id": "ref-for-bluetoothdevice\u2460\u2467"}, {"id": "ref-for-bluetoothdevice\u2460\u2468"}, {"id": "ref-for-bluetoothdevice\u2461\u24ea"}, {"id": "ref-for-bluetoothdevice\u2461\u2460"}, {"id": "ref-for-bluetoothdevice\u2461\u2461"}, {"id": "ref-for-bluetoothdevice\u2461\u2462"}, {"id": "ref-for-bluetoothdevice\u2461\u2463"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2461\u2464"}, {"id": "ref-for-bluetoothdevice\u2461\u2465"}, {"id": "ref-for-bluetoothdevice\u2461\u2466"}, {"id": "ref-for-bluetoothdevice\u2461\u2467"}, {"id": "ref-for-bluetoothdevice\u2461\u2468"}, {"id": "ref-for-bluetoothdevice\u2462\u24ea"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2462\u2460"}, {"id": "ref-for-bluetoothdevice\u2462\u2461"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2462\u2462"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2462\u2463"}, {"id": "ref-for-bluetoothdevice\u2462\u2464"}, {"id": "ref-for-bluetoothdevice\u2462\u2465"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2462\u2466"}, {"id": "ref-for-bluetoothdevice\u2462\u2467"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2462\u2468"}, {"id": "ref-for-bluetoothdevice\u2463\u24ea"}, {"id": "ref-for-bluetoothdevice\u2463\u2460"}], "title": "6.6.1. Bluetooth Tree"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2463\u2461"}, {"id": "ref-for-bluetoothdevice\u2463\u2462"}], "title": "6.6.2. Event types"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2463\u2463"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2463\u2464"}], "title": "6.6.5. Responding to Service Changes"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2463\u2465"}], "title": "12.2.1.1. The bluetooth.RequestDevice Type"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2463\u2466"}], "title": "12.2.1.2. The bluetooth.RequestDeviceInfo Type"}, {"refs": [{"id": "ref-for-bluetoothdevice\u2463\u2467"}], "title": "12.2.2. Errors"}], "external": false}; window.dfnpanelData['dictdef-watchadvertisementsoptions'] = {"dfnID": "dictdef-watchadvertisementsoptions", "url": "#dictdef-watchadvertisementsoptions", "dfnText": "WatchAdvertisementsOptions", "refSections": [{"refs": [{"id": "ref-for-dictdef-watchadvertisementsoptions"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['dom-bluetoothdevice-id'] = {"dfnID": "dom-bluetoothdevice-id", "url": "#dom-bluetoothdevice-id", "dfnText": "id", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdevice-id"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-id\u2460"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-id\u2461"}], "title": "12.2.1.2. The bluetooth.RequestDeviceInfo Type"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-id\u2462"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}], "external": false}; window.dfnpanelData['dom-bluetoothdevice-name'] = {"dfnID": "dom-bluetoothdevice-name", "url": "#dom-bluetoothdevice-name", "dfnText": "name", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdevice-name"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-name\u2460"}], "title": "12.2.1.2. The bluetooth.RequestDeviceInfo Type"}], "external": false}; window.dfnpanelData['dom-bluetoothdevice-watchingadvertisements'] = {"dfnID": "dom-bluetoothdevice-watchingadvertisements", "url": "#dom-bluetoothdevice-watchingadvertisements", "dfnText": "watchingAdvertisements", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdevice-watchingadvertisements"}, {"id": "ref-for-dom-bluetoothdevice-watchingadvertisements\u2460"}, {"id": "ref-for-dom-bluetoothdevice-watchingadvertisements\u2461"}, {"id": "ref-for-dom-bluetoothdevice-watchingadvertisements\u2462"}, {"id": "ref-for-dom-bluetoothdevice-watchingadvertisements\u2463"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-watchingadvertisements\u2464"}, {"id": "ref-for-dom-bluetoothdevice-watchingadvertisements\u2465"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dom-bluetoothdevice-context-slot'] = {"dfnID": "dom-bluetoothdevice-context-slot", "url": "#dom-bluetoothdevice-context-slot", "dfnText": "[[context]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdevice-context-slot"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-context-slot\u2460"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-context-slot\u2461"}], "title": "6.6.3. Responding to Disconnection"}], "external": false}; window.dfnpanelData['dom-bluetoothdevice-representeddevice-slot'] = {"dfnID": "dom-bluetoothdevice-representeddevice-slot", "url": "#dom-bluetoothdevice-representeddevice-slot", "dfnText": "[[representedDevice]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdevice-representeddevice-slot"}, {"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2460"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2461"}, {"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2462"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2463"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2464"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2465"}, {"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2466"}, {"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2467"}, {"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2468"}, {"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2460\u24ea"}, {"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2460\u2460"}, {"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2460\u2461"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2460\u2462"}, {"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2460\u2463"}, {"id": "ref-for-dom-bluetoothdevice-representeddevice-slot\u2460\u2464"}], "title": "6.6.3. Responding to Disconnection"}], "external": false}; window.dfnpanelData['dom-bluetoothdevice-gatt-slot'] = {"dfnID": "dom-bluetoothdevice-gatt-slot", "url": "#dom-bluetoothdevice-gatt-slot", "dfnText": "[[gatt]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdevice-gatt-slot"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['dom-bluetoothdevice-allowedservices-slot'] = {"dfnID": "dom-bluetoothdevice-allowedservices-slot", "url": "#dom-bluetoothdevice-allowedservices-slot", "dfnText": "[[allowedServices]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdevice-allowedservices-slot"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-allowedservices-slot\u2460"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-allowedservices-slot\u2461"}, {"id": "ref-for-dom-bluetoothdevice-allowedservices-slot\u2462"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-allowedservices-slot\u2463"}, {"id": "ref-for-dom-bluetoothdevice-allowedservices-slot\u2464"}, {"id": "ref-for-dom-bluetoothdevice-allowedservices-slot\u2465"}, {"id": "ref-for-dom-bluetoothdevice-allowedservices-slot\u2466"}, {"id": "ref-for-dom-bluetoothdevice-allowedservices-slot\u2467"}, {"id": "ref-for-dom-bluetoothdevice-allowedservices-slot\u2468"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-allowedservices-slot\u2460\u24ea"}, {"id": "ref-for-dom-bluetoothdevice-allowedservices-slot\u2460\u2460"}, {"id": "ref-for-dom-bluetoothdevice-allowedservices-slot\u2460\u2461"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['dom-bluetoothdevice-allowedmanufacturerdata-slot'] = {"dfnID": "dom-bluetoothdevice-allowedmanufacturerdata-slot", "url": "#dom-bluetoothdevice-allowedmanufacturerdata-slot", "dfnText": "[[allowedManufacturerData]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdevice-allowedmanufacturerdata-slot"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dom-bluetoothdevice-watchadvertisementsstate-slot'] = {"dfnID": "dom-bluetoothdevice-watchadvertisementsstate-slot", "url": "#dom-bluetoothdevice-watchadvertisementsstate-slot", "dfnText": "[[watchAdvertisementsState]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot"}, {"id": "ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot\u2460"}, {"id": "ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot\u2461"}, {"id": "ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot\u2462"}, {"id": "ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot\u2463"}, {"id": "ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot\u2464"}, {"id": "ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot\u2465"}, {"id": "ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot\u2466"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-watchadvertisementsstate-slot\u2467"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": false}; window.dfnpanelData['get-the-bluetoothdevice-representing'] = {"dfnID": "get-the-bluetoothdevice-representing", "url": "#get-the-bluetoothdevice-representing", "dfnText": "get the BluetoothDevice representing", "refSections": [{"refs": [{"id": "ref-for-get-the-bluetoothdevice-representing"}, {"id": "ref-for-get-the-bluetoothdevice-representing\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-get-the-bluetoothdevice-representing\u2461"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-get-the-bluetoothdevice-representing\u2462"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-get-the-bluetoothdevice-representing\u2463"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": false}; window.dfnpanelData['dom-bluetoothdevice-gatt'] = {"dfnID": "dom-bluetoothdevice-gatt", "url": "#dom-bluetoothdevice-gatt", "dfnText": "gatt", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdevice-gatt"}, {"id": "ref-for-dom-bluetoothdevice-gatt\u2460"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['dom-bluetoothdevice-forget'] = {"dfnID": "dom-bluetoothdevice-forget", "url": "#dom-bluetoothdevice-forget", "dfnText": "forget()", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdevice-forget"}, {"id": "ref-for-dom-bluetoothdevice-forget\u2460"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['watch-advertisements-manager'] = {"dfnID": "watch-advertisements-manager", "url": "#watch-advertisements-manager", "dfnText": "watch advertisements manager", "refSections": [{"refs": [{"id": "ref-for-watch-advertisements-manager"}, {"id": "ref-for-watch-advertisements-manager\u2460"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['dom-bluetoothdevice-watchadvertisements'] = {"dfnID": "dom-bluetoothdevice-watchadvertisements", "url": "#dom-bluetoothdevice-watchadvertisements", "dfnText": "watchAdvertisements(options)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdevice-watchadvertisements"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-bluetoothdevice-watchadvertisements\u2460"}, {"id": "ref-for-dom-bluetoothdevice-watchadvertisements\u2461"}, {"id": "ref-for-dom-bluetoothdevice-watchadvertisements\u2462"}, {"id": "ref-for-dom-bluetoothdevice-watchadvertisements\u2463"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['abort-watchadvertisements'] = {"dfnID": "abort-watchadvertisements", "url": "#abort-watchadvertisements", "dfnText": "abort watchAdvertisements", "refSections": [{"refs": [{"id": "ref-for-abort-watchadvertisements"}, {"id": "ref-for-abort-watchadvertisements\u2460"}, {"id": "ref-for-abort-watchadvertisements\u2461"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['abort-all-active-watchadvertisements'] = {"dfnID": "abort-all-active-watchadvertisements", "url": "#abort-all-active-watchadvertisements", "dfnText": "abort all active watchAdvertisements", "refSections": [{"refs": [{"id": "ref-for-abort-all-active-watchadvertisements"}], "title": "5.2.1. Handling Visibility Change"}, {"refs": [{"id": "ref-for-abort-all-active-watchadvertisements\u2460"}], "title": "5.2.2. Handling Document Loss of Full Activity"}], "external": false}; window.dfnpanelData['bluetoothadvertisingevent'] = {"dfnID": "bluetoothadvertisingevent", "url": "#bluetoothadvertisingevent", "dfnText": "BluetoothAdvertisingEvent", "refSections": [{"refs": [{"id": "ref-for-bluetoothadvertisingevent"}, {"id": "ref-for-bluetoothadvertisingevent\u2460"}, {"id": "ref-for-bluetoothadvertisingevent\u2461"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dictdef-bluetoothadvertisingeventinit'] = {"dfnID": "dictdef-bluetoothadvertisingeventinit", "url": "#dictdef-bluetoothadvertisingeventinit", "dfnText": "BluetoothAdvertisingEventInit", "refSections": [{"refs": [{"id": "ref-for-dictdef-bluetoothadvertisingeventinit"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dom-bluetoothadvertisingeventinit-uuids'] = {"dfnID": "dom-bluetoothadvertisingeventinit-uuids", "url": "#dom-bluetoothadvertisingeventinit-uuids", "dfnText": "uuids", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothadvertisingeventinit-uuids"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dom-bluetoothadvertisingeventinit-manufacturerdata'] = {"dfnID": "dom-bluetoothadvertisingeventinit-manufacturerdata", "url": "#dom-bluetoothadvertisingeventinit-manufacturerdata", "dfnText": "manufacturerData", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothadvertisingeventinit-manufacturerdata"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dom-bluetoothadvertisingeventinit-servicedata'] = {"dfnID": "dom-bluetoothadvertisingeventinit-servicedata", "url": "#dom-bluetoothadvertisingeventinit-servicedata", "dfnText": "serviceData", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothadvertisingeventinit-servicedata"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dom-bluetoothadvertisingevent-device'] = {"dfnID": "dom-bluetoothadvertisingevent-device", "url": "#dom-bluetoothadvertisingevent-device", "dfnText": "device", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothadvertisingevent-device"}, {"id": "ref-for-dom-bluetoothadvertisingevent-device\u2460"}, {"id": "ref-for-dom-bluetoothadvertisingevent-device\u2461"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dom-bluetoothadvertisingevent-uuids'] = {"dfnID": "dom-bluetoothadvertisingevent-uuids", "url": "#dom-bluetoothadvertisingevent-uuids", "dfnText": "uuids", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothadvertisingevent-uuids"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dom-bluetoothadvertisingevent-name'] = {"dfnID": "dom-bluetoothadvertisingevent-name", "url": "#dom-bluetoothadvertisingevent-name", "dfnText": "name", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothadvertisingevent-name"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dom-bluetoothadvertisingevent-appearance'] = {"dfnID": "dom-bluetoothadvertisingevent-appearance", "url": "#dom-bluetoothadvertisingevent-appearance", "dfnText": "appearance", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothadvertisingevent-appearance"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dom-bluetoothadvertisingevent-txpower'] = {"dfnID": "dom-bluetoothadvertisingevent-txpower", "url": "#dom-bluetoothadvertisingevent-txpower", "dfnText": "txPower", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothadvertisingevent-txpower"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dom-bluetoothadvertisingevent-rssi'] = {"dfnID": "dom-bluetoothadvertisingevent-rssi", "url": "#dom-bluetoothadvertisingevent-rssi", "dfnText": "rssi", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothadvertisingevent-rssi"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dom-bluetoothadvertisingevent-manufacturerdata'] = {"dfnID": "dom-bluetoothadvertisingevent-manufacturerdata", "url": "#dom-bluetoothadvertisingevent-manufacturerdata", "dfnText": "manufacturerData", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothadvertisingevent-manufacturerdata"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['dom-bluetoothadvertisingevent-servicedata'] = {"dfnID": "dom-bluetoothadvertisingevent-servicedata", "url": "#dom-bluetoothadvertisingevent-servicedata", "dfnText": "serviceData", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothadvertisingevent-servicedata"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['fire-an-advertisementreceived-event'] = {"dfnID": "fire-an-advertisementreceived-event", "url": "#fire-an-advertisementreceived-event", "dfnText": "fire an advertisementreceived event", "refSections": [{"refs": [{"id": "ref-for-fire-an-advertisementreceived-event"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-fire-an-advertisementreceived-event\u2460"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": false}; window.dfnpanelData['dom-bluetoothadvertisingevent-bluetoothadvertisingevent'] = {"dfnID": "dom-bluetoothadvertisingevent-bluetoothadvertisingevent", "url": "#dom-bluetoothadvertisingevent-bluetoothadvertisingevent", "dfnText": "BluetoothAdvertisingEvent(type, init)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothadvertisingevent-bluetoothadvertisingevent"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['bluetoothmanufacturerdatamap'] = {"dfnID": "bluetoothmanufacturerdatamap", "url": "#bluetoothmanufacturerdatamap", "dfnText": "5.2.3.1. BluetoothManufacturerDataMap", "refSections": [{"refs": [{"id": "ref-for-bluetoothmanufacturerdatamap"}, {"id": "ref-for-bluetoothmanufacturerdatamap\u2460"}, {"id": "ref-for-bluetoothmanufacturerdatamap\u2461"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-bluetoothmanufacturerdatamap"}, {"id": "ref-for-bluetoothmanufacturerdatamap\u2462"}], "title": "5.2.3.1. BluetoothManufacturerDataMap"}], "external": false}; window.dfnpanelData['dom-bluetoothmanufacturerdatamap-backingmap-slot'] = {"dfnID": "dom-bluetoothmanufacturerdatamap-backingmap-slot", "url": "#dom-bluetoothmanufacturerdatamap-backingmap-slot", "dfnText": "[[BackingMap]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothmanufacturerdatamap-backingmap-slot"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['bluetoothservicedatamap'] = {"dfnID": "bluetoothservicedatamap", "url": "#bluetoothservicedatamap", "dfnText": "5.2.3.2. BluetoothServiceDataMap", "refSections": [{"refs": [{"id": "ref-for-bluetoothservicedatamap"}, {"id": "ref-for-bluetoothservicedatamap\u2460"}, {"id": "ref-for-bluetoothservicedatamap\u2461"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-bluetoothservicedatamap"}, {"id": "ref-for-bluetoothservicedatamap\u2462"}], "title": "5.2.3.2. BluetoothServiceDataMap"}], "external": false}; window.dfnpanelData['dom-bluetoothservicedatamap-backingmap-slot'] = {"dfnID": "dom-bluetoothservicedatamap-backingmap-slot", "url": "#dom-bluetoothservicedatamap-backingmap-slot", "dfnText": "[[BackingMap]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothservicedatamap-backingmap-slot"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['attribute'] = {"dfnID": "attribute", "url": "#attribute", "dfnText": "Attribute", "refSections": [{"refs": [{"id": "ref-for-attribute"}], "title": "5.1. Global Bluetooth device properties"}], "external": false}; window.dfnpanelData['bluetooth-cache-bluetooth-cache'] = {"dfnID": "bluetooth-cache-bluetooth-cache", "url": "#bluetooth-cache-bluetooth-cache", "dfnText": "Bluetooth cache", "refSections": [{"refs": [{"id": "ref-for-bluetooth-cache-bluetooth-cache"}, {"id": "ref-for-bluetooth-cache-bluetooth-cache\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-bluetooth-cache-bluetooth-cache\u2461"}, {"id": "ref-for-bluetooth-cache-bluetooth-cache\u2462"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-bluetooth-cache-bluetooth-cache\u2463"}], "title": "6.7. Error handling"}], "external": false}; window.dfnpanelData['populate-the-bluetooth-cache'] = {"dfnID": "populate-the-bluetooth-cache", "url": "#populate-the-bluetooth-cache", "dfnText": "populate the Bluetooth cache", "refSections": [{"refs": [{"id": "ref-for-populate-the-bluetooth-cache"}, {"id": "ref-for-populate-the-bluetooth-cache\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-populate-the-bluetooth-cache\u2461"}], "title": "6.1.2. The Bluetooth cache"}], "external": false}; window.dfnpanelData['query-the-bluetooth-cache'] = {"dfnID": "query-the-bluetooth-cache", "url": "#query-the-bluetooth-cache", "dfnText": "query the Bluetooth cache", "refSections": [{"refs": [{"id": "ref-for-query-the-bluetooth-cache"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}, {"refs": [{"id": "ref-for-query-the-bluetooth-cache\u2460"}], "title": "6.1.4. Identifying Services, Characteristics, and Descriptors"}], "external": false}; window.dfnpanelData['represented'] = {"dfnID": "represented", "url": "#represented", "dfnText": "Represented", "refSections": [{"refs": [{"id": "ref-for-represented"}, {"id": "ref-for-represented\u2460"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}], "external": false}; window.dfnpanelData['getgattchildren'] = {"dfnID": "getgattchildren", "url": "#getgattchildren", "dfnText": "GetGATTChildren", "refSections": [{"refs": [{"id": "ref-for-getgattchildren"}, {"id": "ref-for-getgattchildren\u2460"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-getgattchildren\u2461"}, {"id": "ref-for-getgattchildren\u2462"}, {"id": "ref-for-getgattchildren\u2463"}, {"id": "ref-for-getgattchildren\u2464"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-getgattchildren\u2465"}, {"id": "ref-for-getgattchildren\u2466"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['same-attribute'] = {"dfnID": "same-attribute", "url": "#same-attribute", "dfnText": "same attribute", "refSections": [{"refs": [{"id": "ref-for-same-attribute"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-same-attribute\u2460"}, {"id": "ref-for-same-attribute\u2461"}, {"id": "ref-for-same-attribute\u2462"}], "title": "6.1.4. Identifying Services, Characteristics, and Descriptors"}, {"refs": [{"id": "ref-for-same-attribute\u2463"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['bluetoothremotegattserver'] = {"dfnID": "bluetoothremotegattserver", "url": "#bluetoothremotegattserver", "dfnText": "BluetoothRemoteGATTServer", "refSections": [{"refs": [{"id": "ref-for-bluetoothremotegattserver"}, {"id": "ref-for-bluetoothremotegattserver\u2460"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-bluetoothremotegattserver\u2461"}, {"id": "ref-for-bluetoothremotegattserver\u2462"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-bluetoothremotegattserver\u2463"}, {"id": "ref-for-bluetoothremotegattserver\u2464"}, {"id": "ref-for-bluetoothremotegattserver\u2465"}, {"id": "ref-for-bluetoothremotegattserver\u2466"}, {"id": "ref-for-bluetoothremotegattserver\u2467"}, {"id": "ref-for-bluetoothremotegattserver\u2468"}, {"id": "ref-for-bluetoothremotegattserver\u2460\u24ea"}, {"id": "ref-for-bluetoothremotegattserver\u2460\u2460"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-bluetoothremotegattserver\u2460\u2461"}], "title": "6.6.3. Responding to Disconnection"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattserver-device'] = {"dfnID": "dom-bluetoothremotegattserver-device", "url": "#dom-bluetoothremotegattserver-device", "dfnText": "device", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-device"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-device\u2460"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattserver-connected'] = {"dfnID": "dom-bluetoothremotegattserver-connected", "url": "#dom-bluetoothremotegattserver-connected", "dfnText": "connected", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-connected"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-connected\u2460"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-connected\u2461"}, {"id": "ref-for-dom-bluetoothremotegattserver-connected\u2462"}, {"id": "ref-for-dom-bluetoothremotegattserver-connected\u2463"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-connected\u2464"}, {"id": "ref-for-dom-bluetoothremotegattserver-connected\u2465"}, {"id": "ref-for-dom-bluetoothremotegattserver-connected\u2466"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-connected\u2467"}, {"id": "ref-for-dom-bluetoothremotegattserver-connected\u2468"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-connected\u2460\u24ea"}, {"id": "ref-for-dom-bluetoothremotegattserver-connected\u2460\u2460"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-connected\u2460\u2461"}], "title": "6.6.4. Responding to Notifications and Indications"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattserver-activealgorithms-slot'] = {"dfnID": "dom-bluetoothremotegattserver-activealgorithms-slot", "url": "#dom-bluetoothremotegattserver-activealgorithms-slot", "dfnText": "[[activeAlgorithms]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot"}, {"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2460"}, {"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2461"}, {"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2462"}, {"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2463"}, {"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2464"}, {"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2465"}, {"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2466"}, {"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2467"}, {"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2468"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2460\u24ea"}, {"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2460\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2460\u2461"}, {"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2460\u2462"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-activealgorithms-slot\u2460\u2463"}], "title": "6.6.3. Responding to Disconnection"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattserver-connect'] = {"dfnID": "dom-bluetoothremotegattserver-connect", "url": "#dom-bluetoothremotegattserver-connect", "dfnText": "connect()", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-connect"}], "title": "1.1. Examples"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-connect\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-connect\u2461"}, {"id": "ref-for-dom-bluetoothremotegattserver-connect\u2462"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattserver-disconnect'] = {"dfnID": "dom-bluetoothremotegattserver-disconnect", "url": "#dom-bluetoothremotegattserver-disconnect", "dfnText": "disconnect()", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-disconnect"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-disconnect\u2460"}, {"id": "ref-for-dom-bluetoothremotegattserver-disconnect\u2461"}, {"id": "ref-for-dom-bluetoothremotegattserver-disconnect\u2462"}, {"id": "ref-for-dom-bluetoothremotegattserver-disconnect\u2463"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": false}; window.dfnpanelData['garbage-collect-the-connection'] = {"dfnID": "garbage-collect-the-connection", "url": "#garbage-collect-the-connection", "dfnText": "garbage-collect the connection", "refSections": [{"refs": [{"id": "ref-for-garbage-collect-the-connection"}, {"id": "ref-for-garbage-collect-the-connection\u2460"}, {"id": "ref-for-garbage-collect-the-connection\u2461"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": false}; window.dfnpanelData['connection-checking-wrapper'] = {"dfnID": "connection-checking-wrapper", "url": "#connection-checking-wrapper", "dfnText": "connection-checking wrapper", "refSections": [{"refs": [{"id": "ref-for-connection-checking-wrapper"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-connection-checking-wrapper\u2460"}, {"id": "ref-for-connection-checking-wrapper\u2461"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-connection-checking-wrapper\u2462"}, {"id": "ref-for-connection-checking-wrapper\u2463"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattserver-getprimaryservice'] = {"dfnID": "dom-bluetoothremotegattserver-getprimaryservice", "url": "#dom-bluetoothremotegattserver-getprimaryservice", "dfnText": "getPrimaryService(service)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-getprimaryservice"}], "title": "1.1. Examples"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-getprimaryservice\u2460"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattserver-getprimaryservices'] = {"dfnID": "dom-bluetoothremotegattserver-getprimaryservices", "url": "#dom-bluetoothremotegattserver-getprimaryservices", "dfnText": "getPrimaryServices(service)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattserver-getprimaryservices"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": false}; window.dfnpanelData['bluetoothremotegattservice'] = {"dfnID": "bluetoothremotegattservice", "url": "#bluetoothremotegattservice", "dfnText": "BluetoothRemoteGATTService", "refSections": [{"refs": [{"id": "ref-for-bluetoothremotegattservice"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-bluetoothremotegattservice\u2460"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-bluetoothremotegattservice\u2461"}], "title": "6.1.1. Persistence across connections"}, {"refs": [{"id": "ref-for-bluetoothremotegattservice\u2462"}, {"id": "ref-for-bluetoothremotegattservice\u2463"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-bluetoothremotegattservice\u2464"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}, {"refs": [{"id": "ref-for-bluetoothremotegattservice\u2465"}, {"id": "ref-for-bluetoothremotegattservice\u2466"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-bluetoothremotegattservice\u2467"}, {"id": "ref-for-bluetoothremotegattservice\u2468"}, {"id": "ref-for-bluetoothremotegattservice\u2460\u24ea"}, {"id": "ref-for-bluetoothremotegattservice\u2460\u2460"}, {"id": "ref-for-bluetoothremotegattservice\u2460\u2461"}, {"id": "ref-for-bluetoothremotegattservice\u2460\u2462"}, {"id": "ref-for-bluetoothremotegattservice\u2460\u2463"}, {"id": "ref-for-bluetoothremotegattservice\u2460\u2464"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-bluetoothremotegattservice\u2460\u2465"}, {"id": "ref-for-bluetoothremotegattservice\u2460\u2466"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-bluetoothremotegattservice\u2460\u2467"}, {"id": "ref-for-bluetoothremotegattservice\u2460\u2468"}, {"id": "ref-for-bluetoothremotegattservice\u2461\u24ea"}], "title": "6.6.1. Bluetooth Tree"}, {"refs": [{"id": "ref-for-bluetoothremotegattservice\u2461\u2460"}, {"id": "ref-for-bluetoothremotegattservice\u2461\u2461"}, {"id": "ref-for-bluetoothremotegattservice\u2461\u2462"}], "title": "6.6.2. Event types"}, {"refs": [{"id": "ref-for-bluetoothremotegattservice\u2461\u2463"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-bluetoothremotegattservice\u2461\u2464"}, {"id": "ref-for-bluetoothremotegattservice\u2461\u2465"}, {"id": "ref-for-bluetoothremotegattservice\u2461\u2466"}, {"id": "ref-for-bluetoothremotegattservice\u2461\u2467"}, {"id": "ref-for-bluetoothremotegattservice\u2461\u2468"}, {"id": "ref-for-bluetoothremotegattservice\u2462\u24ea"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattservice-device'] = {"dfnID": "dom-bluetoothremotegattservice-device", "url": "#dom-bluetoothremotegattservice-device", "dfnText": "device", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-device"}, {"id": "ref-for-dom-bluetoothremotegattservice-device\u2460"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-device\u2461"}], "title": "6.3. BluetoothRemoteGATTService"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattservice-uuid'] = {"dfnID": "dom-bluetoothremotegattservice-uuid", "url": "#dom-bluetoothremotegattservice-uuid", "dfnText": "uuid", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-uuid"}], "title": "6.3. BluetoothRemoteGATTService"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattservice-isprimary'] = {"dfnID": "dom-bluetoothremotegattservice-isprimary", "url": "#dom-bluetoothremotegattservice-isprimary", "dfnText": "isPrimary", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-isprimary"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-isprimary\u2460"}], "title": "6.3. BluetoothRemoteGATTService"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattservice-representedservice-slot'] = {"dfnID": "dom-bluetoothremotegattservice-representedservice-slot", "url": "#dom-bluetoothremotegattservice-representedservice-slot", "dfnText": "[[representedService]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-representedservice-slot"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-representedservice-slot\u2460"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-representedservice-slot\u2461"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-representedservice-slot\u2462"}, {"id": "ref-for-dom-bluetoothremotegattservice-representedservice-slot\u2463"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['create-a-bluetoothremotegattservice-representing'] = {"dfnID": "create-a-bluetoothremotegattservice-representing", "url": "#create-a-bluetoothremotegattservice-representing", "dfnText": "create a BluetoothRemoteGATTService representing", "refSections": [{"refs": [{"id": "ref-for-create-a-bluetoothremotegattservice-representing"}], "title": "6.1.2. The Bluetooth cache"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattservice-getcharacteristic'] = {"dfnID": "dom-bluetoothremotegattservice-getcharacteristic", "url": "#dom-bluetoothremotegattservice-getcharacteristic", "dfnText": "\ngetCharacteristic(characteristic)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-getcharacteristic"}, {"id": "ref-for-dom-bluetoothremotegattservice-getcharacteristic\u2460"}, {"id": "ref-for-dom-bluetoothremotegattservice-getcharacteristic\u2461"}], "title": "1.1. Examples"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-getcharacteristic\u2462"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-getcharacteristic\u2463"}], "title": "6.3. BluetoothRemoteGATTService"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattservice-getcharacteristics'] = {"dfnID": "dom-bluetoothremotegattservice-getcharacteristics", "url": "#dom-bluetoothremotegattservice-getcharacteristics", "dfnText": "\ngetCharacteristics(characteristic)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-getcharacteristics"}], "title": "6.3. BluetoothRemoteGATTService"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattservice-getincludedservice'] = {"dfnID": "dom-bluetoothremotegattservice-getincludedservice", "url": "#dom-bluetoothremotegattservice-getincludedservice", "dfnText": "\ngetIncludedService(service)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-getincludedservice"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-getincludedservice\u2460"}], "title": "6.3. BluetoothRemoteGATTService"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattservice-getincludedservices'] = {"dfnID": "dom-bluetoothremotegattservice-getincludedservices", "url": "#dom-bluetoothremotegattservice-getincludedservices", "dfnText": "\ngetIncludedServices(service)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattservice-getincludedservices"}], "title": "6.3. BluetoothRemoteGATTService"}], "external": false}; window.dfnpanelData['bluetoothremotegattcharacteristic'] = {"dfnID": "bluetoothremotegattcharacteristic", "url": "#bluetoothremotegattcharacteristic", "dfnText": "BluetoothRemoteGATTCharacteristic", "refSections": [{"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic"}], "title": "1.1. Examples"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2461"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2462"}], "title": "6.1.1. Persistence across connections"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2463"}, {"id": "ref-for-bluetoothremotegattcharacteristic\u2464"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2465"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2466"}, {"id": "ref-for-bluetoothremotegattcharacteristic\u2467"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2468"}, {"id": "ref-for-bluetoothremotegattcharacteristic\u2460\u24ea"}, {"id": "ref-for-bluetoothremotegattcharacteristic\u2460\u2460"}, {"id": "ref-for-bluetoothremotegattcharacteristic\u2460\u2461"}, {"id": "ref-for-bluetoothremotegattcharacteristic\u2460\u2462"}, {"id": "ref-for-bluetoothremotegattcharacteristic\u2460\u2463"}, {"id": "ref-for-bluetoothremotegattcharacteristic\u2460\u2464"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2460\u2465"}], "title": "6.4.1. BluetoothCharacteristicProperties"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2460\u2466"}, {"id": "ref-for-bluetoothremotegattcharacteristic\u2460\u2467"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2460\u2468"}, {"id": "ref-for-bluetoothremotegattcharacteristic\u2461\u24ea"}, {"id": "ref-for-bluetoothremotegattcharacteristic\u2461\u2460"}], "title": "6.6.1. Bluetooth Tree"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2461\u2461"}], "title": "6.6.2. Event types"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2461\u2462"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2461\u2463"}], "title": "6.6.4. Responding to Notifications and Indications"}, {"refs": [{"id": "ref-for-bluetoothremotegattcharacteristic\u2461\u2464"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattcharacteristic-service'] = {"dfnID": "dom-bluetoothremotegattcharacteristic-service", "url": "#dom-bluetoothremotegattcharacteristic-service", "dfnText": "service", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-service"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-service\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattcharacteristic-uuid'] = {"dfnID": "dom-bluetoothremotegattcharacteristic-uuid", "url": "#dom-bluetoothremotegattcharacteristic-uuid", "dfnText": "uuid", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-uuid"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattcharacteristic-properties'] = {"dfnID": "dom-bluetoothremotegattcharacteristic-properties", "url": "#dom-bluetoothremotegattcharacteristic-properties", "dfnText": "properties", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-properties"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattcharacteristic-value'] = {"dfnID": "dom-bluetoothremotegattcharacteristic-value", "url": "#dom-bluetoothremotegattcharacteristic-value", "dfnText": "value", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-value"}, {"id": "ref-for-dom-bluetoothremotegattcharacteristic-value\u2460"}], "title": "1.1. Examples"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-value\u2461"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot'] = {"dfnID": "dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot", "url": "#dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot", "dfnText": "[[representedCharacteristic]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot\u2460"}, {"id": "ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot\u2461"}, {"id": "ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot\u2462"}, {"id": "ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot\u2463"}, {"id": "ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot\u2464"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot\u2465"}, {"id": "ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot\u2466"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot\u2467"}, {"id": "ref-for-dom-bluetoothremotegattcharacteristic-representedcharacteristic-slot\u2468"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['create-a-bluetoothremotegattcharacteristic-representing'] = {"dfnID": "create-a-bluetoothremotegattcharacteristic-representing", "url": "#create-a-bluetoothremotegattcharacteristic-representing", "dfnText": "create a BluetoothRemoteGATTCharacteristic\nrepresenting", "refSections": [{"refs": [{"id": "ref-for-create-a-bluetoothremotegattcharacteristic-representing"}], "title": "6.1.2. The Bluetooth cache"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattcharacteristic-getdescriptor'] = {"dfnID": "dom-bluetoothremotegattcharacteristic-getdescriptor", "url": "#dom-bluetoothremotegattcharacteristic-getdescriptor", "dfnText": "\ngetDescriptor(descriptor)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-getdescriptor"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-getdescriptor\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattcharacteristic-getdescriptors'] = {"dfnID": "dom-bluetoothremotegattcharacteristic-getdescriptors", "url": "#dom-bluetoothremotegattcharacteristic-getdescriptors", "dfnText": "\ngetDescriptors(descriptor)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-getdescriptors"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattcharacteristic-readvalue'] = {"dfnID": "dom-bluetoothremotegattcharacteristic-readvalue", "url": "#dom-bluetoothremotegattcharacteristic-readvalue", "dfnText": "readValue()", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-readvalue"}], "title": "1.1. Examples"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-readvalue\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-readvalue\u2461"}], "title": "6.6.2. Event types"}], "external": false}; window.dfnpanelData['writecharacteristicvalue'] = {"dfnID": "writecharacteristicvalue", "url": "#writecharacteristicvalue", "dfnText": "WriteCharacteristicValue", "refSections": [{"refs": [{"id": "ref-for-writecharacteristicvalue"}, {"id": "ref-for-writecharacteristicvalue\u2460"}, {"id": "ref-for-writecharacteristicvalue\u2461"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattcharacteristic-writevalue'] = {"dfnID": "dom-bluetoothremotegattcharacteristic-writevalue", "url": "#dom-bluetoothremotegattcharacteristic-writevalue", "dfnText": "\nwriteValue(value)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-writevalue"}], "title": "1.1. Examples"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-writevalue\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattcharacteristic-writevaluewithresponse'] = {"dfnID": "dom-bluetoothremotegattcharacteristic-writevaluewithresponse", "url": "#dom-bluetoothremotegattcharacteristic-writevaluewithresponse", "dfnText": "\nwriteValueWithResponse(value)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithresponse"}, {"id": "ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithresponse\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse'] = {"dfnID": "dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse", "url": "#dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse", "dfnText": "\nwriteValueWithoutResponse(value)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse"}, {"id": "ref-for-dom-bluetoothremotegattcharacteristic-writevaluewithoutresponse\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['active-notification-context-set'] = {"dfnID": "active-notification-context-set", "url": "#active-notification-context-set", "dfnText": "active notification\ncontext set", "refSections": [{"refs": [{"id": "ref-for-active-notification-context-set"}, {"id": "ref-for-active-notification-context-set\u2460"}, {"id": "ref-for-active-notification-context-set\u2461"}, {"id": "ref-for-active-notification-context-set\u2462"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-active-notification-context-set\u2463"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-active-notification-context-set\u2464"}], "title": "6.6.4. Responding to Notifications and Indications"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattcharacteristic-startnotifications'] = {"dfnID": "dom-bluetoothremotegattcharacteristic-startnotifications", "url": "#dom-bluetoothremotegattcharacteristic-startnotifications", "dfnText": "\nstartNotifications()", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-startnotifications"}], "title": "1.1. Examples"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-startnotifications\u2460"}, {"id": "ref-for-dom-bluetoothremotegattcharacteristic-startnotifications\u2461"}, {"id": "ref-for-dom-bluetoothremotegattcharacteristic-startnotifications\u2462"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattcharacteristic-stopnotifications'] = {"dfnID": "dom-bluetoothremotegattcharacteristic-stopnotifications", "url": "#dom-bluetoothremotegattcharacteristic-stopnotifications", "dfnText": "\nstopNotifications()", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattcharacteristic-stopnotifications"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['bluetoothcharacteristicproperties'] = {"dfnID": "bluetoothcharacteristicproperties", "url": "#bluetoothcharacteristicproperties", "dfnText": "BluetoothCharacteristicProperties", "refSections": [{"refs": [{"id": "ref-for-bluetoothcharacteristicproperties"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-bluetoothcharacteristicproperties\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-bluetoothcharacteristicproperties\u2461"}, {"id": "ref-for-bluetoothcharacteristicproperties\u2462"}], "title": "6.4.1. BluetoothCharacteristicProperties"}], "external": false}; window.dfnpanelData['create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic'] = {"dfnID": "create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic", "url": "#create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic", "dfnText": "create a BluetoothCharacteristicProperties instance from\nthe Characteristic", "refSections": [{"refs": [{"id": "ref-for-create-a-bluetoothcharacteristicproperties-instance-from-the-characteristic"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['bluetoothremotegattdescriptor'] = {"dfnID": "bluetoothremotegattdescriptor", "url": "#bluetoothremotegattdescriptor", "dfnText": "BluetoothRemoteGATTDescriptor", "refSections": [{"refs": [{"id": "ref-for-bluetoothremotegattdescriptor"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-bluetoothremotegattdescriptor\u2460"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-bluetoothremotegattdescriptor\u2461"}], "title": "6.1.1. Persistence across connections"}, {"refs": [{"id": "ref-for-bluetoothremotegattdescriptor\u2462"}, {"id": "ref-for-bluetoothremotegattdescriptor\u2463"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-bluetoothremotegattdescriptor\u2464"}, {"id": "ref-for-bluetoothremotegattdescriptor\u2465"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-bluetoothremotegattdescriptor\u2466"}, {"id": "ref-for-bluetoothremotegattdescriptor\u2467"}, {"id": "ref-for-bluetoothremotegattdescriptor\u2468"}, {"id": "ref-for-bluetoothremotegattdescriptor\u2460\u24ea"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-bluetoothremotegattdescriptor\u2460\u2460"}, {"id": "ref-for-bluetoothremotegattdescriptor\u2460\u2461"}], "title": "6.6.1. Bluetooth Tree"}, {"refs": [{"id": "ref-for-bluetoothremotegattdescriptor\u2460\u2462"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-bluetoothremotegattdescriptor\u2460\u2463"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattdescriptor-characteristic'] = {"dfnID": "dom-bluetoothremotegattdescriptor-characteristic", "url": "#dom-bluetoothremotegattdescriptor-characteristic", "dfnText": "characteristic", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattdescriptor-characteristic"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattdescriptor-uuid'] = {"dfnID": "dom-bluetoothremotegattdescriptor-uuid", "url": "#dom-bluetoothremotegattdescriptor-uuid", "dfnText": "uuid", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattdescriptor-uuid"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattdescriptor-value'] = {"dfnID": "dom-bluetoothremotegattdescriptor-value", "url": "#dom-bluetoothremotegattdescriptor-value", "dfnText": "value", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattdescriptor-value"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattdescriptor-representeddescriptor-slot'] = {"dfnID": "dom-bluetoothremotegattdescriptor-representeddescriptor-slot", "url": "#dom-bluetoothremotegattdescriptor-representeddescriptor-slot", "dfnText": "[[representedDescriptor]]", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot\u2460"}, {"id": "ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot\u2461"}, {"id": "ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot\u2462"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot\u2463"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot\u2464"}, {"id": "ref-for-dom-bluetoothremotegattdescriptor-representeddescriptor-slot\u2465"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['create-a-bluetoothremotegattdescriptor-representing'] = {"dfnID": "create-a-bluetoothremotegattdescriptor-representing", "url": "#create-a-bluetoothremotegattdescriptor-representing", "dfnText": "create a BluetoothRemoteGATTDescriptor representing", "refSections": [{"refs": [{"id": "ref-for-create-a-bluetoothremotegattdescriptor-representing"}], "title": "6.1.2. The Bluetooth cache"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattdescriptor-readvalue'] = {"dfnID": "dom-bluetoothremotegattdescriptor-readvalue", "url": "#dom-bluetoothremotegattdescriptor-readvalue", "dfnText": "\nreadValue()", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattdescriptor-readvalue"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": false}; window.dfnpanelData['dom-bluetoothremotegattdescriptor-writevalue'] = {"dfnID": "dom-bluetoothremotegattdescriptor-writevalue", "url": "#dom-bluetoothremotegattdescriptor-writevalue", "dfnText": "\nwriteValue(value)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothremotegattdescriptor-writevalue"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": false}; window.dfnpanelData['bluetooth-tree-bluetooth-tree'] = {"dfnID": "bluetooth-tree-bluetooth-tree", "url": "#bluetooth-tree-bluetooth-tree", "dfnText": "Bluetooth tree", "refSections": [{"refs": [{"id": "ref-for-bluetooth-tree-bluetooth-tree"}, {"id": "ref-for-bluetooth-tree-bluetooth-tree\u2460"}], "title": "6.6.2. Event types"}, {"refs": [{"id": "ref-for-bluetooth-tree-bluetooth-tree\u2461"}], "title": "6.6.4. Responding to Notifications and Indications"}, {"refs": [{"id": "ref-for-bluetooth-tree-bluetooth-tree\u2462"}, {"id": "ref-for-bluetooth-tree-bluetooth-tree\u2463"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['eventdef-bluetoothdeviceeventhandlers-advertisementreceived'] = {"dfnID": "eventdef-bluetoothdeviceeventhandlers-advertisementreceived", "url": "#eventdef-bluetoothdeviceeventhandlers-advertisementreceived", "dfnText": "advertisementreceived", "refSections": [{"refs": [{"id": "ref-for-eventdef-bluetoothdeviceeventhandlers-advertisementreceived"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-eventdef-bluetoothdeviceeventhandlers-advertisementreceived\u2460"}, {"id": "ref-for-eventdef-bluetoothdeviceeventhandlers-advertisementreceived\u2461"}, {"id": "ref-for-eventdef-bluetoothdeviceeventhandlers-advertisementreceived\u2462"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-eventdef-bluetoothdeviceeventhandlers-advertisementreceived\u2463"}], "title": "6.6.6. IDL event handlers"}], "external": false}; window.dfnpanelData['eventdef-bluetooth-availabilitychanged'] = {"dfnID": "eventdef-bluetooth-availabilitychanged", "url": "#eventdef-bluetooth-availabilitychanged", "dfnText": "availabilitychanged", "refSections": [{"refs": [{"id": "ref-for-eventdef-bluetooth-availabilitychanged"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-eventdef-bluetooth-availabilitychanged\u2460"}, {"id": "ref-for-eventdef-bluetooth-availabilitychanged\u2461"}], "title": "4.2. Overall Bluetooth availability"}], "external": false}; window.dfnpanelData['eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged'] = {"dfnID": "eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged", "url": "#eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged", "dfnText": "\n characteristicvaluechanged\n ", "refSections": [{"refs": [{"id": "ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged"}], "title": "1.1. Examples"}, {"refs": [{"id": "ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged\u2461"}], "title": "6.6.4. Responding to Notifications and Indications"}, {"refs": [{"id": "ref-for-eventdef-bluetoothremotegattcharacteristic-characteristicvaluechanged\u2462"}], "title": "6.6.6. IDL event handlers"}], "external": false}; window.dfnpanelData['eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected'] = {"dfnID": "eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected", "url": "#eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected", "dfnText": "gattserverdisconnected", "refSections": [{"refs": [{"id": "ref-for-eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected\u2460"}], "title": "6.6.3. Responding to Disconnection"}, {"refs": [{"id": "ref-for-eventdef-bluetoothdeviceeventhandlers-gattserverdisconnected\u2461"}], "title": "6.6.6. IDL event handlers"}], "external": false}; window.dfnpanelData['eventdef-bluetoothremotegattservice-serviceadded'] = {"dfnID": "eventdef-bluetoothremotegattservice-serviceadded", "url": "#eventdef-bluetoothremotegattservice-serviceadded", "dfnText": "serviceadded", "refSections": [{"refs": [{"id": "ref-for-eventdef-bluetoothremotegattservice-serviceadded"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-eventdef-bluetoothremotegattservice-serviceadded\u2460"}, {"id": "ref-for-eventdef-bluetoothremotegattservice-serviceadded\u2461"}], "title": "6.6.5. Responding to Service Changes"}, {"refs": [{"id": "ref-for-eventdef-bluetoothremotegattservice-serviceadded\u2462"}], "title": "6.6.6. IDL event handlers"}], "external": false}; window.dfnpanelData['eventdef-bluetoothremotegattservice-servicechanged'] = {"dfnID": "eventdef-bluetoothremotegattservice-servicechanged", "url": "#eventdef-bluetoothremotegattservice-servicechanged", "dfnText": "\n servicechanged\n ", "refSections": [{"refs": [{"id": "ref-for-eventdef-bluetoothremotegattservice-servicechanged"}, {"id": "ref-for-eventdef-bluetoothremotegattservice-servicechanged\u2460"}, {"id": "ref-for-eventdef-bluetoothremotegattservice-servicechanged\u2461"}], "title": "6.6.5. Responding to Service Changes"}, {"refs": [{"id": "ref-for-eventdef-bluetoothremotegattservice-servicechanged\u2462"}], "title": "6.6.6. IDL event handlers"}], "external": false}; window.dfnpanelData['eventdef-bluetoothremotegattservice-serviceremoved'] = {"dfnID": "eventdef-bluetoothremotegattservice-serviceremoved", "url": "#eventdef-bluetoothremotegattservice-serviceremoved", "dfnText": "\n serviceremoved\n ", "refSections": [{"refs": [{"id": "ref-for-eventdef-bluetoothremotegattservice-serviceremoved"}, {"id": "ref-for-eventdef-bluetoothremotegattservice-serviceremoved\u2460"}], "title": "6.6.5. Responding to Service Changes"}, {"refs": [{"id": "ref-for-eventdef-bluetoothremotegattservice-serviceremoved\u2461"}], "title": "6.6.6. IDL event handlers"}], "external": false}; window.dfnpanelData['clean-up-the-disconnected-device'] = {"dfnID": "clean-up-the-disconnected-device", "url": "#clean-up-the-disconnected-device", "dfnText": "clean up the disconnected device", "refSections": [{"refs": [{"id": "ref-for-clean-up-the-disconnected-device"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-clean-up-the-disconnected-device\u2460"}], "title": "6.6.3. Responding to Disconnection"}], "external": false}; window.dfnpanelData['characteristiceventhandlers'] = {"dfnID": "characteristiceventhandlers", "url": "#characteristiceventhandlers", "dfnText": "CharacteristicEventHandlers", "refSections": [{"refs": [{"id": "ref-for-characteristiceventhandlers"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-characteristiceventhandlers\u2460"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-characteristiceventhandlers\u2461"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-characteristiceventhandlers\u2462"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['dom-characteristiceventhandlers-oncharacteristicvaluechanged'] = {"dfnID": "dom-characteristiceventhandlers-oncharacteristicvaluechanged", "url": "#dom-characteristiceventhandlers-oncharacteristicvaluechanged", "dfnText": "\noncharacteristicvaluechanged", "refSections": [{"refs": [{"id": "ref-for-dom-characteristiceventhandlers-oncharacteristicvaluechanged"}], "title": "6.6.6. IDL event handlers"}], "external": false}; window.dfnpanelData['bluetoothdeviceeventhandlers'] = {"dfnID": "bluetoothdeviceeventhandlers", "url": "#bluetoothdeviceeventhandlers", "dfnText": "BluetoothDeviceEventHandlers", "refSections": [{"refs": [{"id": "ref-for-bluetoothdeviceeventhandlers"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-bluetoothdeviceeventhandlers\u2460"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['dom-bluetoothdeviceeventhandlers-onadvertisementreceived'] = {"dfnID": "dom-bluetoothdeviceeventhandlers-onadvertisementreceived", "url": "#dom-bluetoothdeviceeventhandlers-onadvertisementreceived", "dfnText": "onadvertisementreceived", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdeviceeventhandlers-onadvertisementreceived"}], "title": "6.6.6. IDL event handlers"}], "external": false}; window.dfnpanelData['dom-bluetoothdeviceeventhandlers-ongattserverdisconnected'] = {"dfnID": "dom-bluetoothdeviceeventhandlers-ongattserverdisconnected", "url": "#dom-bluetoothdeviceeventhandlers-ongattserverdisconnected", "dfnText": "ongattserverdisconnected", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothdeviceeventhandlers-ongattserverdisconnected"}], "title": "6.6.6. IDL event handlers"}], "external": false}; window.dfnpanelData['serviceeventhandlers'] = {"dfnID": "serviceeventhandlers", "url": "#serviceeventhandlers", "dfnText": "ServiceEventHandlers", "refSections": [{"refs": [{"id": "ref-for-serviceeventhandlers"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-serviceeventhandlers\u2460"}], "title": "5.2. BluetoothDevice"}, {"refs": [{"id": "ref-for-serviceeventhandlers\u2461"}], "title": "6.3. BluetoothRemoteGATTService"}], "external": false}; window.dfnpanelData['dom-serviceeventhandlers-onserviceadded'] = {"dfnID": "dom-serviceeventhandlers-onserviceadded", "url": "#dom-serviceeventhandlers-onserviceadded", "dfnText": "onserviceadded", "refSections": [{"refs": [{"id": "ref-for-dom-serviceeventhandlers-onserviceadded"}], "title": "6.6.6. IDL event handlers"}], "external": false}; window.dfnpanelData['dom-serviceeventhandlers-onservicechanged'] = {"dfnID": "dom-serviceeventhandlers-onservicechanged", "url": "#dom-serviceeventhandlers-onservicechanged", "dfnText": "onservicechanged", "refSections": [{"refs": [{"id": "ref-for-dom-serviceeventhandlers-onservicechanged"}], "title": "6.6.6. IDL event handlers"}], "external": false}; window.dfnpanelData['dom-serviceeventhandlers-onserviceremoved'] = {"dfnID": "dom-serviceeventhandlers-onserviceremoved", "url": "#dom-serviceeventhandlers-onserviceremoved", "dfnText": "onserviceremoved", "refSections": [{"refs": [{"id": "ref-for-dom-serviceeventhandlers-onserviceremoved"}], "title": "6.6.6. IDL event handlers"}], "external": false}; window.dfnpanelData['typedefdef-uuid'] = {"dfnID": "typedefdef-uuid", "url": "#typedefdef-uuid", "dfnText": "UUID", "refSections": [{"refs": [{"id": "ref-for-typedefdef-uuid"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-typedefdef-uuid\u2460"}, {"id": "ref-for-typedefdef-uuid\u2461"}, {"id": "ref-for-typedefdef-uuid\u2462"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-typedefdef-uuid\u2463"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-typedefdef-uuid\u2464"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-typedefdef-uuid\u2465"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-typedefdef-uuid\u2466"}, {"id": "ref-for-typedefdef-uuid\u2467"}, {"id": "ref-for-typedefdef-uuid\u2468"}, {"id": "ref-for-typedefdef-uuid\u2460\u24ea"}], "title": "7.1. Standardized UUIDs"}], "external": false}; window.dfnpanelData['valid-uuid'] = {"dfnID": "valid-uuid", "url": "#valid-uuid", "dfnText": "valid\nUUID", "refSections": [{"refs": [{"id": "ref-for-valid-uuid"}, {"id": "ref-for-valid-uuid\u2460"}, {"id": "ref-for-valid-uuid\u2461"}], "title": "7. UUIDs"}, {"refs": [{"id": "ref-for-valid-uuid\u2462"}, {"id": "ref-for-valid-uuid\u2463"}, {"id": "ref-for-valid-uuid\u2464"}, {"id": "ref-for-valid-uuid\u2465"}, {"id": "ref-for-valid-uuid\u2466"}], "title": "7.1. Standardized UUIDs"}, {"refs": [{"id": "ref-for-valid-uuid\u2467"}, {"id": "ref-for-valid-uuid\u2468"}], "title": "7.2. GATT assigned numbers"}, {"refs": [{"id": "ref-for-valid-uuid\u2460\u24ea"}, {"id": "ref-for-valid-uuid\u2460\u2460"}, {"id": "ref-for-valid-uuid\u2460\u2461"}], "title": "9. The Blocklist"}], "external": false}; window.dfnpanelData['valid-name'] = {"dfnID": "valid-name", "url": "#valid-name", "dfnText": "valid name", "refSections": [{"refs": [{"id": "ref-for-valid-name"}, {"id": "ref-for-valid-name\u2460"}, {"id": "ref-for-valid-name\u2461"}, {"id": "ref-for-valid-name\u2462"}], "title": "7.1. Standardized UUIDs"}, {"refs": [{"id": "ref-for-valid-name\u2463"}, {"id": "ref-for-valid-name\u2464"}], "title": "7.2. GATT assigned numbers"}], "external": false}; window.dfnpanelData['dom-bluetoothuuid-canonicaluuid'] = {"dfnID": "dom-bluetoothuuid-canonicaluuid", "url": "#dom-bluetoothuuid-canonicaluuid", "dfnText": "\ncanonicalUUID(alias)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothuuid-canonicaluuid"}], "title": "7. UUIDs"}, {"refs": [{"id": "ref-for-dom-bluetoothuuid-canonicaluuid\u2460"}, {"id": "ref-for-dom-bluetoothuuid-canonicaluuid\u2461"}, {"id": "ref-for-dom-bluetoothuuid-canonicaluuid\u2462"}], "title": "7.1. Standardized UUIDs"}], "external": false}; window.dfnpanelData['typedefdef-bluetoothserviceuuid'] = {"dfnID": "typedefdef-bluetoothserviceuuid", "url": "#typedefdef-bluetoothserviceuuid", "dfnText": "BluetoothServiceUUID", "refSections": [{"refs": [{"id": "ref-for-typedefdef-bluetoothserviceuuid"}, {"id": "ref-for-typedefdef-bluetoothserviceuuid\u2460"}, {"id": "ref-for-typedefdef-bluetoothserviceuuid\u2461"}, {"id": "ref-for-typedefdef-bluetoothserviceuuid\u2462"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-typedefdef-bluetoothserviceuuid\u2463"}], "title": "4.1. Permission API Integration"}, {"refs": [{"id": "ref-for-typedefdef-bluetoothserviceuuid\u2464"}, {"id": "ref-for-typedefdef-bluetoothserviceuuid\u2465"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-typedefdef-bluetoothserviceuuid\u2466"}, {"id": "ref-for-typedefdef-bluetoothserviceuuid\u2467"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-typedefdef-bluetoothserviceuuid\u2468"}], "title": "7.1. Standardized UUIDs"}], "external": false}; window.dfnpanelData['typedefdef-bluetoothcharacteristicuuid'] = {"dfnID": "typedefdef-bluetoothcharacteristicuuid", "url": "#typedefdef-bluetoothcharacteristicuuid", "dfnText": "BluetoothCharacteristicUUID", "refSections": [{"refs": [{"id": "ref-for-typedefdef-bluetoothcharacteristicuuid"}, {"id": "ref-for-typedefdef-bluetoothcharacteristicuuid\u2460"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-typedefdef-bluetoothcharacteristicuuid\u2461"}], "title": "7.1. Standardized UUIDs"}], "external": false}; window.dfnpanelData['typedefdef-bluetoothdescriptoruuid'] = {"dfnID": "typedefdef-bluetoothdescriptoruuid", "url": "#typedefdef-bluetoothdescriptoruuid", "dfnText": "BluetoothDescriptorUUID", "refSections": [{"refs": [{"id": "ref-for-typedefdef-bluetoothdescriptoruuid"}, {"id": "ref-for-typedefdef-bluetoothdescriptoruuid\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-typedefdef-bluetoothdescriptoruuid\u2461"}], "title": "7.1. Standardized UUIDs"}], "external": false}; window.dfnpanelData['resolveuuidname'] = {"dfnID": "resolveuuidname", "url": "#resolveuuidname", "dfnText": "ResolveUUIDName", "refSections": [{"refs": [{"id": "ref-for-resolveuuidname"}, {"id": "ref-for-resolveuuidname\u2460"}, {"id": "ref-for-resolveuuidname\u2461"}], "title": "7.1. Standardized UUIDs"}], "external": false}; window.dfnpanelData['dom-bluetoothuuid-getservice'] = {"dfnID": "dom-bluetoothuuid-getservice", "url": "#dom-bluetoothuuid-getservice", "dfnText": "\ngetService(name)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothuuid-getservice"}, {"id": "ref-for-dom-bluetoothuuid-getservice\u2460"}, {"id": "ref-for-dom-bluetoothuuid-getservice\u2461"}, {"id": "ref-for-dom-bluetoothuuid-getservice\u2462"}, {"id": "ref-for-dom-bluetoothuuid-getservice\u2463"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-dom-bluetoothuuid-getservice\u2464"}, {"id": "ref-for-dom-bluetoothuuid-getservice\u2465"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-dom-bluetoothuuid-getservice\u2466"}, {"id": "ref-for-dom-bluetoothuuid-getservice\u2467"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-dom-bluetoothuuid-getservice\u2468"}, {"id": "ref-for-dom-bluetoothuuid-getservice\u2460\u24ea"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-dom-bluetoothuuid-getservice\u2460\u2460"}, {"id": "ref-for-dom-bluetoothuuid-getservice\u2460\u2461"}, {"id": "ref-for-dom-bluetoothuuid-getservice\u2460\u2462"}, {"id": "ref-for-dom-bluetoothuuid-getservice\u2460\u2463"}, {"id": "ref-for-dom-bluetoothuuid-getservice\u2460\u2464"}], "title": "7.1. Standardized UUIDs"}, {"refs": [{"id": "ref-for-dom-bluetoothuuid-getservice\u2460\u2465"}, {"id": "ref-for-dom-bluetoothuuid-getservice\u2460\u2466"}], "title": "13. Terminology and Conventions"}], "external": false}; window.dfnpanelData['dom-bluetoothuuid-getcharacteristic'] = {"dfnID": "dom-bluetoothuuid-getcharacteristic", "url": "#dom-bluetoothuuid-getcharacteristic", "dfnText": "\ngetCharacteristic(name)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothuuid-getcharacteristic"}, {"id": "ref-for-dom-bluetoothuuid-getcharacteristic\u2460"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-dom-bluetoothuuid-getcharacteristic\u2461"}, {"id": "ref-for-dom-bluetoothuuid-getcharacteristic\u2462"}, {"id": "ref-for-dom-bluetoothuuid-getcharacteristic\u2463"}], "title": "7.1. Standardized UUIDs"}], "external": false}; window.dfnpanelData['dom-bluetoothuuid-getdescriptor'] = {"dfnID": "dom-bluetoothuuid-getdescriptor", "url": "#dom-bluetoothuuid-getdescriptor", "dfnText": "\ngetDescriptor(name)", "refSections": [{"refs": [{"id": "ref-for-dom-bluetoothuuid-getdescriptor"}, {"id": "ref-for-dom-bluetoothuuid-getdescriptor\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-dom-bluetoothuuid-getdescriptor\u2461"}, {"id": "ref-for-dom-bluetoothuuid-getdescriptor\u2462"}, {"id": "ref-for-dom-bluetoothuuid-getdescriptor\u2463"}], "title": "7.1. Standardized UUIDs"}], "external": false}; window.dfnpanelData['parsing-the-gatt-assigned-numbers'] = {"dfnID": "parsing-the-gatt-assigned-numbers", "url": "#parsing-the-gatt-assigned-numbers", "dfnText": "parsing the GATT assigned numbers", "refSections": [{"refs": [{"id": "ref-for-parsing-the-gatt-assigned-numbers"}, {"id": "ref-for-parsing-the-gatt-assigned-numbers\u2460"}, {"id": "ref-for-parsing-the-gatt-assigned-numbers\u2461"}], "title": "7.2. GATT assigned numbers"}], "external": false}; window.dfnpanelData['gatt-assigned-services'] = {"dfnID": "gatt-assigned-services", "url": "#gatt-assigned-services", "dfnText": "GATT assigned services", "refSections": [{"refs": [{"id": "ref-for-gatt-assigned-services"}, {"id": "ref-for-gatt-assigned-services\u2460"}], "title": "7.1. Standardized UUIDs"}], "external": false}; window.dfnpanelData['gatt-assigned-characteristics'] = {"dfnID": "gatt-assigned-characteristics", "url": "#gatt-assigned-characteristics", "dfnText": "GATT assigned characteristics", "refSections": [{"refs": [{"id": "ref-for-gatt-assigned-characteristics"}, {"id": "ref-for-gatt-assigned-characteristics\u2460"}], "title": "7.1. Standardized UUIDs"}], "external": false}; window.dfnpanelData['gatt-assigned-descriptors'] = {"dfnID": "gatt-assigned-descriptors", "url": "#gatt-assigned-descriptors", "dfnText": "GATT assigned descriptors", "refSections": [{"refs": [{"id": "ref-for-gatt-assigned-descriptors"}, {"id": "ref-for-gatt-assigned-descriptors\u2460"}], "title": "7.1. Standardized UUIDs"}], "external": false}; window.dfnpanelData['parse-an-advertising-data-filter'] = {"dfnID": "parse-an-advertising-data-filter", "url": "#parse-an-advertising-data-filter", "dfnText": "parse an advertising data filter", "refSections": [{"refs": [{"id": "ref-for-parse-an-advertising-data-filter"}], "title": "9. The Blocklist"}], "external": false}; window.dfnpanelData['valid-company-identifier-string'] = {"dfnID": "valid-company-identifier-string", "url": "#valid-company-identifier-string", "dfnText": "valid company identifier string", "refSections": [{"refs": [{"id": "ref-for-valid-company-identifier-string"}], "title": "9. The Blocklist"}], "external": false}; window.dfnpanelData['parsing-the-manufacturer-data-blocklist'] = {"dfnID": "parsing-the-manufacturer-data-blocklist", "url": "#parsing-the-manufacturer-data-blocklist", "dfnText": "parsing the manufacturer data blocklist", "refSections": [{"refs": [{"id": "ref-for-parsing-the-manufacturer-data-blocklist"}], "title": "9. The Blocklist"}], "external": false}; window.dfnpanelData['parsing-the-gatt-blocklist'] = {"dfnID": "parsing-the-gatt-blocklist", "url": "#parsing-the-gatt-blocklist", "dfnText": "parsing the gatt blocklist", "refSections": [{"refs": [{"id": "ref-for-parsing-the-gatt-blocklist"}], "title": "9. The Blocklist"}], "external": false}; window.dfnpanelData['gatt-blocklist'] = {"dfnID": "gatt-blocklist", "url": "#gatt-blocklist", "dfnText": "GATT blocklist", "refSections": [{"refs": [{"id": "ref-for-gatt-blocklist"}], "title": "3.3. Attacks on devices"}, {"refs": [{"id": "ref-for-gatt-blocklist\u2460"}, {"id": "ref-for-gatt-blocklist\u2461"}, {"id": "ref-for-gatt-blocklist\u2462"}, {"id": "ref-for-gatt-blocklist\u2463"}, {"id": "ref-for-gatt-blocklist\u2464"}, {"id": "ref-for-gatt-blocklist\u2465"}], "title": "9. The Blocklist"}], "external": false}; window.dfnpanelData['manufacturer-data-blocklist'] = {"dfnID": "manufacturer-data-blocklist", "url": "#manufacturer-data-blocklist", "dfnText": "Manufacturer Data blocklist", "refSections": [{"refs": [{"id": "ref-for-manufacturer-data-blocklist"}, {"id": "ref-for-manufacturer-data-blocklist\u2460"}, {"id": "ref-for-manufacturer-data-blocklist\u2461"}, {"id": "ref-for-manufacturer-data-blocklist\u2462"}], "title": "9. The Blocklist"}], "external": false}; window.dfnpanelData['blocklisted'] = {"dfnID": "blocklisted", "url": "#blocklisted", "dfnText": "blocklisted", "refSections": [{"refs": [{"id": "ref-for-blocklisted"}, {"id": "ref-for-blocklisted\u2460"}, {"id": "ref-for-blocklisted\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-blocklisted\u2462"}, {"id": "ref-for-blocklisted\u2463"}], "title": "6.1.3. Navigating the Bluetooth Hierarchy"}], "external": false}; window.dfnpanelData['blocklisted-for-reads'] = {"dfnID": "blocklisted-for-reads", "url": "#blocklisted-for-reads", "dfnText": "blocklisted for reads", "refSections": [{"refs": [{"id": "ref-for-blocklisted-for-reads"}, {"id": "ref-for-blocklisted-for-reads\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-blocklisted-for-reads\u2461"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": false}; window.dfnpanelData['blocklisted-for-writes'] = {"dfnID": "blocklisted-for-writes", "url": "#blocklisted-for-writes", "dfnText": "blocklisted for writes", "refSections": [{"refs": [{"id": "ref-for-blocklisted-for-writes"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-blocklisted-for-writes\u2460"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": false}; window.dfnpanelData['blocklisted-manufacturer-data'] = {"dfnID": "blocklisted-manufacturer-data", "url": "#blocklisted-manufacturer-data", "dfnText": "blocklisted manufacturer data", "refSections": [{"refs": [{"id": "ref-for-blocklisted-manufacturer-data"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['blocklisted-manufacturer-data-filter'] = {"dfnID": "blocklisted-manufacturer-data-filter", "url": "#blocklisted-manufacturer-data-filter", "dfnText": "blocklisted manufacturer data filter", "refSections": [{"refs": [{"id": "ref-for-blocklisted-manufacturer-data-filter"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['associated-bluetooth'] = {"dfnID": "associated-bluetooth", "url": "#associated-bluetooth", "dfnText": "associated Bluetooth", "refSections": [{"refs": [{"id": "ref-for-associated-bluetooth"}, {"id": "ref-for-associated-bluetooth\u2460"}], "title": "10. Extensions to the Navigator Interface"}, {"refs": [{"id": "ref-for-associated-bluetooth\u2461"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": false}; window.dfnpanelData['dom-navigator-bluetooth'] = {"dfnID": "dom-navigator-bluetooth", "url": "#dom-navigator-bluetooth", "dfnText": "bluetooth", "refSections": [{"refs": [{"id": "ref-for-dom-navigator-bluetooth"}, {"id": "ref-for-dom-navigator-bluetooth\u2460"}, {"id": "ref-for-dom-navigator-bluetooth\u2461"}, {"id": "ref-for-dom-navigator-bluetooth\u2462"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-dom-navigator-bluetooth\u2463"}, {"id": "ref-for-dom-navigator-bluetooth\u2464"}, {"id": "ref-for-dom-navigator-bluetooth\u2465"}], "title": "6.6.1. Bluetooth Tree"}, {"refs": [{"id": "ref-for-dom-navigator-bluetooth\u2466"}], "title": "10. Extensions to the Navigator Interface"}, {"refs": [{"id": "ref-for-dom-navigator-bluetooth\u2467"}], "title": "11.1. Permissions Policy"}], "external": false}; window.dfnpanelData['policy-controlled-feature-bluetooth'] = {"dfnID": "policy-controlled-feature-bluetooth", "url": "#policy-controlled-feature-bluetooth", "dfnText": "bluetooth", "refSections": [{"refs": [{"id": "ref-for-policy-controlled-feature-bluetooth"}, {"id": "ref-for-policy-controlled-feature-bluetooth\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-policy-controlled-feature-bluetooth\u2461"}], "title": "4.2. Overall Bluetooth availability"}], "external": false}; window.dfnpanelData['simulated-bluetooth-adapter'] = {"dfnID": "simulated-bluetooth-adapter", "url": "#simulated-bluetooth-adapter", "dfnText": "simulated Bluetooth adapter", "refSections": [{"refs": [{"id": "ref-for-simulated-bluetooth-adapter"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-simulated-bluetooth-adapter\u2460"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-simulated-bluetooth-adapter\u2461"}, {"id": "ref-for-simulated-bluetooth-adapter\u2462"}, {"id": "ref-for-simulated-bluetooth-adapter\u2463"}], "title": "12. Automated testing"}, {"refs": [{"id": "ref-for-simulated-bluetooth-adapter\u2464"}, {"id": "ref-for-simulated-bluetooth-adapter\u2465"}], "title": "12.2.3.2. The bluetooth.simulateAdapter Command"}, {"refs": [{"id": "ref-for-simulated-bluetooth-adapter\u2466"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}, {"refs": [{"id": "ref-for-simulated-bluetooth-adapter\u2467"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": false}; window.dfnpanelData['simulated-bluetooth-device-mapping'] = {"dfnID": "simulated-bluetooth-device-mapping", "url": "#simulated-bluetooth-device-mapping", "dfnText": "simulated Bluetooth device mapping", "refSections": [{"refs": [{"id": "ref-for-simulated-bluetooth-device-mapping"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-simulated-bluetooth-device-mapping\u2460"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}, {"refs": [{"id": "ref-for-simulated-bluetooth-device-mapping\u2461"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": false}; window.dfnpanelData['adapter-state'] = {"dfnID": "adapter-state", "url": "#adapter-state", "dfnText": "adapter state", "refSections": [{"refs": [{"id": "ref-for-adapter-state"}], "title": "4.2. Overall Bluetooth availability"}, {"refs": [{"id": "ref-for-adapter-state\u2460"}], "title": "12.2.3.2. The bluetooth.simulateAdapter Command"}], "external": false}; window.dfnpanelData['simulated-bluetooth-device'] = {"dfnID": "simulated-bluetooth-device", "url": "#simulated-bluetooth-device", "dfnText": "simulated Bluetooth device", "refSections": [{"refs": [{"id": "ref-for-simulated-bluetooth-device"}, {"id": "ref-for-simulated-bluetooth-device\u2460"}], "title": "12. Automated testing"}, {"refs": [{"id": "ref-for-simulated-bluetooth-device\u2461"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}, {"refs": [{"id": "ref-for-simulated-bluetooth-device\u2462"}], "title": "12.2.3.4. The bluetooth.simulateAdvertisement Command"}], "external": false}; window.dfnpanelData['device-prompt'] = {"dfnID": "device-prompt", "url": "#device-prompt", "dfnText": "device prompt", "refSections": [{"refs": [{"id": "ref-for-device-prompt"}, {"id": "ref-for-device-prompt\u2460"}, {"id": "ref-for-device-prompt\u2461"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}, {"refs": [{"id": "ref-for-device-prompt\u2462"}], "title": "12.2.2. Errors"}, {"refs": [{"id": "ref-for-device-prompt\u2463"}], "title": "12.2.4.1. The bluetooth.requestDevicePromptUpdated Event"}], "external": false}; window.dfnpanelData['device-prompt-id'] = {"dfnID": "device-prompt-id", "url": "#device-prompt-id", "dfnText": "device\nprompt id", "refSections": [{"refs": [{"id": "ref-for-device-prompt-id"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}], "external": false}; window.dfnpanelData['set-of-devices'] = {"dfnID": "set-of-devices", "url": "#set-of-devices", "dfnText": "set of devices", "refSections": [{"refs": [{"id": "ref-for-set-of-devices"}, {"id": "ref-for-set-of-devices\u2460"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}], "external": false}; window.dfnpanelData['serialize-a-device'] = {"dfnID": "serialize-a-device", "url": "#serialize-a-device", "dfnText": "serialize a device", "refSections": [{"refs": [{"id": "ref-for-serialize-a-device"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}], "external": false}; window.dfnpanelData['map-of-navigables-to-device-prompts'] = {"dfnID": "map-of-navigables-to-device-prompts", "url": "#map-of-navigables-to-device-prompts", "dfnText": "map of navigables to device prompts", "refSections": [{"refs": [{"id": "ref-for-map-of-navigables-to-device-prompts"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-map-of-navigables-to-device-prompts\u2460"}, {"id": "ref-for-map-of-navigables-to-device-prompts\u2461"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}, {"refs": [{"id": "ref-for-map-of-navigables-to-device-prompts\u2462"}], "title": "12.2.4.1. The bluetooth.requestDevicePromptUpdated Event"}], "external": false}; window.dfnpanelData['get-a-prompt'] = {"dfnID": "get-a-prompt", "url": "#get-a-prompt", "dfnText": "get a prompt", "refSections": [{"refs": [{"id": "ref-for-get-a-prompt"}], "title": "12.2.3.1. The bluetooth.handleRequestDevicePrompt Command"}], "external": false}; window.dfnpanelData['match-a-device-in-prompt'] = {"dfnID": "match-a-device-in-prompt", "url": "#match-a-device-in-prompt", "dfnText": "match a device in prompt", "refSections": [{"refs": [{"id": "ref-for-match-a-device-in-prompt"}], "title": "12.2.3.1. The bluetooth.handleRequestDevicePrompt Command"}], "external": false}; window.dfnpanelData['serialize-prompt-devices'] = {"dfnID": "serialize-prompt-devices", "url": "#serialize-prompt-devices", "dfnText": "serialize prompt devices", "refSections": [{"refs": [{"id": "ref-for-serialize-prompt-devices"}], "title": "12.2.4.1. The bluetooth.requestDevicePromptUpdated Event"}], "external": false}; window.dfnpanelData['no-such-device'] = {"dfnID": "no-such-device", "url": "#no-such-device", "dfnText": "no such device", "refSections": [{"refs": [{"id": "ref-for-no-such-device"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}], "external": false}; window.dfnpanelData['no-such-prompt'] = {"dfnID": "no-such-prompt", "url": "#no-such-prompt", "dfnText": "no such prompt", "refSections": [{"refs": [{"id": "ref-for-no-such-prompt"}, {"id": "ref-for-no-such-prompt\u2460"}], "title": "12.2.1.3. The bluetooth.RequestDevicePrompt Type"}], "external": false}; window.dfnpanelData['trigger-a-prompt-updated-event'] = {"dfnID": "trigger-a-prompt-updated-event", "url": "#trigger-a-prompt-updated-event", "dfnText": "trigger a prompt updated event", "refSections": [{"refs": [{"id": "ref-for-trigger-a-prompt-updated-event"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['read-only-arraybuffer'] = {"dfnID": "read-only-arraybuffer", "url": "#read-only-arraybuffer", "dfnText": "read only ArrayBuffer", "refSections": [{"refs": [{"id": "ref-for-read-only-arraybuffer"}, {"id": "ref-for-read-only-arraybuffer\u2460"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['advertising-event'] = {"dfnID": "advertising-event", "url": "#advertising-event", "dfnText": "advertising events", "refSections": [{"refs": [{"id": "ref-for-advertising-event"}, {"id": "ref-for-advertising-event\u2460"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['extended-inquiry-response'] = {"dfnID": "extended-inquiry-response", "url": "#extended-inquiry-response", "dfnText": "Extended Inquiry Response", "refSections": [{"refs": [{"id": "ref-for-extended-inquiry-response"}, {"id": "ref-for-extended-inquiry-response\u2460"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-extended-inquiry-response\u2461"}, {"id": "ref-for-extended-inquiry-response\u2462"}], "title": "5.1. Global Bluetooth device properties"}], "external": false}; window.dfnpanelData['read-bd_addr-command'] = {"dfnID": "read-bd_addr-command", "url": "#read-bd_addr-command", "dfnText": "Read BD_ADDR Command", "refSections": [{"refs": [{"id": "ref-for-read-bd_addr-command"}], "title": "3.4. Bluetooth device identifiers"}], "external": false}; window.dfnpanelData['rssi'] = {"dfnID": "rssi", "url": "#rssi", "dfnText": "\n \n RSSI", "refSections": [{"refs": [{"id": "ref-for-rssi"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['searching-for-services'] = {"dfnID": "searching-for-services", "url": "#searching-for-services", "dfnText": "Searching for Services", "refSections": [{"refs": [{"id": "ref-for-searching-for-services"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['uuid'] = {"dfnID": "uuid", "url": "#uuid", "dfnText": "UUID", "refSections": [{"refs": [{"id": "ref-for-uuid"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-uuid\u2460"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-uuid\u2461"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-uuid\u2462"}, {"id": "ref-for-uuid\u2463"}, {"id": "ref-for-uuid\u2464"}, {"id": "ref-for-uuid\u2465"}], "title": "7. UUIDs"}, {"refs": [{"id": "ref-for-uuid\u2466"}, {"id": "ref-for-uuid\u2467"}, {"id": "ref-for-uuid\u2468"}], "title": "9. The Blocklist"}], "external": false}; window.dfnpanelData['uuid-alias'] = {"dfnID": "uuid-alias", "url": "#uuid-alias", "dfnText": "UUID alias", "refSections": [{"refs": [{"id": "ref-for-uuid-alias"}], "title": "7. UUIDs"}], "external": false}; window.dfnpanelData['the-128-bit-uuid-represented'] = {"dfnID": "the-128-bit-uuid-represented", "url": "#the-128-bit-uuid-represented", "dfnText": "the 128-bit UUID represented", "refSections": [{"refs": [{"id": "ref-for-the-128-bit-uuid-represented"}], "title": "7.1. Standardized UUIDs"}], "external": false}; window.dfnpanelData['broadcaster'] = {"dfnID": "broadcaster", "url": "#broadcaster", "dfnText": "Broadcaster", "refSections": [{"refs": [{"id": "ref-for-broadcaster"}], "title": "1. Introduction"}], "external": false}; window.dfnpanelData['observer'] = {"dfnID": "observer", "url": "#observer", "dfnText": "Observer", "refSections": [{"refs": [{"id": "ref-for-observer"}], "title": "1. Introduction"}], "external": false}; window.dfnpanelData['peripheral'] = {"dfnID": "peripheral", "url": "#peripheral", "dfnText": "Peripheral", "refSections": [{"refs": [{"id": "ref-for-peripheral"}, {"id": "ref-for-peripheral\u2460"}, {"id": "ref-for-peripheral\u2461"}], "title": "1. Introduction"}], "external": false}; window.dfnpanelData['central'] = {"dfnID": "central", "url": "#central", "dfnText": "Central", "refSections": [{"refs": [{"id": "ref-for-central"}, {"id": "ref-for-central\u2460"}, {"id": "ref-for-central\u2461"}], "title": "1. Introduction"}, {"refs": [{"id": "ref-for-central\u2462"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-central\u2463"}], "title": "12. Automated testing"}], "external": false}; window.dfnpanelData['bluetooth-device-name'] = {"dfnID": "bluetooth-device-name", "url": "#bluetooth-device-name", "dfnText": "Bluetooth Device Name", "refSections": [{"refs": [{"id": "ref-for-bluetooth-device-name"}], "title": "3.4. Bluetooth device identifiers"}, {"refs": [{"id": "ref-for-bluetooth-device-name\u2460"}, {"id": "ref-for-bluetooth-device-name\u2461"}, {"id": "ref-for-bluetooth-device-name\u2462"}, {"id": "ref-for-bluetooth-device-name\u2463"}, {"id": "ref-for-bluetooth-device-name\u2464"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-bluetooth-device-name\u2465"}, {"id": "ref-for-bluetooth-device-name\u2466"}], "title": "5.1. Global Bluetooth device properties"}, {"refs": [{"id": "ref-for-bluetooth-device-name\u2467"}], "title": "5.2. BluetoothDevice"}], "external": false}; window.dfnpanelData['device-discovery-procedure'] = {"dfnID": "device-discovery-procedure", "url": "#device-discovery-procedure", "dfnText": "Device Discovery Procedure", "refSections": [{"refs": [{"id": "ref-for-device-discovery-procedure"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['br-edr-bonding-procedure'] = {"dfnID": "br-edr-bonding-procedure", "url": "#br-edr-bonding-procedure", "dfnText": "BR/EDR Bonding Procedure", "refSections": [{"refs": [{"id": "ref-for-br-edr-bonding-procedure"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": false}; window.dfnpanelData['observation-procedure'] = {"dfnID": "observation-procedure", "url": "#observation-procedure", "dfnText": "Observation Procedure", "refSections": [{"refs": [{"id": "ref-for-observation-procedure"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['general-discovery-procedure'] = {"dfnID": "general-discovery-procedure", "url": "#general-discovery-procedure", "dfnText": "General Discovery Procedure", "refSections": [{"refs": [{"id": "ref-for-general-discovery-procedure"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['name-discovery-procedure'] = {"dfnID": "name-discovery-procedure", "url": "#name-discovery-procedure", "dfnText": "Name Discovery Procedure", "refSections": [{"refs": [{"id": "ref-for-name-discovery-procedure"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['le-bonding-procedure'] = {"dfnID": "le-bonding-procedure", "url": "#le-bonding-procedure", "dfnText": "LE Bonding Procedure", "refSections": [{"refs": [{"id": "ref-for-le-bonding-procedure"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": false}; window.dfnpanelData['privacy-feature'] = {"dfnID": "privacy-feature", "url": "#privacy-feature", "dfnText": "Privacy Feature", "refSections": [{"refs": [{"id": "ref-for-privacy-feature"}, {"id": "ref-for-privacy-feature\u2460"}, {"id": "ref-for-privacy-feature\u2461"}], "title": "3.4.2. The UA\u2019s Bluetooth address"}, {"refs": [{"id": "ref-for-privacy-feature\u2462"}, {"id": "ref-for-privacy-feature\u2463"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['static-address'] = {"dfnID": "static-address", "url": "#static-address", "dfnText": "Static Address", "refSections": [{"refs": [{"id": "ref-for-static-address"}, {"id": "ref-for-static-address\u2460"}], "title": "5.1. Global Bluetooth device properties"}], "external": false}; window.dfnpanelData['private-address'] = {"dfnID": "private-address", "url": "#private-address", "dfnText": "Private address", "refSections": [{"refs": [{"id": "ref-for-private-address"}], "title": "3.4. Bluetooth device identifiers"}, {"refs": [{"id": "ref-for-private-address\u2460"}, {"id": "ref-for-private-address\u2461"}, {"id": "ref-for-private-address\u2462"}], "title": "5.1. Global Bluetooth device properties"}], "external": false}; window.dfnpanelData['resolvable-private-address-resolution-procedure'] = {"dfnID": "resolvable-private-address-resolution-procedure", "url": "#resolvable-private-address-resolution-procedure", "dfnText": "Resolvable Private Address Resolution Procedure", "refSections": [{"refs": [{"id": "ref-for-resolvable-private-address-resolution-procedure"}], "title": "3.4. Bluetooth device identifiers"}, {"refs": [{"id": "ref-for-resolvable-private-address-resolution-procedure\u2460"}], "title": "5.1. Global Bluetooth device properties"}], "external": false}; window.dfnpanelData['advertising-data'] = {"dfnID": "advertising-data", "url": "#advertising-data", "dfnText": "Advertising Data", "refSections": [{"refs": [{"id": "ref-for-advertising-data"}, {"id": "ref-for-advertising-data\u2460"}], "title": "5.1. Global Bluetooth device properties"}], "external": false}; window.dfnpanelData['ad-structure'] = {"dfnID": "ad-structure", "url": "#ad-structure", "dfnText": "AD structure", "refSections": [{"refs": [{"id": "ref-for-ad-structure"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['bd_addr'] = {"dfnID": "bd_addr", "url": "#bd_addr", "dfnText": "BD_ADDR", "refSections": [{"refs": [{"id": "ref-for-bd_addr"}, {"id": "ref-for-bd_addr\u2460"}], "title": "3.4. Bluetooth device identifiers"}], "external": false}; window.dfnpanelData['public-bluetooth-address'] = {"dfnID": "public-bluetooth-address", "url": "#public-bluetooth-address", "dfnText": "Public Bluetooth Address", "refSections": [{"refs": [{"id": "ref-for-public-bluetooth-address"}, {"id": "ref-for-public-bluetooth-address\u2460"}], "title": "5.1. Global Bluetooth device properties"}], "external": false}; window.dfnpanelData['bond'] = {"dfnID": "bond", "url": "#bond", "dfnText": "bond", "refSections": [{"refs": [{"id": "ref-for-bond"}, {"id": "ref-for-bond\u2460"}], "title": "6.1.1. Persistence across connections"}], "external": false}; window.dfnpanelData['attribute-type'] = {"dfnID": "attribute-type", "url": "#attribute-type", "dfnText": "Attribute Type", "refSections": [{"refs": [{"id": "ref-for-attribute-type"}], "title": "7. UUIDs"}], "external": false}; window.dfnpanelData['attribute-handle'] = {"dfnID": "attribute-handle", "url": "#attribute-handle", "dfnText": "Attribute Handle", "refSections": [{"refs": [{"id": "ref-for-attribute-handle"}, {"id": "ref-for-attribute-handle\u2460"}, {"id": "ref-for-attribute-handle\u2461"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-attribute-handle\u2462"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-attribute-handle\u2463"}, {"id": "ref-for-attribute-handle\u2464"}], "title": "6.1.4. Identifying Services, Characteristics, and Descriptors"}], "external": false}; window.dfnpanelData['long-attribute-values'] = {"dfnID": "long-attribute-values", "url": "#long-attribute-values", "dfnText": "Long Attribute Values", "refSections": [{"refs": [{"id": "ref-for-long-attribute-values"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-long-attribute-values\u2460"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": false}; window.dfnpanelData['error-response'] = {"dfnID": "error-response", "url": "#error-response", "dfnText": "Error Response", "refSections": [{"refs": [{"id": "ref-for-error-response"}], "title": "6.7. Error handling"}], "external": false}; window.dfnpanelData['generic-attribute-profile'] = {"dfnID": "generic-attribute-profile", "url": "#generic-attribute-profile", "dfnText": "Generic Attribute Profile", "refSections": [{"refs": [{"id": "ref-for-generic-attribute-profile"}], "title": "1. Introduction"}, {"refs": [{"id": "ref-for-generic-attribute-profile\u2460"}], "title": "3.3. Attacks on devices"}], "external": false}; window.dfnpanelData['gatt-client'] = {"dfnID": "gatt-client", "url": "#gatt-client", "dfnText": "GATT Client", "refSections": [{"refs": [{"id": "ref-for-gatt-client"}, {"id": "ref-for-gatt-client\u2460"}], "title": "6.1. GATT Information Model"}], "external": false}; window.dfnpanelData['gatt-server'] = {"dfnID": "gatt-server", "url": "#gatt-server", "dfnText": "GATT Server", "refSections": [{"refs": [{"id": "ref-for-gatt-server"}, {"id": "ref-for-gatt-server\u2460"}], "title": "1. Introduction"}, {"refs": [{"id": "ref-for-gatt-server\u2461"}, {"id": "ref-for-gatt-server\u2462"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-gatt-server\u2463"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-gatt-server\u2464"}], "title": "6.6.1. Bluetooth Tree"}], "external": false}; window.dfnpanelData['profile-fundamentals'] = {"dfnID": "profile-fundamentals", "url": "#profile-fundamentals", "dfnText": "Profile Fundamentals", "refSections": [{"refs": [{"id": "ref-for-profile-fundamentals"}], "title": "6.7. Error handling"}], "external": false}; window.dfnpanelData['att-bearer'] = {"dfnID": "att-bearer", "url": "#att-bearer", "dfnText": "ATT Bearer", "refSections": [{"refs": [{"id": "ref-for-att-bearer"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-att-bearer\u2460"}, {"id": "ref-for-att-bearer\u2461"}], "title": "5.1. Global Bluetooth device properties"}, {"refs": [{"id": "ref-for-att-bearer\u2462"}, {"id": "ref-for-att-bearer\u2463"}, {"id": "ref-for-att-bearer\u2464"}, {"id": "ref-for-att-bearer\u2465"}], "title": "6.2. BluetoothRemoteGATTServer"}, {"refs": [{"id": "ref-for-att-bearer\u2466"}, {"id": "ref-for-att-bearer\u2467"}], "title": "6.6.3. Responding to Disconnection"}], "external": false}; window.dfnpanelData['attribute-caching'] = {"dfnID": "attribute-caching", "url": "#attribute-caching", "dfnText": "Attribute Caching", "refSections": [{"refs": [{"id": "ref-for-attribute-caching"}], "title": "6.1.1. Persistence across connections"}, {"refs": [{"id": "ref-for-attribute-caching\u2460"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['gatt-profile-hierarchy'] = {"dfnID": "gatt-profile-hierarchy", "url": "#gatt-profile-hierarchy", "dfnText": "GATT Profile Hierarchy", "refSections": [{"refs": [{"id": "ref-for-gatt-profile-hierarchy"}], "title": "6.1. GATT Information Model"}], "external": false}; window.dfnpanelData['service'] = {"dfnID": "service", "url": "#service", "dfnText": "Service", "refSections": [{"refs": [{"id": "ref-for-service"}], "title": "1. Introduction"}, {"refs": [{"id": "ref-for-service\u2460"}, {"id": "ref-for-service\u2461"}, {"id": "ref-for-service\u2462"}, {"id": "ref-for-service\u2463"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-service\u2464"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-service\u2465"}, {"id": "ref-for-service\u2466"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-service\u2467"}], "title": "6.6.1. Bluetooth Tree"}, {"refs": [{"id": "ref-for-service\u2468"}, {"id": "ref-for-service\u2460\u24ea"}, {"id": "ref-for-service\u2460\u2460"}, {"id": "ref-for-service\u2460\u2461"}, {"id": "ref-for-service\u2460\u2462"}, {"id": "ref-for-service\u2460\u2463"}, {"id": "ref-for-service\u2460\u2464"}, {"id": "ref-for-service\u2460\u2465"}, {"id": "ref-for-service\u2460\u2466"}, {"id": "ref-for-service\u2460\u2467"}, {"id": "ref-for-service\u2460\u2468"}, {"id": "ref-for-service\u2461\u24ea"}, {"id": "ref-for-service\u2461\u2460"}, {"id": "ref-for-service\u2461\u2461"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['included-service'] = {"dfnID": "included-service", "url": "#included-service", "dfnText": "Included Service", "refSections": [{"refs": [{"id": "ref-for-included-service"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-included-service\u2460"}, {"id": "ref-for-included-service\u2461"}], "title": "6.3. BluetoothRemoteGATTService"}], "external": false}; window.dfnpanelData['characteristic'] = {"dfnID": "characteristic", "url": "#characteristic", "dfnText": "Characteristic", "refSections": [{"refs": [{"id": "ref-for-characteristic"}], "title": "1. Introduction"}, {"refs": [{"id": "ref-for-characteristic\u2460"}], "title": "3.3. Attacks on devices"}, {"refs": [{"id": "ref-for-characteristic\u2461"}, {"id": "ref-for-characteristic\u2462"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-characteristic\u2463"}, {"id": "ref-for-characteristic\u2464"}], "title": "6.3. BluetoothRemoteGATTService"}, {"refs": [{"id": "ref-for-characteristic\u2465"}, {"id": "ref-for-characteristic\u2466"}, {"id": "ref-for-characteristic\u2467"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-characteristic\u2468"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-characteristic\u2460\u24ea"}, {"id": "ref-for-characteristic\u2460\u2460"}], "title": "6.6.4. Responding to Notifications and Indications"}, {"refs": [{"id": "ref-for-characteristic\u2460\u2461"}, {"id": "ref-for-characteristic\u2460\u2462"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['service-interoperability-requirements'] = {"dfnID": "service-interoperability-requirements", "url": "#service-interoperability-requirements", "dfnText": "Service Interoperability Requirements", "refSections": [{"refs": [{"id": "ref-for-service-interoperability-requirements"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['service-definition'] = {"dfnID": "service-definition", "url": "#service-definition", "dfnText": "Service Definition", "refSections": [{"refs": [{"id": "ref-for-service-definition"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['characteristic-properties'] = {"dfnID": "characteristic-properties", "url": "#characteristic-properties", "dfnText": "Characteristic Properties", "refSections": [{"refs": [{"id": "ref-for-characteristic-properties"}, {"id": "ref-for-characteristic-properties\u2460"}, {"id": "ref-for-characteristic-properties\u2461"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-characteristic-properties\u2462"}, {"id": "ref-for-characteristic-properties\u2463"}, {"id": "ref-for-characteristic-properties\u2464"}], "title": "6.4.1. BluetoothCharacteristicProperties"}], "external": false}; window.dfnpanelData['descriptor'] = {"dfnID": "descriptor", "url": "#descriptor", "dfnText": "Descriptor", "refSections": [{"refs": [{"id": "ref-for-descriptor"}], "title": "1. Introduction"}, {"refs": [{"id": "ref-for-descriptor\u2460"}], "title": "3.3. Attacks on devices"}, {"refs": [{"id": "ref-for-descriptor\u2461"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-descriptor\u2462"}, {"id": "ref-for-descriptor\u2463"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-descriptor\u2464"}, {"id": "ref-for-descriptor\u2465"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}, {"refs": [{"id": "ref-for-descriptor\u2466"}, {"id": "ref-for-descriptor\u2467"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['characteristic-extended-properties'] = {"dfnID": "characteristic-extended-properties", "url": "#characteristic-extended-properties", "dfnText": "Characteristic Extended Properties", "refSections": [{"refs": [{"id": "ref-for-characteristic-extended-properties"}, {"id": "ref-for-characteristic-extended-properties\u2460"}], "title": "6.4.1. BluetoothCharacteristicProperties"}], "external": false}; window.dfnpanelData['client-characteristic-configuration'] = {"dfnID": "client-characteristic-configuration", "url": "#client-characteristic-configuration", "dfnText": "Client Characteristic Configuration", "refSections": [{"refs": [{"id": "ref-for-client-characteristic-configuration"}, {"id": "ref-for-client-characteristic-configuration\u2460"}, {"id": "ref-for-client-characteristic-configuration\u2461"}, {"id": "ref-for-client-characteristic-configuration\u2462"}, {"id": "ref-for-client-characteristic-configuration\u2463"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-client-characteristic-configuration\u2464"}, {"id": "ref-for-client-characteristic-configuration\u2465"}], "title": "6.6.3. Responding to Disconnection"}], "external": false}; window.dfnpanelData['gatt-procedure'] = {"dfnID": "gatt-procedure", "url": "#gatt-procedure", "dfnText": "GATT procedures", "refSections": [{"refs": [{"id": "ref-for-gatt-procedure"}], "title": "6.1. GATT Information Model"}, {"refs": [{"id": "ref-for-gatt-procedure\u2460"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-gatt-procedure\u2461"}], "title": "6.7. Error handling"}], "external": false}; window.dfnpanelData['exchange-mtu'] = {"dfnID": "exchange-mtu", "url": "#exchange-mtu", "dfnText": "Exchange MTU", "refSections": [{"refs": [{"id": "ref-for-exchange-mtu"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": false}; window.dfnpanelData['primary-service-discovery'] = {"dfnID": "primary-service-discovery", "url": "#primary-service-discovery", "dfnText": "Primary Service Discovery", "refSections": [{"refs": [{"id": "ref-for-primary-service-discovery"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['discover-primary-service-by-service-uuid'] = {"dfnID": "discover-primary-service-by-service-uuid", "url": "#discover-primary-service-by-service-uuid", "dfnText": "Discover Primary Service by Service UUID", "refSections": [{"refs": [{"id": "ref-for-discover-primary-service-by-service-uuid"}], "title": "6.6.1. Bluetooth Tree"}], "external": false}; window.dfnpanelData['relationship-discovery'] = {"dfnID": "relationship-discovery", "url": "#relationship-discovery", "dfnText": "Relationship Discovery", "refSections": [{"refs": [{"id": "ref-for-relationship-discovery"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['characteristic-discovery'] = {"dfnID": "characteristic-discovery", "url": "#characteristic-discovery", "dfnText": "Characteristic Discovery", "refSections": [{"refs": [{"id": "ref-for-characteristic-discovery"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['discover-characteristics-by-uuid'] = {"dfnID": "discover-characteristics-by-uuid", "url": "#discover-characteristics-by-uuid", "dfnText": "Discover Characteristics by UUID", "refSections": [{"refs": [{"id": "ref-for-discover-characteristics-by-uuid"}, {"id": "ref-for-discover-characteristics-by-uuid\u2460"}], "title": "6.1.2. The Bluetooth cache"}, {"refs": [{"id": "ref-for-discover-characteristics-by-uuid\u2461"}], "title": "6.6.1. Bluetooth Tree"}], "external": false}; window.dfnpanelData['characteristic-descriptor-discovery'] = {"dfnID": "characteristic-descriptor-discovery", "url": "#characteristic-descriptor-discovery", "dfnText": "Characteristic Descriptor Discovery", "refSections": [{"refs": [{"id": "ref-for-characteristic-descriptor-discovery"}], "title": "6.4.1. BluetoothCharacteristicProperties"}, {"refs": [{"id": "ref-for-characteristic-descriptor-discovery\u2460"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['discover-all-characteristic-descriptors'] = {"dfnID": "discover-all-characteristic-descriptors", "url": "#discover-all-characteristic-descriptors", "dfnText": "Discover All Characteristic Descriptors", "refSections": [{"refs": [{"id": "ref-for-discover-all-characteristic-descriptors"}], "title": "6.6.1. Bluetooth Tree"}], "external": false}; window.dfnpanelData['characteristic-value-read'] = {"dfnID": "characteristic-value-read", "url": "#characteristic-value-read", "dfnText": "Characteristic Value Read", "refSections": [{"refs": [{"id": "ref-for-characteristic-value-read"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['characteristic-value-write'] = {"dfnID": "characteristic-value-write", "url": "#characteristic-value-write", "dfnText": "Characteristic Value Write", "refSections": [{"refs": [{"id": "ref-for-characteristic-value-write"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['write-without-response'] = {"dfnID": "write-without-response", "url": "#write-without-response", "dfnText": "Write Without Response", "refSections": [{"refs": [{"id": "ref-for-write-without-response"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['write-characteristic-value'] = {"dfnID": "write-characteristic-value", "url": "#write-characteristic-value", "dfnText": "Write Characteristic Value", "refSections": [{"refs": [{"id": "ref-for-write-characteristic-value"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}], "external": false}; window.dfnpanelData['characteristic-value-notification'] = {"dfnID": "characteristic-value-notification", "url": "#characteristic-value-notification", "dfnText": "Characteristic Value Notification", "refSections": [{"refs": [{"id": "ref-for-characteristic-value-notification"}], "title": "6.6.4. Responding to Notifications and Indications"}], "external": false}; window.dfnpanelData['characteristic-value-indications'] = {"dfnID": "characteristic-value-indications", "url": "#characteristic-value-indications", "dfnText": "Characteristic Value Indications", "refSections": [{"refs": [{"id": "ref-for-characteristic-value-indications"}], "title": "6.6.4. Responding to Notifications and Indications"}], "external": false}; window.dfnpanelData['characteristic-descriptors'] = {"dfnID": "characteristic-descriptors", "url": "#characteristic-descriptors", "dfnText": "Characteristic Descriptors", "refSections": [{"refs": [{"id": "ref-for-characteristic-descriptors"}, {"id": "ref-for-characteristic-descriptors\u2460"}], "title": "6.4. BluetoothRemoteGATTCharacteristic"}, {"refs": [{"id": "ref-for-characteristic-descriptors\u2461"}], "title": "6.6.3. Responding to Disconnection"}], "external": false}; window.dfnpanelData['read-characteristic-descriptors'] = {"dfnID": "read-characteristic-descriptors", "url": "#read-characteristic-descriptors", "dfnText": "Read Characteristic Descriptors", "refSections": [{"refs": [{"id": "ref-for-read-characteristic-descriptors"}], "title": "6.4.1. BluetoothCharacteristicProperties"}, {"refs": [{"id": "ref-for-read-characteristic-descriptors\u2460"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": false}; window.dfnpanelData['read-long-characteristic-descriptors'] = {"dfnID": "read-long-characteristic-descriptors", "url": "#read-long-characteristic-descriptors", "dfnText": "Read Long Characteristic Descriptors", "refSections": [{"refs": [{"id": "ref-for-read-long-characteristic-descriptors"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": false}; window.dfnpanelData['write-characteristic-descriptors'] = {"dfnID": "write-characteristic-descriptors", "url": "#write-characteristic-descriptors", "dfnText": "Write Characteristic Descriptors", "refSections": [{"refs": [{"id": "ref-for-write-characteristic-descriptors"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": false}; window.dfnpanelData['write-long-characteristic-descriptors'] = {"dfnID": "write-long-characteristic-descriptors", "url": "#write-long-characteristic-descriptors", "dfnText": "Write Long Characteristic Descriptors", "refSections": [{"refs": [{"id": "ref-for-write-long-characteristic-descriptors"}], "title": "6.5. BluetoothRemoteGATTDescriptor"}], "external": false}; window.dfnpanelData['procedure-timeouts'] = {"dfnID": "procedure-timeouts", "url": "#procedure-timeouts", "dfnText": "Procedure Timeouts", "refSections": [{"refs": [{"id": "ref-for-procedure-timeouts"}], "title": "6.7. Error handling"}], "external": false}; window.dfnpanelData['gap-interoperability-requirements'] = {"dfnID": "gap-interoperability-requirements", "url": "#gap-interoperability-requirements", "dfnText": "GAP Interoperability Requirements", "refSections": [{"refs": [{"id": "ref-for-gap-interoperability-requirements"}], "title": "5.1. Global Bluetooth device properties"}, {"refs": [{"id": "ref-for-gap-interoperability-requirements\u2460"}], "title": "6.2. BluetoothRemoteGATTServer"}], "external": false}; window.dfnpanelData['service-changed'] = {"dfnID": "service-changed", "url": "#service-changed", "dfnText": "Service Changed", "refSections": [{"refs": [{"id": "ref-for-service-changed"}], "title": "6.6.2. Event types"}, {"refs": [{"id": "ref-for-service-changed\u2460"}], "title": "6.6.5. Responding to Service Changes"}], "external": false}; window.dfnpanelData['definition-of-keys-and-values'] = {"dfnID": "definition-of-keys-and-values", "url": "#definition-of-keys-and-values", "dfnText": "Definition of Keys and Values", "refSections": [{"refs": [{"id": "ref-for-definition-of-keys-and-values"}], "title": "3.3. Attacks on devices"}], "external": false}; window.dfnpanelData['identity-resolving-key'] = {"dfnID": "identity-resolving-key", "url": "#identity-resolving-key", "dfnText": "Identity Resolving Key", "refSections": [{"refs": [{"id": "ref-for-identity-resolving-key"}, {"id": "ref-for-identity-resolving-key\u2460"}], "title": "3.4. Bluetooth device identifiers"}, {"refs": [{"id": "ref-for-identity-resolving-key\u2461"}, {"id": "ref-for-identity-resolving-key\u2462"}], "title": "5.1. Global Bluetooth device properties"}], "external": false}; window.dfnpanelData['public-device-address'] = {"dfnID": "public-device-address", "url": "#public-device-address", "dfnText": "Public Device Address", "refSections": [{"refs": [{"id": "ref-for-public-device-address"}, {"id": "ref-for-public-device-address\u2460"}, {"id": "ref-for-public-device-address\u2461"}], "title": "3.4. Bluetooth device identifiers"}], "external": false}; window.dfnpanelData['static-device-address'] = {"dfnID": "static-device-address", "url": "#static-device-address", "dfnText": "Static Device Address", "refSections": [{"refs": [{"id": "ref-for-static-device-address"}, {"id": "ref-for-static-device-address\u2460"}], "title": "3.4. Bluetooth device identifiers"}], "external": false}; window.dfnpanelData['passive-scanning'] = {"dfnID": "passive-scanning", "url": "#passive-scanning", "dfnText": "Passive Scanning", "refSections": [{"refs": [{"id": "ref-for-passive-scanning"}, {"id": "ref-for-passive-scanning\u2460"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['service-uuid-data-type'] = {"dfnID": "service-uuid-data-type", "url": "#service-uuid-data-type", "dfnText": "Service UUID Data Type", "refSections": [{"refs": [{"id": "ref-for-service-uuid-data-type"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-service-uuid-data-type\u2460"}], "title": "5.1. Global Bluetooth device properties"}, {"refs": [{"id": "ref-for-service-uuid-data-type\u2461"}, {"id": "ref-for-service-uuid-data-type\u2462"}, {"id": "ref-for-service-uuid-data-type\u2463"}, {"id": "ref-for-service-uuid-data-type\u2464"}, {"id": "ref-for-service-uuid-data-type\u2465"}, {"id": "ref-for-service-uuid-data-type\u2466"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-service-uuid-data-type\u2467"}], "title": "12. Automated testing"}, {"refs": [{"id": "ref-for-service-uuid-data-type\u2468"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}], "external": false}; window.dfnpanelData['local-name-data-type'] = {"dfnID": "local-name-data-type", "url": "#local-name-data-type", "dfnText": "Local Name Data Type", "refSections": [{"refs": [{"id": "ref-for-local-name-data-type"}, {"id": "ref-for-local-name-data-type\u2460"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['flags-data-type'] = {"dfnID": "flags-data-type", "url": "#flags-data-type", "dfnText": "Flags Data Type", "refSections": [{"refs": [{"id": "ref-for-flags-data-type"}], "title": "5.1. Global Bluetooth device properties"}], "external": false}; window.dfnpanelData['discoverable-mode'] = {"dfnID": "discoverable-mode", "url": "#discoverable-mode", "dfnText": "Discoverable Mode", "refSections": [{"refs": [{"id": "ref-for-discoverable-mode"}], "title": "4. Device Discovery"}], "external": false}; window.dfnpanelData['manufacturer-specific-data'] = {"dfnID": "manufacturer-specific-data", "url": "#manufacturer-specific-data", "dfnText": "Manufacturer Specific Data", "refSections": [{"refs": [{"id": "ref-for-manufacturer-specific-data"}, {"id": "ref-for-manufacturer-specific-data\u2460"}, {"id": "ref-for-manufacturer-specific-data\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-manufacturer-specific-data\u2462"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-manufacturer-specific-data\u2463"}], "title": "12. Automated testing"}, {"refs": [{"id": "ref-for-manufacturer-specific-data\u2464"}], "title": "12.2.3.3. The bluetooth.simulatePreconnectedPeripheral Command"}], "external": false}; window.dfnpanelData['tx-power-level'] = {"dfnID": "tx-power-level", "url": "#tx-power-level", "dfnText": "TX Power Level", "refSections": [{"refs": [{"id": "ref-for-tx-power-level"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['service-data'] = {"dfnID": "service-data", "url": "#service-data", "dfnText": "Service Data", "refSections": [{"refs": [{"id": "ref-for-service-data"}, {"id": "ref-for-service-data\u2460"}, {"id": "ref-for-service-data\u2461"}], "title": "4. Device Discovery"}, {"refs": [{"id": "ref-for-service-data\u2462"}, {"id": "ref-for-service-data\u2463"}, {"id": "ref-for-service-data\u2464"}], "title": "5.2.3. Responding to Advertising Events"}], "external": false}; window.dfnpanelData['appearance'] = {"dfnID": "appearance", "url": "#appearance", "dfnText": "Appearance", "refSections": [{"refs": [{"id": "ref-for-appearance"}, {"id": "ref-for-appearance\u2460"}], "title": "5.2.3. Responding to Advertising Events"}, {"refs": [{"id": "ref-for-appearance\u2461"}], "title": "12.2.1.4. The bluetooth.ScanRecord Type"}], "external": false}; </script> <script>/* Boilerplate: script-dom-helper */ function query(sel) { return document.querySelector(sel); } function queryAll(sel) { return [...document.querySelectorAll(sel)]; } function iter(obj) { if(!obj) return []; var it = obj[Symbol.iterator]; if(it) return it; return Object.entries(obj); } function mk(tagname, attrs, ...children) { const el = document.createElement(tagname); for(const [k,v] of iter(attrs)) { if(k.slice(0,3) == "_on") { const eventName = k.slice(3); el.addEventListener(eventName, v); } else if(k[0] == "_") { // property, not attribute el[k.slice(1)] = v; } else { if(v === false || v == null) { continue; } else if(v === true) { el.setAttribute(k, ""); continue; } else { el.setAttribute(k, v); } } } append(el, children); return el; } /* Create shortcuts for every known HTML element */ [ "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "meta", "meter", "nav", "nobr", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "pre", "progress", "q", "s", "samp", "script", "section", "select", "small", "source", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "u", "ul", "var", "video", "wbr", "xmp", ].forEach(tagname=>{ mk[tagname] = (...args) => mk(tagname, ...args); }); function* nodesFromChildList(children) { for(const child of children.flat(Infinity)) { if(child instanceof Node) { yield child; } else { yield new Text(child); } } } function append(el, ...children) { for(const child of nodesFromChildList(children)) { if(el instanceof Node) el.appendChild(child); else el.push(child); } return el; } function insertAfter(el, ...children) { for(const child of nodesFromChildList(children)) { el.parentNode.insertBefore(child, el.nextSibling); } return el; } function clearContents(el) { el.innerHTML = ""; return el; } function parseHTML(markup) { if(markup.toLowerCase().trim().indexOf('<!doctype') === 0) { const doc = document.implementation.createHTMLDocument(""); doc.documentElement.innerHTML = markup; return doc; } else { const el = mk.template({}); el.innerHTML = markup; return el.content; } } </script> <script>/* Boilerplate: script-position-annos */ "use strict"; { function repositionAnnoPanels(){ const panels = [...document.querySelectorAll("[data-anno-for]")]; const main = document.querySelector("main"); let mainRect; if(main) mainRect = main.getBoundingClientRect(); for(const panel of panels) { const dfn = document.getElementById(panel.getAttribute("data-anno-for")); if(!dfn) { console.log("Can't find the annotation panel target:", panel); continue; } const rect = dfn.getBoundingClientRect(); const top = window.scrollY + rect.top panel.style.top = top + "px"; panel.top = top; panel.height = rect.height; panel.classList.remove("unpositioned"); const panelRect = panel.getBoundingClientRect() if(main) { panel.classList.toggle("overlapping-main", panelRect.left < mainRect.right) } } let vSoFar = 0; for(const panel of panels.sort(cmpTops)) { if(panel.top < vSoFar) { panel.top = vSoFar; panel.style.top = vSoFar + "px"; } vSoFar = panel.top + panel.height + 15; } } function cmpTops(a,b) { return a.top - b.top; } window.addEventListener("load", repositionAnnoPanels); window.addEventListener("resize", repositionAnnoPanels); } </script> <script>/* Boilerplate: script-var-click-highlighting */ /* Color-choosing design: Colors are ordered by goodness. Each color has a usage count (initially zero). Each variable has a last-used color. * If the var has a last-used color, and that color's usage is 0, return that color. * Otherwise, return the lowest-indexed color with the lowest usage. Increment the color's usage and set it as the last-used color for that var. * On unclicking, decrement usage of the color. */ "use strict"; { document.addEventListener("click", e=>{ if(e.target.nodeName == "VAR") { highlightSameAlgoVars(e.target); } }); const indexCounts = new Map(); const indexNames = new Map(); function highlightSameAlgoVars(v) { // Find the algorithm container. let algoContainer = null; let searchEl = v; while(algoContainer == null && searchEl != document.body) { searchEl = searchEl.parentNode; if(searchEl.hasAttribute("data-algorithm")) { algoContainer = searchEl; } } // Not highlighting document-global vars, // too likely to be unrelated. if(algoContainer == null) return; const algoName = algoContainer.getAttribute("data-algorithm"); const varName = getVarName(v); const addClass = !v.classList.contains("selected"); let highlightClass = null; if(addClass) { const index = chooseHighlightIndex(algoName, varName); indexCounts.get(algoName)[index] += 1; indexNames.set(algoName+"///"+varName, index); highlightClass = nameFromIndex(index); } else { const index = previousHighlightIndex(algoName, varName); indexCounts.get(algoName)[index] -= 1; highlightClass = nameFromIndex(index); } // Find all same-name vars, and toggle their class appropriately. for(const el of algoContainer.querySelectorAll("var")) { if(getVarName(el) == varName) { el.classList.toggle("selected", addClass); el.classList.toggle(highlightClass, addClass); } } } function getVarName(el) { return el.textContent.replace(/(\s|\xa0)+/, " ").trim(); } function chooseHighlightIndex(algoName, varName) { let indexes = null; if(indexCounts.has(algoName)) { indexes = indexCounts.get(algoName); } else { // 7 classes right now indexes = [0,0,0,0,0,0,0]; indexCounts.set(algoName, indexes); } // If the element was recently unclicked, // *and* that color is still unclaimed, // give it back the same color. const lastIndex = previousHighlightIndex(algoName, varName); if(indexes[lastIndex] === 0) return lastIndex; // Find the earliest index with the lowest count. const minCount = Math.min.apply(null, indexes); let index = null; for(var i = 0; i < indexes.length; i++) { if(indexes[i] == minCount) { return i; } } } function previousHighlightIndex(algoName, varName) { return indexNames.get(algoName+"///"+varName); } function nameFromIndex(index) { return "selected" + index; } } </script>

Pages: 1 2 3 4 5 6 7 8 9 10