|
MagAO-X
|
||||
|
A USB device as a TTY device. More...
#include <usbDevice.hpp>

Public Member Functions | |
| int | setupConfig (mx::appConfigurator &config) |
| Setup an application configurator for the USB section. More... | |
| int | loadConfig (mx::appConfigurator &config) |
| Load the USB section from an application configurator. More... | |
| int | getDeviceName () |
| Get the device name from udev using the vendor, product, and serial number. More... | |
| int | connect () |
| Connect to the device. More... | |
Public Attributes | |
| std::string | m_idVendor |
| The vendor id 4-digit code. More... | |
| std::string | m_idProduct |
| The product id 4-digit code. More... | |
| std::string | m_serial |
| The serial number. More... | |
| speed_t | m_speed {0} |
| The baud rate specification. More... | |
| std::string | m_deviceName |
| The device path name, e.g. /dev/ttyUSB0. More... | |
| int | m_fileDescrip {0} |
| The file descriptor. More... | |
A USB device as a TTY device.
Definition at line 25 of file usbDevice.hpp.
| int MagAOX::tty::usbDevice::connect | ( | ) |
Connect to the device.
Definition at line 135 of file usbDevice.hpp.
| int MagAOX::tty::usbDevice::getDeviceName | ( | ) |
Get the device name from udev using the vendor, product, and serial number.
Definition at line 130 of file usbDevice.hpp.
Referenced by loadConfig().
| int MagAOX::tty::usbDevice::loadConfig | ( | mx::appConfigurator & | config | ) |
Load the USB section from an application configurator.
If config does not contain a baud rate, m_speed is unchanged. If m_speed is 0 at the end of this method, an error is returned. Set m_speed prior to calling to avoid this error.
| [in] | config | an application configuration from which to load values |
Definition at line 64 of file usbDevice.hpp.
| int MagAOX::tty::usbDevice::setupConfig | ( | mx::appConfigurator & | config | ) |
Setup an application configurator for the USB section.
| [in] | config | an application configuration to setup |
Definition at line 54 of file usbDevice.hpp.
| std::string MagAOX::tty::usbDevice::m_deviceName |
The device path name, e.g. /dev/ttyUSB0.
Definition at line 33 of file usbDevice.hpp.
Referenced by connect(), and getDeviceName().
| int MagAOX::tty::usbDevice::m_fileDescrip {0} |
| std::string MagAOX::tty::usbDevice::m_idProduct |
The product id 4-digit code.
Definition at line 28 of file usbDevice.hpp.
Referenced by getDeviceName(), and loadConfig().
| std::string MagAOX::tty::usbDevice::m_idVendor |
The vendor id 4-digit code.
Definition at line 27 of file usbDevice.hpp.
Referenced by getDeviceName(), and loadConfig().
| std::string MagAOX::tty::usbDevice::m_serial |
The serial number.
Definition at line 29 of file usbDevice.hpp.
Referenced by getDeviceName(), and loadConfig().
| speed_t MagAOX::tty::usbDevice::m_speed {0} |
The baud rate specification.
Definition at line 31 of file usbDevice.hpp.
Referenced by connect(), and loadConfig().