From 47db9238f4881ffbf0d48fae4fe252efee3800a6 Mon Sep 17 00:00:00 2001 From: Jason Young <46612682+jyoung8607@users.noreply.github.com> Date: Thu, 2 Apr 2020 12:23:05 -0700 Subject: [PATCH] Add SWA_01 message detail and CRC support for VW MQB (#236) * Add canonical SWA_01 message and signal info * SWA_01 CRC validation * Decimal to int, to match the rest of the file --- can/common.cc | 3 +++ vw_mqb_2010.dbc | 23 ++++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/can/common.cc b/can/common.cc index 5c7efe4..3fec5c4 100644 --- a/can/common.cc +++ b/can/common.cc @@ -106,6 +106,9 @@ unsigned int volkswagen_crc(unsigned int address, uint64_t d, int l) { case 0x30C: // ACC_02 Automatic Cruise Control crc ^= (uint8_t[]){0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F}[counter]; break; + case 0x30F: // SWA_01 Lane Change Assist (SpurWechselAssistent) + crc ^= (uint8_t[]){0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C}[counter]; + break; case 0x3C0: // Klemmen_Status_01 ignition and starting status crc ^= (uint8_t[]){0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3}[counter]; break; diff --git a/vw_mqb_2010.dbc b/vw_mqb_2010.dbc index 6db2a4f..c542b31 100644 --- a/vw_mqb_2010.dbc +++ b/vw_mqb_2010.dbc @@ -1254,9 +1254,26 @@ BO_ 695 RCTA_01: 8 XXX SG_ RCTA_01_BZ : 8|4@1+ (1,0) [0|15] "" XXX SG_ RCTA_01_CRC : 0|8@1+ (1,0) [0|255] "" XXX -BO_ 783 SWA_01: 8 XXX - SG_ SWA_01_BZ : 8|4@1+ (1,0) [0|15] "" XXX - SG_ SWA_01_CRC : 0|8@1+ (1,0) [0|255] "" XXX +BO_ 783 SWA_01: 8 Gateway_MQB + SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" Vector__XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" Vector__XXX + SG_ SWA_Anzeigen : 12|4@1+ (1,0) [0|15] "" Kombi_D4 + SG_ SWA_Blindheit_erkannt : 16|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_rel_Nichtverf : 17|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_rel_Fehler : 18|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Sta_aktiv : 19|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Sta_passiv : 20|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Standziele_li : 24|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Kolonne_li : 25|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Infostufe_SWA_li : 26|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Warnung_SWA_li : 27|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Kolonne_mi : 33|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Standziele_re : 40|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Kolonne_re : 41|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Infostufe_SWA_re : 42|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Warnung_SWA_re : 43|1@1+ (1,0) [0|1] "" Vector__XXX + SG_ SWA_Gischtzaehler : 48|7@1+ (1,0) [0|100] "Unit_PerCent" Vector__XXX + SG_ SWA_KD_Fehler : 59|1@1+ (1,0) [0|1] "" Vector__XXX BO_ 804 ACC_04: 8 XXX SG_ ACC_04_CRC : 0|8@1+ (1,0) [0|255] "" XXX