40: Haptics Control
Control the haptics The first haptics action after power-on will also result in the haptics driver being initialized, leading to a calibration. If Header Duration is provided, haptics are run in DRV2605 RTP (Real Time Playback) continuous mode and automatically stopped after the specified timeout. Parameter combinations are strict: - Pattern + Intensity (optional Duration) is valid. - Driver Pattern by itself is valid. (duration is defined by the pattern and cannot be overridden) - Driver Pattern cannot be combined with Pattern, Intensity, or Duration.
Header
| Field | Name | Description | Type |
|---|---|---|---|
| 5 | Method | Request a service to be perform an action Possible values:
| uint8 |
| 7 | Duration | To be used with the SUBSCRIBE method, or actions that can be timed. When used with a timed action: This defines how long the action should go on for. When used with the SUBSCRIBE method: This defines a duration to keep the subscription active for. A value of 0 means the subscription is indefinite until explicitly unsubscribed. A message with an EXPIRED status code will be sent if the subscription duration elapses without being renewed with a new subscription request. | uint32 |
Payload
| Field | Name | Description | Type | Unit |
|---|---|---|---|---|
| 1 | Pattern | Pattern of haptics [1-3] Possible values:
| uint8 | |
| 2 | Intensity | Intensity of haptics [0-2] Possible values:
| uint8 | |
| 3 | Driver Pattern | Direct DRV2605 ROM effect index [1-123]. Must be sent on its own (without Pattern, Intensity, or Header Duration). Possible values:
| uint8 |
Examples
Medium intensity fade
Protocol
03
3
Length
2300
23 bytes
Type
4000
40 (Haptics Control)
Header Count
0100
1
Header Types
01
1
Message ID
0457000000
57
Payload Count
0200
2
Payload Types
0102
1, 2
Pattern
0101
1 (Fade)
Intensity
0101
1 (Medium)
Checksum
21242
61973
📡 Real example from RH2 ESP32 Toit on 2025-10-14This example is captured from an RH2 device as part of normal communications over I2C with the ESP32 co-processor, where Toit on the ESP32 made the request.
Medium intensity pulse
Protocol
03
3
Length
2300
23 bytes
Type
4000
40 (Haptics Control)
Header Count
0100
1
Header Types
01
1
Message ID
0461000000
61
Payload Count
0200
2
Payload Types
0102
1, 2
Pattern
0102
2 (Pulse)
Intensity
0101
1 (Medium)
Checksum
145166
42641
📡 Real example from RH2 ESP32 Toit on 2025-10-14This example is captured from an RH2 device as part of normal communications over I2C with the ESP32 co-processor, where Toit on the ESP32 made the request.
Mediaum intensity drop
Protocol
03
3
Length
2300
23 bytes
Type
4000
40 (Haptics Control)
Header Count
0100
1
Header Types
01
1
Message ID
0465000000
65
Payload Count
0200
2
Payload Types
0102
1, 2
Pattern
0103
3 (Drop)
Intensity
0101
1 (Medium)
Checksum
10903
877
📡 Real example from RH2 ESP32 Toit on 2025-10-14This example is captured from an RH2 device as part of normal communications over I2C with the ESP32 co-processor, where Toit on the ESP32 made the request.
Code
For convenience, the following constants can be used to reference this message type.