Update pandad.cc

This commit is contained in:
马威 2024-11-22 23:06:06 +08:00 committed by GitHub
parent bc7173460f
commit aa4db46618
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -123,9 +123,13 @@ void can_recv(std::vector<Panda *> &pandas, PubMaster *pm) {
evt.setValid(comms_healthy);
auto canData = evt.initCan(raw_can_data.size());
for (size_t i = 0; i < raw_can_data.size(); ++i) {
int src = raw_can_data[i].src;
if (src >= 4 ) {
src -= 4;
}
canData[i].setAddress(raw_can_data[i].address);
canData[i].setDat(kj::arrayPtr((uint8_t*)raw_can_data[i].dat.data(), raw_can_data[i].dat.size()));
canData[i].setSrc(raw_can_data[i].src);
canData[i].setSrc(src);
}
pm->send("can", msg);
}