Get number of haptic devices

Checks number of haptic devices (vibrators) available in device.
//    PRIVILEGE needed to be set in tizen-manifest.xml:
//    http://tizen.org/privilege/haptic

#include <dlog.h> // for logging purposes
#include <device/haptic.h>

static void
get_device_haptic_count() {
	int number;

	if(device_haptic_get_count(&number) == DEVICE_ERROR_NONE) {
		LOGI("Number of vibrators: %d", number);
	} else {
		LOGE("Error occured");
	}
}

Responses

0 Replies