mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 12:02:09 +08:00
pigeon: use const reference for std::string parameter (#19886)
old-commit-hash: b1660cf585278a65ec439ad8152cc8969797001a
This commit is contained in:
@@ -89,7 +89,7 @@ void PandaPigeon::set_baud(int baud) {
|
||||
panda->usb_write(0xe4, 1, baud/300);
|
||||
}
|
||||
|
||||
void PandaPigeon::send(std::string s) {
|
||||
void PandaPigeon::send(const std::string &s) {
|
||||
int len = s.length();
|
||||
const char * dat = s.data();
|
||||
|
||||
@@ -180,7 +180,7 @@ void TTYPigeon::set_baud(int baud){
|
||||
assert(tcflush(pigeon_tty_fd, TCIOFLUSH) == 0);
|
||||
}
|
||||
|
||||
void TTYPigeon::send(std::string s) {
|
||||
void TTYPigeon::send(const std::string &s) {
|
||||
int len = s.length();
|
||||
const char * dat = s.data();
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class Pigeon {
|
||||
|
||||
void init();
|
||||
virtual void set_baud(int baud) = 0;
|
||||
virtual void send(std::string s) = 0;
|
||||
virtual void send(const std::string &s) = 0;
|
||||
virtual std::string receive() = 0;
|
||||
virtual void set_power(bool power) = 0;
|
||||
};
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
~PandaPigeon();
|
||||
void connect(Panda * p);
|
||||
void set_baud(int baud);
|
||||
void send(std::string s);
|
||||
void send(const std::string &s);
|
||||
std::string receive();
|
||||
void set_power(bool power);
|
||||
};
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
~TTYPigeon();
|
||||
void connect(const char* tty);
|
||||
void set_baud(int baud);
|
||||
void send(std::string s);
|
||||
void send(const std::string &s);
|
||||
std::string receive();
|
||||
void set_power(bool power);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user