PROTOCOLS
Buttons
Defined in fuchsia.buttons/buttons.fidl
Protocol for other devices to get the state of buttons and register for notifications of state change.
GetState
Gets the state of the button requested.
type
: Button type.
@Returns: pressed
: True if button is pressed.
Request
Name | Type |
---|---|
type |
ButtonType
|
Response
Name | Type |
---|---|
pressed |
bool
|
OnNotify
Notify event. Called when state of previously registered button changes.
type
: Button type.
pressed
: True if button is pressed.
Response
Name | Type |
---|---|
type |
ButtonType
|
pressed |
bool
|
RegisterNotify
Registers to receive notifications of a state change for some buttons.
types
: Bitmask which indicates the interested buttons. 0 means not
interested, 1 means interested. Bit position corresponds to
ButtonType, e.g. (1 << VOLUME_UP) means notify only when
the state of the VOLUME_UP button changes. Types not listed
in subsequent calls are removed.
@Returns: status
: ZX_OK if succeeds.
Request
Name | Type |
---|---|
types |
uint8
|
Response
Name | Type |
---|---|
result |
Buttons_RegisterNotify_Result
|
STRUCTS
Buttons_RegisterNotify_Response
Defined in fuchsia.buttons/buttons.fidl
Name | Type | Description | Default |
---|
ENUMS
ButtonType
Type: uint8
Defined in fuchsia.buttons/buttons.fidl
ButtonType should the same as BUTTONS_ID_... in metadata/buttons.h
Name | Value | Description |
---|---|---|
VOLUME_UP |
0 |
|
VOLUME_DOWN |
1 |
|
RESET |
2 |
|
MUTE |
3 |
|
PLAY_PAUSE |
4 |
|
KEY_A |
5 |
|
KEY_M |
6 |
|
CAM_MUTE |
7 |
|
MAX |
8 |
UNIONS
Buttons_RegisterNotify_Result
Defined in fuchsia.buttons/buttons.fidl
Name | Type | Description |
---|---|---|
response |
Buttons_RegisterNotify_Response
|
|
err |
zx/status
|