If there is no vibrator device,
deviced does not provide dbus methods of vibrator.
In this case, haptic_get_count api will return zero.
Change-Id: I2bbd7125d707bb31c4782b107656fd180b362fe4
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
*
* @remarks You must close the Haptic API using device_haptic_close().
*
- * @param[in] device_index The index of device what you want to vibrate
+ * @param[in] device_index The index of device what you want to vibrate \n
+ * The index starts from @c 0.
* @param[out] device_handle The handle of vibrator
*
* @return @c 0 on success,
ret = dbus_method_sync(DEVICED_BUS_NAME,
DEVICED_PATH_HAPTIC, DEVICED_INTERFACE_HAPTIC,
METHOD_GET_COUNT, NULL, NULL);
- if (ret < 0)
+ /**
+ * there is no haptic method in no vibration model.
+ * so -ENOTSUP means that haptic count is zero.
+ */
+ if (ret == -ENOTSUP)
+ ret = 0;
+ else if (ret < 0)
return errno_to_device_error(ret);
*device_number = ret;