diff --git a/extra/tools/network/build/package/gencode.py b/extra/tools/network/build/package/gencode.py index 983635c..bf707d6 100644 --- a/extra/tools/network/build/package/gencode.py +++ b/extra/tools/network/build/package/gencode.py @@ -38,9 +38,7 @@ def scan_messages(dbc_file, out_path, filter, cycle_time): for message in db.messages: if filter is not None and str(message.frame_id) in filter: continue - isContainer = False - if len(message.signal_groups) > 0 : - isContainer = True + isContainer = message.is_multiplexed() messageName = camel_to_snake_case(message.name) frames[messageName] = { 'frame_id': int(message.frame_id), @@ -52,7 +50,7 @@ def scan_messages(dbc_file, out_path, filter, cycle_time): } if str(message.frame_id) in cycle_time.keys(): frames[messageName]['cycle_time_ms'] = int(cycle_time[str(message.frame_id)]) - if isContainer : + if isContainer: for mux_id, signals in message.signal_tree[0]['Header_ID'].items(): frames[messageName + '_' + hex(mux_id)] = { 'container': messageName, diff --git a/extra/tools/network/internal/app/generate/network.go b/extra/tools/network/internal/app/generate/network.go index 99d3c99..dc1026e 100644 --- a/extra/tools/network/internal/app/generate/network.go +++ b/extra/tools/network/internal/app/generate/network.go @@ -108,6 +108,9 @@ func (c *GenNetworkCommand) Run() error { annotations["cycle_time_ms"] = frameInfo.CycleTime } } + if frameInfo == nil { + continue + } annotations["struct_name"] = structName // Signals (field/member names of the struct). signals := []kind.NetworkSignal{}