static void fprint_device_get_property(GObject *object, guint property_id,
				       GValue *value, GParamSpec *pspec)
{
	FprintDevice *self = (FprintDevice *) object;
	FprintDevicePrivate *priv = DEVICE_GET_PRIVATE(self);

	switch (property_id) {
	case FPRINT_DEVICE_IN_USE:
		g_value_set_boolean(value, g_hash_table_size (priv->clients) != 0);
		break;
	case FPRINT_DEVICE_NAME:
		g_value_set_static_string (value, fp_driver_get_full_name (fp_dscv_dev_get_driver (priv->ddev)));
		break;
	case FPRINT_DEVICE_NUM_ENROLL:
		if (priv->dev)
			g_value_set_int (value, fp_dev_get_nr_enroll_stages (priv->dev));
		else
			g_value_set_int (value, -1);
		break;
	case FPRINT_DEVICE_SCAN_TYPE: {
		const char *type;

		if (fp_driver_get_scan_type (fp_dscv_dev_get_driver (priv->ddev)) == FP_SCAN_TYPE_PRESS)
			type = "press";
		else
			type = "swipe";

		g_value_set_static_string (value, type);
		break;
	}
	default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
		break;
	}
}
Пример #2
0
struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
{
	struct fp_dscv_dev *ddev = discovered_devs[0];
	struct fp_driver *drv;
	if (!ddev)
		return NULL;
	
	drv = fp_dscv_dev_get_driver(ddev);
	printf("Found device claimed by %s driver\n", fp_driver_get_full_name(drv));
	return ddev;
}
Пример #3
0
static struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
{
	struct fp_dscv_dev *ddev = NULL;
	int i;

	for (i = 0; ddev = discovered_devs[i]; i++) {
		struct fp_driver *drv = fp_dscv_dev_get_driver(ddev);
		printf("Found device claimed by %s driver\n",
			fp_driver_get_full_name(drv));
		return ddev;
	}

	return ddev;
}
Пример #4
0
static gboolean mwin_populate_devs(void)
{
	struct fp_dscv_dev **discovered_devs;
	struct fp_dscv_dev *ddev;
	int i;

	discovered_devs = fp_discover_devs();
	if (!discovered_devs)
		return FALSE;

	for (i = 0; (ddev = discovered_devs[i]); i++) {
		struct fp_driver *drv = fp_dscv_dev_get_driver(ddev);
		GtkTreeIter iter;

		gtk_list_store_append(mwin_devmodel, &iter);
		gtk_list_store_set(mwin_devmodel, &iter, 0,
			fp_driver_get_full_name(drv), 1, ddev, -1);
	}

	return TRUE;
}
Пример #5
0
//driver bilgisi
void print_driver_info(struct fp_dscv_dev* ddev){ //assume valid input
    struct fp_driver* driver;
    driver = fp_dscv_dev_get_driver(ddev);
    //printf("Okuyucu bulundu!\n");
    printf("Driver id: %d\nDriver ismi: %s\n", fp_driver_get_driver_id(driver), fp_driver_get_full_name(driver));
}