reverted back changes to function signature of serial rx callback func

This commit is contained in:
Ruixiang Du
2020-09-14 21:37:08 +08:00
parent 9e646c78b7
commit c501b6a38d
3 changed files with 13 additions and 7 deletions

View File

@@ -23,7 +23,7 @@ class AsyncSerial : public AsyncListener,
public std::enable_shared_from_this<AsyncSerial> {
public:
using ReceiveCallback =
std::function<void(uint8_t *data, size_t len, const size_t bufsize)>;
std::function<void(uint8_t *data, const size_t bufsize, size_t len)>;
public:
AsyncSerial(std::string port_name, uint32_t baud_rate = 115200);
@@ -56,7 +56,7 @@ class AsyncSerial : public AsyncListener,
bool tx_in_progress_ = false;
bool SetupPort();
void DefaultReceiveCallback(uint8_t *data, size_t len, const size_t bufsize);
void DefaultReceiveCallback(uint8_t *data, const size_t bufsize, size_t len);
void ReadFromPort();
void WriteToPort(bool check_if_busy);
};