@@ -470,14 +470,21 @@ def dump(db, f, **options):
470470 # add the file name as a suffix in the cluster name
471471 cluster_name = f"cluster_{ os .path .basename (f .name ).split ('.' )[0 ]} "
472472 create_short_name_desc (cluster , cluster_name , "clusterDesc" )
473- create_sub_element_fx (cluster , "SPEED" , "500" )
474473 create_sub_element_fx (cluster , "IS-HIGH-LOW-BIT-ORDER" , "true" )
475474 create_sub_element_fx (cluster , "BIT-COUNTING-POLICY" , "MONOTONE" )
476475 if 'BusType' in db .attributes and db .attributes ['BusType' ] == "CAN FD" :
477476 protocol = create_sub_element_fx (cluster , "PROTOCOL" , "CAN-FD" )
478- create_sub_element_fx (cluster , "CAN-FD-SPEED" , "2000000" )
477+ if 'Baudrate' in db .attributes :
478+ create_sub_element_fx (cluster , "CAN-FD-SPEED" , db .attributes ['Baudrate' ])
479+ else :
480+ create_sub_element_fx (cluster , "CAN-FD-SPEED" , "2000000" )
481+ create_sub_element_fx (cluster , "SPEED" , "500" )
479482 else :
480483 protocol = create_sub_element_fx (cluster , "PROTOCOL" , "CAN" )
484+ if 'Baudrate' in db .attributes :
485+ create_sub_element_fx (cluster , "SPEED" , db .attributes ['Baudrate' ])
486+ else :
487+ create_sub_element_fx (cluster , "SPEED" , "500" )
481488 protocol .attrib ['{{{pre}}}type' .format (pre = xsi )] = "can:PROTOCOL-TYPE"
482489 create_sub_element_fx (cluster , "PROTOCOL-VERSION" , "20" )
483490 channel_refs = create_sub_element_fx (cluster , "CHANNEL-REFS" )
0 commit comments