/*
 * This file is part of roccat-tools.
 *
 * roccat-tools is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * roccat-tools is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with roccat-tools. If not, see <http://www.gnu.org/licenses/>.
 */

#include "roccat/ryos.h"

static gchar const * const driver_name = "ryos";

static guint const device_ids[4] = { USB_DEVICE_ID_ROCCAT_RYOS_MK,
	USB_DEVICE_ID_ROCCAT_RYOS_MK_GLOW,
	USB_DEVICE_ID_ROCCAT_RYOS_MK_PRO,
	0 };

RoccatDevice *ryos_device_first(void) {
	return roccat_device_first(driver_name, device_ids);
}

RoccatDeviceScanner *ryos_device_scanner_new(roccat_device_scanner_callback add_callback,
		roccat_device_scanner_callback remove_callback, gpointer user_data) {
	return roccat_device_scanner_new(driver_name, device_ids, add_callback, remove_callback, user_data);
}

gchar *ryos_device_name(RoccatDevice const *ryos) {
	gchar *result;

	switch(roccat_device_get_product_id(ryos)) {
	case USB_DEVICE_ID_ROCCAT_RYOS_MK:
		result = g_strdup("RyosMK");
		break;
	case USB_DEVICE_ID_ROCCAT_RYOS_MK_GLOW:
		result = g_strdup("RyosMK Glow");
		break;
	case USB_DEVICE_ID_ROCCAT_RYOS_MK_PRO:
		result = g_strdup("RyosMK Pro");
		break;
	default:
		result = g_strdup_printf("%04x:%04x", USB_VENDOR_ID_ROCCAT, roccat_device_get_product_id(ryos));
		break;
	}

	return result;
}
