From e4b663ebd5be78bd9fb9802e54b050a7b2a984bf Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 30 Jul 2014 16:34:02 -0500 Subject: in haptic.cpp, make sure to enable the sensor by calling ua_sensors_haptic_enable() --- src/haptic.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/haptic.cpp b/src/haptic.cpp index c5a20df..663e919 100644 --- a/src/haptic.cpp +++ b/src/haptic.cpp @@ -40,13 +40,21 @@ public: m_sensor(ua_sensors_haptic_new()) { if (m_sensor == nullptr) + { g_warning ("Haptic device unavailable"); + } else - m_tag = g_timeout_add_seconds (1, on_timeout, this); + { + ua_sensors_haptic_enable(m_sensor); + m_tag = g_timeout_add_seconds (2, on_timeout, this); + } } ~Impl() { + if (m_sensor != nullptr) + ua_sensors_haptic_enable(m_sensor); + if (m_tag) g_source_remove(m_tag); } @@ -61,8 +69,8 @@ private: void vibrate_now() { - const uint32_t msec = 1500; - ua_sensors_haptic_vibrate_once (m_sensor, msec); + const uint32_t msec = 1000; + (void) ua_sensors_haptic_vibrate_once (m_sensor, msec); } const Mode m_mode; -- cgit v1.2.3