Preparing search index...
The search index is not available
micro:bit Web Bluetooth API Documentation
micro:bit Web Bluetooth API Documentation
services/uart
UartService
Class UartService
UART Service
Hierarchy
TypedDispatcher
<
UartEvents
,
this
>
UartService
Index
Methods
add
Event
Listener
add
Listener
dispatch
Event
emit
event
Names
get
Max
Listeners
listener
Count
listeners
off
on
once
prepend
Listener
prepend
Once
Listener
raw
Listeners
remove
All
Listeners
remove
Event
Listener
remove
Listener
send
send
Text
set
Max
Listeners
Methods
add
Event
Listener
add
Event
Listener
<
K
>
(
type
,
listener
)
:
void
Type Parameters
K
extends
keyof
UartEvents
Parameters
type
:
K
listener
:
(
(
event
:
CustomEvent
<
UartEvents
[
K
]
>
)
=>
void
)
(
event
)
:
void
Parameters
event
:
CustomEvent
<
UartEvents
[
K
]
>
Returns
void
Returns
void
add
Listener
add
Listener
<
K
>
(
event
,
listener
)
:
this
Type Parameters
K
extends
keyof
UartEvents
Parameters
event
:
K
listener
:
(
(
data
:
UartEvents
[
K
]
)
=>
void
)
(
data
)
:
void
Parameters
data
:
UartEvents
[
K
]
Returns
void
Returns
this
dispatch
Event
dispatch
Event
(
event
)
:
boolean
Parameters
event
:
CustomEvent
<
UartEvents
>
Returns
boolean
dispatch
Event
<
K
>
(
type
,
detail
)
:
boolean
Type Parameters
K
extends
keyof
UartEvents
Parameters
type
:
K
detail
:
UartEvents
[
K
]
Returns
boolean
emit
emit
<
K
>
(
event
,
data
)
:
boolean
Type Parameters
K
extends
keyof
UartEvents
Parameters
event
:
K
data
:
UartEvents
[
K
]
Returns
boolean
event
Names
event
Names
<
K
>
(
)
:
K
[]
Type Parameters
K
extends
keyof
UartEvents
Returns
K
[]
get
Max
Listeners
get
Max
Listeners
(
)
:
number
Returns
number
listener
Count
listener
Count
<
K
>
(
type
)
:
number
Type Parameters
K
extends
keyof
UartEvents
Parameters
type
:
K
Returns
number
listeners
listeners
<
K
>
(
event
)
:
Function
[]
Type Parameters
K
extends
keyof
UartEvents
Parameters
event
:
K
Returns
Function
[]
off
off
<
K
>
(
event
,
listener
)
:
this
Type Parameters
K
extends
keyof
UartEvents
Parameters
event
:
K
listener
:
(
(
data
:
UartEvents
[
K
]
)
=>
void
)
(
data
)
:
void
Parameters
data
:
UartEvents
[
K
]
Returns
void
Returns
this
on
on
<
K
>
(
event
,
listener
)
:
this
Type Parameters
K
extends
keyof
UartEvents
Parameters
event
:
K
listener
:
(
(
data
:
UartEvents
[
K
]
)
=>
void
)
(
data
)
:
void
Parameters
data
:
UartEvents
[
K
]
Returns
void
Returns
this
once
once
<
K
>
(
event
,
listener
)
:
this
Type Parameters
K
extends
keyof
UartEvents
Parameters
event
:
K
listener
:
(
(
data
:
UartEvents
[
K
]
)
=>
void
)
(
data
)
:
void
Parameters
data
:
UartEvents
[
K
]
Returns
void
Returns
this
prepend
Listener
prepend
Listener
<
K
>
(
event
,
listener
)
:
this
Type Parameters
K
extends
keyof
UartEvents
Parameters
event
:
K
listener
:
(
(
data
:
UartEvents
[
K
]
)
=>
void
)
(
data
)
:
void
Parameters
data
:
UartEvents
[
K
]
Returns
void
Returns
this
prepend
Once
Listener
prepend
Once
Listener
<
K
>
(
event
,
listener
)
:
this
Type Parameters
K
extends
keyof
UartEvents
Parameters
event
:
K
listener
:
(
(
data
:
UartEvents
[
K
]
)
=>
void
)
(
data
)
:
void
Parameters
data
:
UartEvents
[
K
]
Returns
void
Returns
this
raw
Listeners
raw
Listeners
<
K
>
(
event
)
:
Function
[]
Type Parameters
K
extends
keyof
UartEvents
Parameters
event
:
K
Returns
Function
[]
remove
All
Listeners
remove
All
Listeners
<
K
>
(
event
?
)
:
this
Type Parameters
K
extends
keyof
UartEvents
Parameters
Optional
event
:
K
Returns
this
remove
Event
Listener
remove
Event
Listener
<
K
>
(
type
,
callback
)
:
void
Type Parameters
K
extends
keyof
UartEvents
Parameters
type
:
K
callback
:
(
(
event
:
CustomEvent
<
UartEvents
[
K
]
>
)
=>
void
)
(
event
)
:
void
Parameters
event
:
CustomEvent
<
UartEvents
[
K
]
>
Returns
void
Returns
void
remove
Listener
remove
Listener
<
K
>
(
event
,
listener
)
:
this
Type Parameters
K
extends
keyof
UartEvents
Parameters
event
:
K
listener
:
(
(
data
:
UartEvents
[
K
]
)
=>
void
)
(
data
)
:
void
Parameters
data
:
UartEvents
[
K
]
Returns
void
Returns
this
send
send
(
value
)
:
Promise
<
void
>
Send serial data
Parameters
value
:
BufferSource
The buffer to send
Returns
Promise
<
void
>
send
Text
send
Text
(
value
)
:
Promise
<
void
>
Send serial text
Parameters
value
:
string
The text to send
Returns
Promise
<
void
>
set
Max
Listeners
set
Max
Listeners
(
n
)
:
this
Parameters
n
:
number
Returns
this
Settings
Member Visibility
Protected
Inherited
Theme
OS
Light
Dark
On This Page
Methods
add
Event
Listener
add
Listener
dispatch
Event
emit
event
Names
get
Max
Listeners
listener
Count
listeners
off
on
once
prepend
Listener
prepend
Once
Listener
raw
Listeners
remove
All
Listeners
remove
Event
Listener
remove
Listener
send
send
Text
set
Max
Listeners
micro:bit Web Bluetooth API Documentation
Loading...
UART Service