canmatrix icon indicating copy to clipboard operation
canmatrix copied to clipboard

Renaming Node / ECU via rename_ecu should clear out any existing transmitter and receiver

Open ChristianSteffens opened this issue 2 years ago • 2 comments

Hi,

I noticed a problem (bug?) in the db.rename_ecu method and specifically the usage of the frame.update_receiver() method.

The method should cover a rename attempt of an existing ECU throughout the complete database:

  • Any existing usage of an ECU with the old name is removed from frames transmitter and signals receiver list - works as expected.
  • Then it calls frame.update_receiver() to make sure the frame's signal receiver list is propagated to the frame itself.

But here a catch as the frame's receiver list is not cleared / emptied before (!) updating the list, so any previous occurance of any ECU (e.g. the ECU with the old name) is still carried over.

So the correct method should empty the receiver array of the frame before updating it via the signals receiver list.

ChristianSteffens avatar Jan 10 '24 00:01 ChristianSteffens

Any interest in fixing this - if not should I raise a PR?

ChristianSteffens avatar May 21 '24 09:05 ChristianSteffens

Hi @ChristianSteffens ,

for sure, yes, feel free to raise an PR

ebroecker avatar Jun 19 '24 20:06 ebroecker

should be merged

ebroecker avatar Jul 18 '24 09:07 ebroecker