Code: Select all
canInterface[0] = &c;
canInterface[1] = &c2;
c.AddCallback(&cb);
c2.AddCallback(&cb);
TerminalCommands::SetCanMap(&cm);
Code: Select all
static bool CanCallback(uint32_t id, uint32_t data[2], uint8_t dlc) //This is where we go when a defined CAN message is received.
{
dlc = dlc;
switch (id)
{
case 0x7DF:
canOBD2.DecodeCAN(id,data);
break;
default:
if (Param::GetInt(Param::ShuntType) == 1) ISA::DecodeCAN(id, data);
if (Param::GetInt(Param::ShuntType) == 2) SBOX::DecodeCAN(id, data);
if (Param::GetInt(Param::ShuntType) == 3) VWBOX::DecodeCAN(id, data);
selectedInverter->DecodeCAN(id, data);
selectedVehicle->DecodeCAN(id, data);
selectedCharger->DecodeCAN(id, data);
selectedChargeInt->DecodeCAN(id, data);
selectedBMS->DecodeCAN(id, (uint8_t*)data);
selectedDCDC->DecodeCAN(id, (uint8_t*)data);
selectedShifter->DecodeCAN(id,data);
selectedHeater->DecodeCAN(id, data);
break;
}
return false;
}