Skip to content

Commit

Permalink
Merge branch '1.x' into serial-port-update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoxi-scut committed Nov 20, 2024
2 parents cd66ad0 + 29cd19f commit 6eb82a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/core/include/rmvl/core/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class RMVL_EXPORTS SerialPort

private:
//! 写入数据(基于文件描述符)
long int fdwrite(void *data, size_t len);
long int fdwrite(const void *data, size_t len);

//! 读取数据(基于文件描述符)
long int fdread(void *data, size_t len);
Expand Down
4 changes: 2 additions & 2 deletions modules/core/src/io_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ class SerialPort::Impl
void close();

//! 串口是否打开
inline bool isOpened() const { return _is_open; };
inline bool isOpened() const { return _is_open; }
//! 写入数据
long int fdwrite(void *data, std::size_t len);
long int fdwrite(const void *data, std::size_t len);
//! 读取数据
long int fdread(void *data, std::size_t len);

Expand Down
4 changes: 2 additions & 2 deletions modules/core/src/serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int getBaudRate(BaudRate baud_rate)

SerialPort::SerialPort(std::string_view device, BaudRate baud_rate) : _impl(new Impl(device, baud_rate)) {}
bool SerialPort::isOpened() const { return _impl->isOpened(); }
long int SerialPort::fdwrite(void *data, size_t length) { return _impl->fdwrite(data, length); }
long int SerialPort::fdwrite(const void *data, size_t length) { return _impl->fdwrite(data, length); }
long int SerialPort::fdread(void *data, size_t len) { return _impl->fdread(data, len); }

#ifdef _WIN32
Expand Down Expand Up @@ -166,7 +166,7 @@ void SerialPort::Impl::close()
_is_open = false;
}

long int SerialPort::Impl::fdwrite(void *data, std::size_t length)
long int SerialPort::Impl::fdwrite(const void *data, std::size_t length)
{
ssize_t len_result = -1;
if (_is_open)
Expand Down

0 comments on commit 6eb82a9

Please sign in to comment.