mirror of https://github.com/rusefi/opendbc.git
CANParser::update_string :use const std::string& as paramater (#344)
This commit is contained in:
parent
15a20d6aef
commit
ec13e51c90
|
@ -56,7 +56,7 @@ public:
|
|||
const std::vector<SignalParseOptions> &sigoptions);
|
||||
void UpdateCans(uint64_t sec, const capnp::List<cereal::CanData>::Reader& cans);
|
||||
void UpdateValid(uint64_t sec);
|
||||
void update_string(std::string data, bool sendcan);
|
||||
void update_string(const std::string &data, bool sendcan);
|
||||
std::vector<SignalValue> query_latest();
|
||||
};
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ void CANParser::UpdateValid(uint64_t sec) {
|
|||
}
|
||||
}
|
||||
|
||||
void CANParser::update_string(std::string data, bool sendcan) {
|
||||
void CANParser::update_string(const std::string &data, bool sendcan) {
|
||||
// format for board, make copy due to alignment issues, will be freed on out of scope
|
||||
auto amsg = kj::heapArray<capnp::word>((data.length() / sizeof(capnp::word)) + 1);
|
||||
memcpy(amsg.begin(), data.data(), data.length());
|
||||
|
|
Loading…
Reference in New Issue