A USB device as a TTY device. More...
#include <usbDevice.hpp>
Public Member Functions | |
int | setupConfig (mx::app::appConfigurator &config) |
Setup an application configurator for the USB section. More... | |
int | loadConfig (mx::app::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_baudRate {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 32 of file usbDevice.hpp.
int MagAOX::tty::usbDevice::connect | ( | ) |
Connect to the device.
Closes the device file descriptor if open, then calls ttyOpenRaw.
Definition at line 108 of file usbDevice.cpp.
Referenced by MagAOX::app::filterWheelCtrl::appLogic(), MagAOX::app::flipperCtrl::appLogic(), MagAOX::app::koolanceCtrl::appLogic(), MagAOX::app::pi335Ctrl::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), and MagAOX::app::rhusbMon::connect().
int MagAOX::tty::usbDevice::getDeviceName | ( | ) |
Get the device name from udev using the vendor, product, and serial number.
Definition at line 103 of file usbDevice.cpp.
Referenced by MagAOX::app::filterWheelCtrl::appLogic(), MagAOX::app::flipperCtrl::appLogic(), MagAOX::app::koolanceCtrl::appLogic(), MagAOX::app::pi335Ctrl::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::zaberLowLevel::appLogic(), and MagAOX::app::rhusbMon::connect().
int MagAOX::tty::usbDevice::loadConfig | ( | mx::app::appConfigurator & | config | ) |
Load the USB section from an application configurator.
If config does not contain a baud rate, m_baudRate is unchanged. If m_baudRate is 0 at the end of this method, an error is returned. Set m_baudRate prior to calling to avoid this error.
[in] | config | an application configuration from which to load values |
Definition at line 34 of file usbDevice.cpp.
Referenced by MagAOX::app::filterWheelCtrl::loadConfig(), MagAOX::app::smc100ccCtrl::loadConfig(), MagAOX::app::zaberLowLevel::loadConfig(), MagAOX::app::flipperCtrl::loadConfigImpl(), MagAOX::app::koolanceCtrl::loadConfigImpl(), MagAOX::app::pi335Ctrl::loadConfigImpl(), and MagAOX::app::rhusbMon::loadConfigImpl().
int MagAOX::tty::usbDevice::setupConfig | ( | mx::app::appConfigurator & | config | ) |
Setup an application configurator for the USB section.
[in] | config | an application configuration to setup |
Definition at line 24 of file usbDevice.cpp.
Referenced by MagAOX::app::filterWheelCtrl::setupConfig(), MagAOX::app::flipperCtrl::setupConfig(), MagAOX::app::koolanceCtrl::setupConfig(), MagAOX::app::pi335Ctrl::setupConfig(), MagAOX::app::rhusbMon::setupConfig(), MagAOX::app::smc100ccCtrl::setupConfig(), and MagAOX::app::zaberLowLevel::setupConfig().
speed_t MagAOX::tty::usbDevice::m_baudRate {0} |
The baud rate specification.
Definition at line 38 of file usbDevice.hpp.
Referenced by MagAOX::app::filterWheelCtrl::loadConfig(), MagAOX::app::smc100ccCtrl::loadConfig(), MagAOX::app::zaberLowLevel::loadConfig(), MagAOX::app::flipperCtrl::loadConfigImpl(), MagAOX::app::koolanceCtrl::loadConfigImpl(), and MagAOX::app::pi335Ctrl::loadConfigImpl().
std::string MagAOX::tty::usbDevice::m_deviceName |
The device path name, e.g. /dev/ttyUSB0.
Definition at line 40 of file usbDevice.hpp.
Referenced by MagAOX::app::filterWheelCtrl::appLogic(), MagAOX::app::flipperCtrl::appLogic(), MagAOX::app::koolanceCtrl::appLogic(), MagAOX::app::pi335Ctrl::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::zaberLowLevel::appLogic(), MagAOX::app::pi335Ctrl::appStartup(), MagAOX::app::rhusbMon::connect(), MagAOX::app::zaberLowLevel::connect(), and MagAOX::app::pi335Ctrl::testConnection().
int MagAOX::tty::usbDevice::m_fileDescrip {0} |
The file descriptor.
Definition at line 42 of file usbDevice.hpp.
Referenced by MagAOX::app::filterWheelCtrl::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::pi335Ctrl::finishInit(), MagAOX::app::pi335Ctrl::getCom(), MagAOX::app::smc100ccCtrl::getCtrlState(), MagAOX::app::smc100ccCtrl::getLastError(), MagAOX::app::filterWheelCtrl::getMoving(), MagAOX::app::filterWheelCtrl::getPos(), MagAOX::app::flipperCtrl::getPos(), MagAOX::app::smc100ccCtrl::getPosition(), MagAOX::app::koolanceCtrl::getStatus(), MagAOX::app::filterWheelCtrl::getSwitch(), MagAOX::app::filterWheelCtrl::home(), MagAOX::app::pi335Ctrl::home_1(), MagAOX::app::pi335Ctrl::home_2(), MagAOX::app::pi335Ctrl::home_3(), MagAOX::app::pi335Ctrl::initDM(), MagAOX::app::koolanceCtrl::initialConnect(), MagAOX::app::pi335Ctrl::move_1(), MagAOX::app::pi335Ctrl::move_2(), MagAOX::app::pi335Ctrl::move_3(), MagAOX::app::smc100ccCtrl::moveTo(), MagAOX::app::flipperCtrl::moveTo(), MagAOX::app::filterWheelCtrl::moveToRaw(), MagAOX::app::filterWheelCtrl::moveToRawRelative(), MagAOX::app::filterWheelCtrl::onPowerOnConnect(), MagAOX::app::rhusbMon::readProbe(), MagAOX::app::pi335Ctrl::releaseDM(), MagAOX::app::koolanceCtrl::setFanLvl(), MagAOX::app::koolanceCtrl::setPumpLvl(), MagAOX::app::smc100ccCtrl::startHoming(), MagAOX::app::filterWheelCtrl::stop(), MagAOX::app::smc100ccCtrl::stop(), MagAOX::app::pi335Ctrl::testConnection(), and MagAOX::app::smc100ccCtrl::testConnection().
std::string MagAOX::tty::usbDevice::m_idProduct |
The product id 4-digit code.
Definition at line 35 of file usbDevice.hpp.
Referenced by MagAOX::app::filterWheelCtrl::appLogic(), MagAOX::app::flipperCtrl::appLogic(), MagAOX::app::koolanceCtrl::appLogic(), MagAOX::app::pi335Ctrl::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::zaberLowLevel::appLogic(), MagAOX::app::pi335Ctrl::appStartup(), MagAOX::app::usbtempMon::checkConnections(), MagAOX::app::rhusbMon::connect(), and MagAOX::app::usbtempMon::loadConfigImpl().
std::string MagAOX::tty::usbDevice::m_idVendor |
The vendor id 4-digit code.
Definition at line 34 of file usbDevice.hpp.
Referenced by MagAOX::app::filterWheelCtrl::appLogic(), MagAOX::app::flipperCtrl::appLogic(), MagAOX::app::koolanceCtrl::appLogic(), MagAOX::app::pi335Ctrl::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::zaberLowLevel::appLogic(), MagAOX::app::pi335Ctrl::appStartup(), MagAOX::app::usbtempMon::checkConnections(), MagAOX::app::rhusbMon::connect(), and MagAOX::app::usbtempMon::loadConfigImpl().
std::string MagAOX::tty::usbDevice::m_serial |
The serial number.
Definition at line 36 of file usbDevice.hpp.
Referenced by MagAOX::app::filterWheelCtrl::appLogic(), MagAOX::app::flipperCtrl::appLogic(), MagAOX::app::koolanceCtrl::appLogic(), MagAOX::app::pi335Ctrl::appLogic(), MagAOX::app::smc100ccCtrl::appLogic(), MagAOX::app::zaberLowLevel::appLogic(), MagAOX::app::pi335Ctrl::appStartup(), MagAOX::app::usbtempMon::checkConnections(), and MagAOX::app::rhusbMon::connect().