fuchsia.hardware.haptics

Added: HEAD

PROTOCOLS

Device

Defined in fuchsia.hardware.haptics/haptics.fidl

GetProperties

Returns the haptics-related properties of the haptics device.

Request

<EMPTY>

Response

NameType
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

NameType
composite_waveform vector<CompositeEffect>

Response

NameType
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

NameType
effect Effect
strength EffectStrength

Response

NameType
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

NameType
duration zx/Duration

Response

NameType
payload Device_PlayVibration_Result

SetAmplitude

Alters the gain on vibrations played in the future.

Request

NameType
amplitude float32

Response

NameType
payload Device_SetAmplitude_Result

StartVibration

Deprecated. Do not use. TODO(b/419629139): Remove once no longer used.

Request

<EMPTY>

Response

NameType
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

NameType
payload Device_StopVibration_Result

STRUCTS

CompositeEffect

Defined in fuchsia.hardware.haptics/haptics.fidl

FieldTypeDescriptionDefault
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

FieldTypeDescriptionDefault
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 CompositeEffect's that a composite waveform can be composed of.

No default
max_composite_effect_delay zx/Duration

Returns the max delay a CompositeEffect can have in a composite waveform.

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.

FieldTypeDescriptionDefault
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.

FieldTypeDescriptionDefault
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

NameValueDescription
0

No vibration.

1

A sharp, crisp click waveform.

2

A dull, heavy impact waveform.

3

A spinning or rotating sensation.

4

A waveform with a rapid onset.

5

A waveform with a gradual onset.

6

A waveform with a rapid decay.

7

A light, short tick waveform.

8

A low-frequency tick waveform.

Effect flexible

Type: uint32

Defined in fuchsia.hardware.haptics/haptics.fidl

NameValueDescription
0

A sharp, crisp click.

1

Two sharp, crisp clicks in quick succession.

2

A short, light tap.

3

A dull, heavy impact.

4

A sudden, percussive sensation.

5

A more intense version of CLICK.

6

The ringtone effects are vendor-specific variations. A method to query these may be added in the future if needed.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

A tick with a textured feel.

EffectStrength flexible

Type: uint32

Defined in fuchsia.hardware.haptics/haptics.fidl

NameValueDescription
0
1
2

UNIONS

Device_GetProperties_Result strict

Defined in fuchsia.hardware.haptics/haptics.fidl

OrdinalVariantTypeDescription
response Device_GetProperties_Response
err zx/Status
framework_err internal

Device_PlayCompositeWaveform_Result strict

Defined in fuchsia.hardware.haptics/haptics.fidl

OrdinalVariantTypeDescription
response Device_PlayCompositeWaveform_Response
err zx/Status
framework_err internal

Device_PlayEffect_Result strict

Defined in fuchsia.hardware.haptics/haptics.fidl

OrdinalVariantTypeDescription
response Device_PlayEffect_Response
err zx/Status
framework_err internal

Device_PlayVibration_Result strict

Defined in fuchsia.hardware.haptics/haptics.fidl

OrdinalVariantTypeDescription
response Device_PlayVibration_Response
err zx/Status
framework_err internal

Device_SetAmplitude_Result strict

Defined in fuchsia.hardware.haptics/haptics.fidl

OrdinalVariantTypeDescription
response Device_SetAmplitude_Response
err zx/Status
framework_err internal

Device_StartVibration_Result strict

Defined in fuchsia.hardware.haptics/haptics.fidl

OrdinalVariantTypeDescription
response Device_StartVibration_Response
err zx/Status
framework_err internal

Device_StopVibration_Result strict

Defined in fuchsia.hardware.haptics/haptics.fidl

OrdinalVariantTypeDescription
response Device_StopVibration_Response
err zx/Status
framework_err internal

SERVICES

Service

Defined in fuchsia.hardware.haptics/haptics.fidl

NameTypeTransport
device fuchsia.hardware.haptics/Device Channel