Skip to content

Commit

Permalink
sync mcb
Browse files Browse the repository at this point in the history
  • Loading branch information
FerroO2000 committed May 23, 2024
1 parent b8af3ac commit 921929b
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 20 deletions.
15 changes: 10 additions & 5 deletions examples/markdown/MCB.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ BO_ 258 BMS_LV_lvBatGeneral: 6 BMS_LV
SG_ LV_BAT_summedVoltage : 32|16@1+ (0.267,14000) [0|17497.845] "mV" DSPACE

BO_ 259 BMS_LV_status: 4 BMS_LV
SG_ LV_RELAY_isOpen : 0|1@1+ (1,0) [0|1] "" DSPACE
SG_ LV_RELAY_isClosed : 0|1@1+ (1,0) [0|1] "" DSPACE
SG_ LV_CELL_0_isOV : 1|1@1+ (1,0) [0|1] "" DSPACE
SG_ LV_CELL_0_isUV : 2|1@1+ (1,0) [0|1] "" DSPACE
SG_ LV_CELL_1_isOV : 3|1@1+ (1,0) [0|1] "" DSPACE
Expand Down Expand Up @@ -185,6 +185,9 @@ BO_ 1026 SB_REAR_analog: 6 SB_REAR
SG_ COOL_PRESS_RIGHT_voltage : 16|16@1+ (1,0) [0|65535] "mV" DSPACE
SG_ BRAKE_PRESS_REAR_voltage : 32|16@1+ (1,0) [0|65535] "mV" DSPACE

BO_ 255 DASH_lvRelayOverride: 2 DASH
SG_ BMS_LV_diagPWD : 0|15@1+ (1,0) [0|65535] "" BMS_LV
SG_ LV_RELAY_forcedState : 15|1@1+ (1,0) [0|1] "" BMS_LV



Expand Down Expand Up @@ -233,9 +236,7 @@ BO_ 37 dSpace_RTD_ACK: 1 DSPACE



BO_ 255 BMSLV_RelayOverride: 2 DSPACE
SG_ password : 0|15@1+ (1,0) [0|65535] "" BMS_LV
SG_ close_relay : 15|1@1+ (1,0) [0|1] "" BMS_LV



BO_ 512 dSpace_PeripheralsCTRL: 3 DSPACE
Expand Down Expand Up @@ -290,7 +291,7 @@ CM_ SG_ 258 LV_BAT_currentSensVoltage "The voltage returned by the current senso
CM_ SG_ 258 LV_BAT_voltage "The total read voltage of the LV battery pack expressed in mV.";
CM_ SG_ 258 LV_BAT_summedVoltage "The total voltage of the LV battery pack calculated by summing each cell voltage expressed in mV.";

CM_ SG_ 259 LV_RELAY_isOpen "States whether the LV relay is open.";
CM_ SG_ 259 LV_RELAY_isClosed "States whether the LV relay is closed.";
CM_ SG_ 259 LV_CELL_0_isOV "States whether the LV cell #0 is in overvoltage.";
CM_ SG_ 259 LV_CELL_0_isUV "States whether the LV cell #0 is in undervoltage.";
CM_ SG_ 259 LV_CELL_1_isOV "States whether the LV cell #1 is in overvoltage.";
Expand Down Expand Up @@ -380,6 +381,10 @@ CM_ SG_ 1026 COOL_PRESS_LEFT_voltage "The voltage of the left cooling pressure s
CM_ SG_ 1026 COOL_PRESS_RIGHT_voltage "The voltage of the right cooling pressure sensor expressed in mV.";
CM_ SG_ 1026 BRAKE_PRESS_REAR_voltage "The voltage of the rear brake pressure sensor expressed in mV.";

CM_ SG_ 255 BMS_LV_diagPWD "The diagnostic password of the BMS_LV.";
CM_ SG_ 255 LV_RELAY_forcedState "The command to force the LV relay open (0) or closed (1).";





Expand Down
86 changes: 71 additions & 15 deletions examples/markdown/SC24.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ CAN-ID: **20**

Size: **3** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -30,6 +32,8 @@ CAN-ID: **256**

Size: **8** bytes

Byte Order: **little-endian**

Cycle Time: **100** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -46,6 +50,8 @@ CAN-ID: **257**

Size: **6** bytes

Byte Order: **little-endian**

Cycle Time: **100** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -61,6 +67,8 @@ CAN-ID: **258**

Size: **6** bytes

Byte Order: **little-endian**

Cycle Time: **100** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -76,13 +84,15 @@ CAN-ID: **259**

Size: **4** bytes

Byte Order: **little-endian**

Cycle Time: **100** ms

Receivers: [DSPACE](#DSPACE)

| Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description |
|----------------------|-----------|------|-----|-----|--------|-------|------|--------------------------------------------------------------------------------|
| LV_RELAY_isOpen | 0 | 1 | 0 | 1 | 0 | 1 | - | States whether the LV relay is open. |
| LV_RELAY_isClosed | 0 | 1 | 0 | 1 | 0 | 1 | - | States whether the LV relay is closed. |
| LV_CELL_0_isOV | 1 | 1 | 0 | 1 | 0 | 1 | - | States whether the LV cell #0 is in overvoltage. |
| LV_CELL_0_isUV | 2 | 1 | 0 | 1 | 0 | 1 | - | States whether the LV cell #0 is in undervoltage. |
| LV_CELL_1_isOV | 3 | 1 | 0 | 1 | 0 | 1 | - | States whether the LV cell #1 is in overvoltage. |
Expand Down Expand Up @@ -115,6 +125,8 @@ CAN-ID: **260**

Size: **8** bytes

Byte Order: **little-endian**

Cycle Time: **2000** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -133,6 +145,8 @@ CAN-ID: **261**

Size: **8** bytes

Byte Order: **little-endian**

Cycle Time: **2000** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -157,6 +171,8 @@ CAN-ID: **23**

Size: **3** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -172,6 +188,8 @@ CAN-ID: **38**

Size: **1** bytes

Byte Order: **little-endian**

Cycle Time: **500** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -180,11 +198,29 @@ Receivers: [DSPACE](#DSPACE)
|---------|-----------|------|-----|-----|--------|-------|------|------------------|
| RTD_CMD | 0 | 8 | 0 | 255 | 0 | 1 | - | The RTD command. |

#### DASH_lvRelayOverride
CAN-ID: **255**

Size: **2** bytes

Byte Order: **little-endian**

Cycle Time: -

Receivers: [BMS_LV](#BMS_LV)

| Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description |
|----------------------|-----------|------|-----|-------|--------|-------|------|-----------------------------------------------------------|
| BMS_LV_diagPWD | 0 | 15 | 0 | 65535 | 0 | 1 | - | The diagnostic password of the BMS_LV. |
| LV_RELAY_forcedState | 15 | 1 | 0 | 1 | 0 | 1 | - | The command to force the LV relay open (0) or closed (1). |

#### DASH_motorStatus
CAN-ID: **1280**

Size: **1** bytes

Byte Order: **little-endian**

Cycle Time: -

Receivers: [DSPACE](#DSPACE)
Expand All @@ -207,6 +243,8 @@ CAN-ID: **25**

Size: **3** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -222,6 +260,8 @@ CAN-ID: **37**

Size: **1** bytes

Byte Order: **little-endian**

Cycle Time: -

Receivers: [DASH](#DASH)
Expand All @@ -230,25 +270,13 @@ Receivers: [DASH](#DASH)
|---------------|-----------|------|-----|-----|--------|-------|------|-------------|
| RTD_FSM_STATE | 0 | 8 | -1 | 6 | 0 | 1 | - | - |

#### BMSLV_RelayOverride
CAN-ID: **255**

Size: **2** bytes

Cycle Time: -

Receivers: [BMS_LV](#BMS_LV)

| Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description |
|-------------|-----------|------|-----|-------|--------|-------|------|-------------|
| password | 0 | 15 | 0 | 65535 | 0 | 1 | - | - |
| close_relay | 15 | 1 | 0 | 1 | 0 | 1 | - | - |

#### dSpace_PeripheralsCTRL
CAN-ID: **512**

Size: **3** bytes

Byte Order: **little-endian**

Cycle Time: -

Receivers: [DASH](#DASH)
Expand All @@ -270,6 +298,8 @@ CAN-ID: **5**

Size: **8** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -286,6 +316,8 @@ CAN-ID: **16**

Size: **4** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -300,6 +332,8 @@ CAN-ID: **21**

Size: **3** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -315,6 +349,8 @@ CAN-ID: **49**

Size: **1** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -331,6 +367,8 @@ CAN-ID: **1024**

Size: **8** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -355,6 +393,8 @@ CAN-ID: **17**

Size: **4** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -369,6 +409,8 @@ CAN-ID: **22**

Size: **3** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -384,6 +426,8 @@ CAN-ID: **48**

Size: **1** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -401,6 +445,8 @@ CAN-ID: **50**

Size: **1** bytes

Byte Order: **little-endian**

Cycle Time: -

Receivers: [DSPACE](#DSPACE)
Expand All @@ -414,6 +460,8 @@ CAN-ID: **1025**

Size: **8** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -432,6 +480,8 @@ CAN-ID: **1026**

Size: **6** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -453,6 +503,8 @@ CAN-ID: **18**

Size: **3** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand All @@ -474,6 +526,8 @@ CAN-ID: **19**

Size: **3** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand Down Expand Up @@ -503,6 +557,8 @@ CAN-ID: **24**

Size: **3** bytes

Byte Order: **little-endian**

Cycle Time: **10** ms

Receivers: [DSPACE](#DSPACE)
Expand Down
1 change: 1 addition & 0 deletions md_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func (e *mdExporter) exportMessage(msg *Message) {

e.w.PlainTextf("CAN-ID: %s", md.Bold(fmt.Sprintf("%d", msg.id))).LF()
e.w.PlainTextf("Size: %s bytes", md.Bold(fmt.Sprintf("%d", msg.sizeByte))).LF()
e.w.PlainTextf("Byte Order: %s", md.Bold(msg.byteOrder.String())).LF()

cycleTimeStr := "-"
if msg.cycleTime > 0 {
Expand Down
11 changes: 11 additions & 0 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ const (
MessageByteOrderBigEndian
)

func (mbo MessageByteOrder) String() string {
switch mbo {
case MessageByteOrderLittleEndian:
return "little-endian"
case MessageByteOrderBigEndian:
return "big-endian"
default:
return "unknown"
}
}

// Message is the representation of data sent by a node thought the bus.
// It holds a list of signals that are contained in the message payload.
type Message struct {
Expand Down

0 comments on commit 921929b

Please sign in to comment.