Changeset 13 in flair-dev for trunk/include/FlairCore/Unix_I2cPort.h


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

formatting script + include reformatted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/FlairCore/Unix_I2cPort.h

    r2 r13  
    1616#include <I2cPort.h>
    1717
    18 namespace flair
    19 {
    20 namespace core
    21 {
    22     /*! \class Unix_I2cPort
    23     *
    24     * \brief Class for unix serial port
    25     *
    26     */
    27     class Unix_I2cPort: public I2cPort
    28     {
     18namespace flair {
     19namespace core {
     20/*! \class Unix_I2cPort
     21*
     22* \brief Class for unix serial port
     23*
     24*/
     25class Unix_I2cPort : public I2cPort {
    2926
    30         public:
    31             /*!
    32             * \brief Constructor
    33             *
    34             * Construct an unix i2c port
    35             *
    36             * \param parent parent
    37             * \param name name
    38             * \param device serial device (ex /dev/i2c-1)
    39             */
    40             Unix_I2cPort(const Object* parent,std::string port_name,std::string device);
     27public:
     28  /*!
     29  * \brief Constructor
     30  *
     31  * Construct an unix i2c port
     32  *
     33  * \param parent parent
     34  * \param name name
     35  * \param device serial device (ex /dev/i2c-1)
     36  */
     37  Unix_I2cPort(const Object *parent, std::string port_name, std::string device);
    4138
    42             /*!
    43             * \brief Destructor
    44             *
    45             */
    46             ~Unix_I2cPort();
     39  /*!
     40  * \brief Destructor
     41  *
     42  */
     43  ~Unix_I2cPort();
    4744
    48             /*!
    49             * \brief Set slave's address
    50             *
    51             * This method need to be called before any communication.
    52             *
    53             * \param address slave's address
    54             */
    55             int SetSlave(uint16_t address);
     45  /*!
     46  * \brief Set slave's address
     47  *
     48  * This method need to be called before any communication.
     49  *
     50  * \param address slave's address
     51  */
     52  int SetSlave(uint16_t address);
    5653
    57             /*!
    58             * \brief Set RX timeout
    59             *
    60             * Timeout for waiting datas.
    61             *
    62             * \param timeout_ns timeout in nano second
    63             */
    64             void SetRxTimeout(Time timeout_ns);
     54  /*!
     55  * \brief Set RX timeout
     56  *
     57  * Timeout for waiting datas.
     58  *
     59  * \param timeout_ns timeout in nano second
     60  */
     61  void SetRxTimeout(Time timeout_ns);
    6562
    66             /*!
    67             * \brief Set TX timeout
    68             *
    69             * Timeout for waiting an ACK from the slave.
    70             *
    71             * \param timeout_ns timeout in nano second
    72             */
    73             void SetTxTimeout(Time timeout_ns);
     63  /*!
     64  * \brief Set TX timeout
     65  *
     66  * Timeout for waiting an ACK from the slave.
     67  *
     68  * \param timeout_ns timeout in nano second
     69  */
     70  void SetTxTimeout(Time timeout_ns);
    7471
    75             /*!
    76             * \brief Write datas
    77             *
    78             * \param buf pointer to datas
    79             * \param nbyte length of datas
    80             *
    81             * \return amount of written datas
    82             */
    83             ssize_t Write(const void *buf,size_t nbyte);
     72  /*!
     73  * \brief Write datas
     74  *
     75  * \param buf pointer to datas
     76  * \param nbyte length of datas
     77  *
     78  * \return amount of written datas
     79  */
     80  ssize_t Write(const void *buf, size_t nbyte);
    8481
    85             /*!
    86             * \brief Read datas
    87             *
    88             * \param buf pointer to datas
    89             * \param nbyte length of datas
    90             *
    91             * \return amount of read datas
    92             */
    93             ssize_t Read(void *buf,size_t nbyte);
     82  /*!
     83  * \brief Read datas
     84  *
     85  * \param buf pointer to datas
     86  * \param nbyte length of datas
     87  *
     88  * \return amount of read datas
     89  */
     90  ssize_t Read(void *buf, size_t nbyte);
    9491
    95         private:
    96             int fd;
    97     };
     92private:
     93  int fd;
     94};
    9895} // end namespace core
    9996} // end namespace flair
Note: See TracChangeset for help on using the changeset viewer.