API
ttyUSB.hpp
Go to the documentation of this file.
1 /** \file ttyUSB.hpp
2  * \author Jared R. Males
3  * \brief Find the details for USB serial devices
4  *
5  * \ingroup tty_files
6  *
7  */
8 
9 #ifndef tty_ttyUSB_hpp
10 #define tty_ttyUSB_hpp
11 
12 #include <string>
13 
14 
15 
16 namespace MagAOX
17 {
18 namespace tty
19 {
20 
21 ///Get the ttyUSB device name for a specific device
22 /**
23  * \returns TTY_E_NOERROR on success
24  * \returns TTY_E_NODEVNAMES if no device names found in sys
25  * \returns TTY_E_UDEVNEWFAILED if initializing libudev failed.
26  * \returns TTY_E_DEVNOTFOUND if no matching device found.
27  *
28  * \ingroup tty
29  */
30 int ttyUSBDevName( std::string & devName, ///< [out] the /dev/ttyUSBX device name.
31  const std::string & vendor, ///< [in] the 4-digit vendor identifier.
32  const std::string & product, ///< [in] the 4-digit product identifier.
33  const std::string & serial ///< [in] the serial number. Can be "".
34  );
35 
36 ///Get the ttyUSB device name for a set of devices specified by their vendor and product ids.
37 /**
38  * \returns TTY_E_NOERROR on success
39  * \returns TTY_E_NODEVNAMES if no device names found in sys
40  * \returns TTY_E_UDEVNEWFAILED if initializing libudev failed.
41  * \returns TTY_E_DEVNOTFOUND if no matching device found.
42  *
43  * \ingroup tty
44  */
45 int ttyUSBDevNames( std::vector<std::string> & devNames, ///< [out] the /dev/ttyUSBX device names for all matching devices.
46  const std::string & vendor, ///< [in] the 4-digit vendor identifier.
47  const std::string & product ///< [in] the 4-digit product identifier.
48  );
49 
50 } //namespace tty
51 } //namespace MagAOX
52 
53 #endif //tty_ttyUSB_hpp
int ttyUSBDevName(std::string &devName, const std::string &vendor, const std::string &product, const std::string &serial)
Get the ttyUSB device name for a specific device.
Definition: ttyUSB.cpp:30
int ttyUSBDevNames(std::vector< std::string > &devNames, const std::string &vendor, const std::string &product)
Get the ttyUSB device name for a set of devices specified by their vendor and product ids.
Definition: ttyUSB.cpp:137
Definition: dm.hpp:24