PROTOCOLS
Device
Defined in fuchsia.hardware.haptics/haptics.fidl
GetProperties
Returns the haptics-related properties of the haptics device.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Device_GetProperties_Result
|
PlayCompositeWaveform
Play a composite waveform. Returns ZX_ERR_BAD_STATE if a vibration is
currently playing.
Function does not return until the vibration has completed.
Request
| Name | Type |
|---|---|
composite_waveform |
vector<CompositeEffect>
|
Response
| Name | Type |
|---|---|
payload |
Device_PlayCompositeWaveform_Result
|
PlayEffect
Play an effect. Returns ZX_ERR_BAD_STATE if a vibration is currently
playing.
Function does not return until the vibration has completed.
Request
| Name | Type |
|---|---|
effect |
Effect
|
strength |
EffectStrength
|
Response
| Name | Type |
|---|---|
payload |
Device_PlayEffect_Result
|
PlayVibration
Play a constant vibration for a period of time. Returns
ZX_ERR_BAD_STATE if a vibration is currently playing.
Function does not return until the vibration has completed.
Request
| Name | Type |
|---|---|
duration |
zx/Duration
|
Response
| Name | Type |
|---|---|
payload |
Device_PlayVibration_Result
|
SetAmplitude
Alters the gain on vibrations played in the future.
Request
| Name | Type |
|---|---|
amplitude |
float32
|
Response
| Name | Type |
|---|---|
payload |
Device_SetAmplitude_Result
|
StartVibration
Deprecated. Do not use. TODO(b/419629139): Remove once no longer used.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Device_StartVibration_Result
|
StopVibration
Stops the vibration that is currently playing. Does nothing if there isn't a vibration currently playing.
Function does not return until the vibration has stopped and its corresponding FIDL request to play the vibration has completed.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Device_StopVibration_Result
|
STRUCTS
CompositeEffect
Defined in fuchsia.hardware.haptics/haptics.fidl
| Field | Type | Description | Default |
|---|---|---|---|
delay |
zx/Duration
|
Delay before fuchsia.hardware.haptics/SupportedEffect.waveform is played. |
No default |
waveform |
CompositeEffectWaveform
|
Waveform to be played. |
No default |
scale |
float32
|
Adjusts the gain applied to fuchsia.hardware.haptics/SupportedEffect.waveform when played. Must be in range [0.0, 1.0] where 0.0 is the minimum "feelable" amplitude. |
No default |
Device_GetProperties_Response
Defined in fuchsia.hardware.haptics/haptics.fidl
| Field | Type | Description | Default |
|---|---|---|---|
fundamental_resonant_frequency_hz |
float32
|
The fundamental resonant frequency (in hertz) of the haptics device. Also known as F0. |
No default |
quality_factor |
float32
|
The quality factor of the haptics device. Also known as the Q factor. |
No default |
supported_effects |
vector<SupportedEffect>
|
List of effects that the haptics device can play. |
No default |
supported_composite_effect_waveforms |
vector<SupportedCompositeEffectWaveform>
|
List of composite effect waveforms that the haptics device can play. |
No default |
max_composite_waveform_effect_count |
uint64
|
The max number of |
No default |
max_composite_effect_delay |
zx/Duration
|
Returns the max delay a |
No default |
Device_PlayCompositeWaveform_Response
Defined in fuchsia.hardware.haptics/haptics.fidl
<EMPTY>
Device_PlayEffect_Response
Defined in fuchsia.hardware.haptics/haptics.fidl
<EMPTY>
Device_PlayVibration_Response
Defined in fuchsia.hardware.haptics/haptics.fidl
<EMPTY>
Device_SetAmplitude_Response
Defined in fuchsia.hardware.haptics/haptics.fidl
<EMPTY>
Device_StartVibration_Response
Defined in fuchsia.hardware.haptics/haptics.fidl
<EMPTY>
Device_StopVibration_Response
Defined in fuchsia.hardware.haptics/haptics.fidl
<EMPTY>
SupportedCompositeEffectWaveform
Defined in fuchsia.hardware.haptics/haptics.fidl
Composite effect waveform that the haptics device can play.
| Field | Type | Description | Default |
|---|---|---|---|
waveform |
CompositeEffectWaveform
|
Composite effect waveform that the haptics device can play. |
No default |
duration |
zx/Duration
|
Duration of fuchsia.hardware.haptics/SupportedCompositeEffectWaveform.waveform when played by the haptics device. |
No default |
SupportedEffect
Defined in fuchsia.hardware.haptics/haptics.fidl
Effect that the haptics device can play.
| Field | Type | Description | Default |
|---|---|---|---|
effect |
Effect
|
Effect that the haptics device can play. |
No default |
duration |
zx/Duration
|
Duration of fuchsia.hardware.haptics/SupportedEffect.effect when played by the haptics device. |
No default |
ENUMS
CompositeEffectWaveform flexible
Type: uint32
Defined in fuchsia.hardware.haptics/haptics.fidl
| Name | Value | Description |
|---|---|---|
NOOP |
0 |
No vibration. |
CLICK |
1 |
A sharp, crisp click waveform. |
THUD |
2 |
A dull, heavy impact waveform. |
SPIN |
3 |
A spinning or rotating sensation. |
QUICK_RISE |
4 |
A waveform with a rapid onset. |
SLOW_RISE |
5 |
A waveform with a gradual onset. |
QUICK_FALL |
6 |
A waveform with a rapid decay. |
LIGHT_TICK |
7 |
A light, short tick waveform. |
LOW_TICK |
8 |
A low-frequency tick waveform. |
Effect flexible
Type: uint32
Defined in fuchsia.hardware.haptics/haptics.fidl
| Name | Value | Description |
|---|---|---|
CLICK |
0 |
A sharp, crisp click. |
DOUBLE_CLICK |
1 |
Two sharp, crisp clicks in quick succession. |
TICK |
2 |
A short, light tap. |
THUD |
3 |
A dull, heavy impact. |
POP |
4 |
A sudden, percussive sensation. |
HEAVY_CLICK |
5 |
A more intense version of CLICK. |
RINGTONE_1 |
6 |
The ringtone effects are vendor-specific variations. A method to query these may be added in the future if needed. |
RINGTONE_2 |
7 |
|
RINGTONE_3 |
8 |
|
RINGTONE_4 |
9 |
|
RINGTONE_5 |
10 |
|
RINGTONE_6 |
11 |
|
RINGTONE_7 |
12 |
|
RINGTONE_8 |
13 |
|
RINGTONE_9 |
14 |
|
RINGTONE_10 |
15 |
|
RINGTONE_11 |
16 |
|
RINGTONE_12 |
17 |
|
RINGTONE_13 |
18 |
|
RINGTONE_14 |
19 |
|
RINGTONE_15 |
20 |
|
TEXTURE_TICK |
21 |
A tick with a textured feel. |
EffectStrength flexible
Type: uint32
Defined in fuchsia.hardware.haptics/haptics.fidl
| Name | Value | Description |
|---|---|---|
LIGHT |
0 |
|
MEDIUM |
1 |
|
STRONG |
2 |
UNIONS
Device_GetProperties_Result strict
Defined in fuchsia.hardware.haptics/haptics.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Device_GetProperties_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
Device_PlayCompositeWaveform_Result strict
Defined in fuchsia.hardware.haptics/haptics.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Device_PlayCompositeWaveform_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
Device_PlayEffect_Result strict
Defined in fuchsia.hardware.haptics/haptics.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Device_PlayEffect_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
Device_PlayVibration_Result strict
Defined in fuchsia.hardware.haptics/haptics.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Device_PlayVibration_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
Device_SetAmplitude_Result strict
Defined in fuchsia.hardware.haptics/haptics.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Device_SetAmplitude_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
Device_StartVibration_Result strict
Defined in fuchsia.hardware.haptics/haptics.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Device_StartVibration_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
Device_StopVibration_Result strict
Defined in fuchsia.hardware.haptics/haptics.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Device_StopVibration_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
SERVICES
Service
Defined in fuchsia.hardware.haptics/haptics.fidl
| Name | Type | Transport |
|---|---|---|
| device |
fuchsia.hardware.haptics/Device
|
Channel |