|
PebbleOS
|
Vibration motor sequencing and strength control. More...
Enumerations | |
| enum | VibePatternOwner { VibePatternOwner_Other = 0 , VibePatternOwner_App , VibePatternOwner_Notification , VibePatternOwner_PhoneCall , VibePatternOwner_Alarm } |
| Source that started a vibe pattern. More... | |
Functions | |
| void | vibes_init () |
| Initialize the service. | |
| int32_t | vibes_get_vibe_strength (void) |
| Get the strength the motor is currently driven at. | |
| uint32_t | vibes_get_time_since_last_vibe_ms (void) |
| Get the time since the motor was last active. | |
| int32_t | vibes_get_default_vibe_strength (void) |
| Get the default strength, used by on/off pattern steps. | |
| void | vibes_set_default_vibe_strength (int32_t vibe_strength_default) |
| Set the default strength, from the vibration strength setting. | |
| void | vibe_service_set_enabled (bool enable) |
| Runlevel hook. | |
| void | vibe_pattern_set_owner (VibePatternOwner owner) |
| Set the owner of the next pattern. | |
| void | vibe_pattern_clear_for_owner (VibePatternOwner owner) |
Stop the current pattern if owned by owner. | |
Vibration motor sequencing and strength control.
Plays queued patterns of (duration, strength) steps on the vibration motor. Strengths range from -100 to 100, 0 being off. Each pattern has an owner, so cancellation can be scoped: a notification dismiss must not stop an alarm vibe.
Kernel code tags the next pattern before starting it, and later clears only its own:
| enum VibePatternOwner |
Source that started a vibe pattern.
| void vibe_pattern_clear_for_owner | ( | VibePatternOwner | owner | ) |
Stop the current pattern if owned by owner.
Does nothing otherwise.
| owner | Owner whose pattern to stop. |
| void vibe_pattern_set_owner | ( | VibePatternOwner | owner | ) |
Set the owner of the next pattern.
Consumed when the first step of the next pattern is queued. Without it, patterns from the app task are owned by VibePatternOwner_App and others by VibePatternOwner_Other.
| owner | Owner of the next pattern. |
| void vibe_service_set_enabled | ( | bool | enable | ) |
Runlevel hook.
Turns the motor off before disabling. Patterns do not drive the motor while disabled.
| enable | True to enable vibrations. |
| int32_t vibes_get_default_vibe_strength | ( | void | ) |
Get the default strength, used by on/off pattern steps.
| uint32_t vibes_get_time_since_last_vibe_ms | ( | void | ) |
Get the time since the motor was last active.
Measured from when it was last turned on, or last turned off. Used to suppress false shake and tap detections caused by vibration.
UINT32_MAX if the motor has not run since boot. | int32_t vibes_get_vibe_strength | ( | void | ) |
Get the strength the motor is currently driven at.
| void vibes_init | ( | ) |
Initialize the service.
| void vibes_set_default_vibe_strength | ( | int32_t | vibe_strength_default | ) |
Set the default strength, from the vibration strength setting.
| vibe_strength_default | Strength, -100 to 100. |