<br />

Added: HEAD

## **PROTOCOLS**

## Device

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=121)*

### GetProperties

Returns the haptics-related properties of the haptics device.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#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<https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#CompositeEffect>` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#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` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#Effect` |
| `strength` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#EffectStrength` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#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` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Duration` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#Device_PlayVibration_Result` |

### SetAmplitude

Alters the gain on vibrations played in the future.

#### Request

| Name | Type |
|---|---|
| `amplitude` | `float32` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#Device_SetAmplitude_Result` |

### StartVibration

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

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#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` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#Device_StopVibration_Result` |

## **STRUCTS**

### CompositeEffect

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=95)*

| Field | Type | Description | Default |
|---|---|---|---|
| `delay` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Duration` | Delay before [fuchsia.hardware.haptics](https://fuchsia.dev/reference/fuchsia.hardware.haptics/)/[SupportedEffect.waveform](https://fuchsia.dev/reference/fuchsia.hardware.haptics/#SupportedEffect.waveform) is played. | No default |
| `waveform` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#CompositeEffectWaveform` | Waveform to be played. | No default |
| `scale` | `float32` | Adjusts the gain applied to [fuchsia.hardware.haptics](https://fuchsia.dev/reference/fuchsia.hardware.haptics/)/[SupportedEffect.waveform](https://fuchsia.dev/reference/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](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=172)*

| 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<https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#SupportedEffect>` | List of effects that the haptics device can play. | No default |
| `supported_composite_effect_waveforms` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#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` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/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](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=154)*

\<EMPTY\>

### Device_PlayEffect_Response

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=145)*

\<EMPTY\>

### Device_PlayVibration_Response

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=133)*

\<EMPTY\>

### Device_SetAmplitude_Response

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=169)*

\<EMPTY\>

### Device_StartVibration_Response

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=124)*

\<EMPTY\>

### Device_StopVibration_Response

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=161)*

\<EMPTY\>

### SupportedCompositeEffectWaveform

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=110)*

Composite effect waveform that the haptics device can play.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `waveform` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#CompositeEffectWaveform` | Composite effect waveform that the haptics device can play. | No default |
| `duration` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Duration` | Duration of [fuchsia.hardware.haptics](https://fuchsia.dev/reference/fuchsia.hardware.haptics/)/[SupportedCompositeEffectWaveform.waveform](https://fuchsia.dev/reference/fuchsia.hardware.haptics/#SupportedCompositeEffectWaveform.waveform) when played by the haptics device. | No default |

### SupportedEffect

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=57)*

Effect that the haptics device can play.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `effect` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#Effect` | Effect that the haptics device can play. | No default |
| `duration` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Duration` | Duration of [fuchsia.hardware.haptics](https://fuchsia.dev/reference/fuchsia.hardware.haptics/)/[SupportedEffect.effect](https://fuchsia.dev/reference/fuchsia.hardware.haptics/#SupportedEffect.effect) when played by the haptics device. | No default |

## **ENUMS**

### CompositeEffectWaveform [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=66)*

| 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](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=9)*

| 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](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=50)*

| Name | Value | Description |
|---|---|---|
| ### LIGHT | `0` |   |
| ### MEDIUM | `1` |   |
| ### STRONG | `2` |   |

## **UNIONS**

### Device_GetProperties_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=172)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#Device_GetProperties_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Device_PlayCompositeWaveform_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=154)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#Device_PlayCompositeWaveform_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Device_PlayEffect_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=145)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#Device_PlayEffect_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Device_PlayVibration_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=133)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#Device_PlayVibration_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Device_SetAmplitude_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=169)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#Device_SetAmplitude_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Device_StartVibration_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=124)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#Device_StartVibration_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Device_StopVibration_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=161)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.haptics#Device_StopVibration_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

## **SERVICES**

### Service

*Defined in [fuchsia.hardware.haptics/haptics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=198)*

| Name | Type | Transport |
|---|---|---|
| [device](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.haptics/haptics.fidl;l=199) | `fuchsia.hardware.haptics/Device` | Channel |

<br />