Changeset 15 in flair-src for trunk/lib/FlairCore/src/Unix_SerialPort.h


Ignore:
Timestamp:
04/08/16 15:40:57 (8 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/Unix_SerialPort.h

    r2 r15  
    1717#include <termios.h> /* POSIX terminal control definitions */
    1818
    19 namespace flair
    20 {
    21 namespace core
    22 {
    23     /*! \class RTDM_I2cPort
    24     *
    25     * \brief Class for unix serial port
    26     *
    27     */
    28     class Unix_SerialPort: public SerialPort
    29     {
     19namespace flair {
     20namespace core {
     21/*! \class RTDM_I2cPort
     22*
     23* \brief Class for unix serial port
     24*
     25*/
     26class Unix_SerialPort : public SerialPort {
    3027
    31         public:
    32             /*!
    33             * \brief Constructor
    34             *
    35             * Construct an unix serial port, with the following default values: \n
    36             * - 115200bps baudrate
    37             *
    38             * \param parent parent
    39             * \param name name
    40             * \param device serial device (ex rtser1)
    41             */
    42             Unix_SerialPort(const Object* parent,std::string port_name,std::string device);
     28public:
     29  /*!
     30  * \brief Constructor
     31  *
     32  * Construct an unix serial port, with the following default values: \n
     33  * - 115200bps baudrate
     34  *
     35  * \param parent parent
     36  * \param name name
     37  * \param device serial device (ex rtser1)
     38  */
     39  Unix_SerialPort(const Object *parent, std::string port_name,
     40                  std::string device);
    4341
    44             /*!
    45             * \brief Destructor
    46             *
    47             */
    48             ~Unix_SerialPort();
     42  /*!
     43  * \brief Destructor
     44  *
     45  */
     46  ~Unix_SerialPort();
    4947
    50             /*!
    51             * \brief Set baudrate
    52             *
    53             * \param baudrate baudrate
    54             *
    55             */
    56             void SetBaudrate(int baudrate);
     48  /*!
     49  * \brief Set baudrate
     50  *
     51  * \param baudrate baudrate
     52  *
     53  */
     54  void SetBaudrate(int baudrate);
    5755
    58             /*!
    59             * \brief Set RX timeout
    60             *
    61             * Timeout for waiting datas.
    62             *
    63             * \param timeout_ns timeout in nano second
    64             */
    65             void SetRxTimeout(Time timeout_ns);
     56  /*!
     57  * \brief Set RX timeout
     58  *
     59  * Timeout for waiting datas.
     60  *
     61  * \param timeout_ns timeout in nano second
     62  */
     63  void SetRxTimeout(Time timeout_ns);
    6664
    67             /*!
    68             * \brief Write datas
    69             *
    70             * \param buf pointer to datas
    71             * \param nbyte length of datas
    72             *
    73             * \return amount of written datas
    74             */
    75             ssize_t Write(const void *buf,size_t nbyte);
     65  /*!
     66  * \brief Write datas
     67  *
     68  * \param buf pointer to datas
     69  * \param nbyte length of datas
     70  *
     71  * \return amount of written datas
     72  */
     73  ssize_t Write(const void *buf, size_t nbyte);
    7674
    77             /*!
    78             * \brief Read datas
    79             *
    80             * \param buf pointer to datas
    81             * \param nbyte length of datas
    82             *
    83             * \return amount of read datas
    84             */
    85             ssize_t Read(void *buf,size_t nbyte);
     75  /*!
     76  * \brief Read datas
     77  *
     78  * \param buf pointer to datas
     79  * \param nbyte length of datas
     80  *
     81  * \return amount of read datas
     82  */
     83  ssize_t Read(void *buf, size_t nbyte);
    8684
    87             /*!
    88             * \brief Flush input datas
    89             *
    90             */
    91             void FlushInput(void);
     85  /*!
     86  * \brief Flush input datas
     87  *
     88  */
     89  void FlushInput(void);
    9290
    93         private:
    94             int fd;
    95             struct termios options;
    96     };
     91private:
     92  int fd;
     93  struct termios options;
     94};
    9795} // end namespace core
    9896} // end namespace flair
Note: See TracChangeset for help on using the changeset viewer.