/**
 * @file usb-enum.h
 *
 * @brief OASIS USB Attenuator driver library interface
 *
 * This file describes the external interface to the OASIS USB Attenuator
 * driver and provides the definitios for proper communication
 * with the device
 *
 * Copyright (c) 2021 CERN
 * @author David Cobas <dcobas AT cern.ch>
 *
 * @section license_sec License
 * Released under the GPL v2. (and only v2, not any later version)
 */

/**
 *  \brief oau_usb_dev - representation of an oattn device in all
 *  concevable forms
 */
struct oau_usb_dev {
	int	lun;		/**< logical unit number (not implemented) */
	char	busnum[6];	/**< USB bus number (decimal) */
	char	devnum[6];	/**< USB dev number (decimal) */
	char	portnum[6];	/**< USB port number (decimal) */
	char	busport[16];	/**< USB bus-port string (decimal bbb-ppp) */
	char	devno[10];	/**< Linux kernel devno (decimal major:minor) */
	char	serial[48];	/**< Serial number (e.g.  HCCAIAD000-CR000003) */
	char	path[256];	/**< Linux sysfs device path */
	int	unused[4];
};

/**
 *  \struct oau_devarray - array of oattn devices detected in the system
 */
struct oau_devarray {
	int			ndevs;	/**< number of devices (i.e.  array length) */
	struct oau_usb_dev	*devs;  /**< pointer to array of devices */
};

/** oau_display_devarray - auxiliary function to display the
 *   detected device array table
 */
void oau_display_devarray(struct oau_devarray *ls);

/** oau_get_devarray - populate library's static table of detected devices
 */
struct oau_devarray *oau_get_devarray(unsigned int vendor_id, unsigned int device_id);
