BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
9418df2
Branches
Tags
master
Blinker
src
linux
Device.h
added buffer to serial device output dropping frames on serial output if buffer gets too full (more than 10 frames) added support for high baudrates
Stefan Schuermans
commited
9418df2
at 2011-12-27 08:02:03
Device.h
Blame
History
Raw
/* Blinker Copyright 2011 Stefan Schuermans <stefan@blinkenarea.org> Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html a blinkenarea.org project */ #ifndef BLINKER_DEVICE_H #define BLINKER_DEVICE_H #include <string> #include "Io.h" #include "SerCfg.h" namespace Blinker { /// a character device class Device: public Io { public: /** * @brief constructor * @param[in] path path to device */ Device(const std::string &path); /// destructor ~Device(); private: /// copy constructor disabled Device(const Device &that); /// assignment operator disabled const Device & operator=(const Device &that); public: /** * @brief set serial port configuration * @param[in] serCfg serial port configuration * @return if configuration succeeded * * This function should only be used if device is a serial port. */ bool setSerCfg(const SerCfg& serCfg); /** * @brief write data to device * @param[in] data data to write * @param[out] len number of byte written to device * @return if some (or zero) data could be written, * i.e. if the device is still operational */ bool write(const std::string &data, std::string::size_type &len); }; // class Device } // namespace Blinker #endif // #ifndef BLINKER_DEVICE_H