diff options
Diffstat (limited to 'mpm/include')
-rw-r--r-- | mpm/include/mpm/i2c/i2c_iface.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mpm/include/mpm/i2c/i2c_iface.hpp b/mpm/include/mpm/i2c/i2c_iface.hpp index aca5994b1..e3fe9e8ed 100644 --- a/mpm/include/mpm/i2c/i2c_iface.hpp +++ b/mpm/include/mpm/i2c/i2c_iface.hpp @@ -38,19 +38,23 @@ namespace mpm { namespace i2c { * \param tx_len Size (in bytes) of TX buffer * \param rx Buffer to hold read data * \param rx_len Number of bytes to read + * \param do_close If true, close file descriptor at end of function */ - virtual int transfer(uint8_t *tx, size_t tx_len, uint8_t *rx, size_t rx_len) = 0; + virtual int transfer(uint8_t *tx, size_t tx_len, uint8_t *rx, + size_t rx_len, bool do_close = true) = 0; /*! * \param tx Buffer of data to send * \param rx Buffer to hold read data + * \param do_close If true, close file descriptor at end of function * * All data in tx will be transmitted. * The amount of data read will be determined by the number of elements * in the rx vector. Those elements will be overwritten with the data. * Use the resize() function for a new rx vector. */ - virtual int transfer(std::vector<uint8_t> *tx, std::vector<uint8_t> *rx) = 0; + virtual int transfer(std::vector<uint8_t> *tx, std::vector<uint8_t> *rx, + bool do_close = true) = 0; }; }}; /* namespace mpm::i2c */ |