Skip to content

Commit

Permalink
fix: loader bus type and baudrate
Browse files Browse the repository at this point in the history
  • Loading branch information
FerroO2000 committed Dec 10, 2024
1 parent d803b75 commit 8fc0b8c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,15 @@ func (l *loader) loadNode(pNode *acmelibv1.Node) (*Node, error) {
func (l *loader) loadBus(pBus *acmelibv1.Bus) (*Bus, error) {
bus := newBusFromEntity(l.loadEntity(pBus.Entity, EntityKindBus))

var typ BusType
switch pBus.Type {
case acmelibv1.BusType_BUS_TYPE_CAN_2A:
typ = BusTypeCAN2A
}
bus.SetType(typ)

bus.SetBaudrate(int(pBus.Baudrate))

for _, pNodeInt := range pBus.NodeInterfaces {
nodeInt, err := l.loadNodeInterface(pNodeInt)
if err != nil {
Expand Down

0 comments on commit 8fc0b8c

Please sign in to comment.