SavvyCAN icon indicating copy to clipboard operation
SavvyCAN copied to clipboard

Custom frame sender, adding 0x00 to end of data field

Open wakey1991 opened this issue 2 years ago • 3 comments

After making an 8 byte data field in the correct format, most of the time (although not every time) when you press enable, it will add usually one extra set of 0x00 at the end of the data field. If you don't spot it, the message is disregarded on the bus due to its length.

Its manageable but annoying, is it something i am doing wrong or just a bug?

I haven't found a specific pattern other than after making a change in the data field.

Thanks

wakey1991 avatar Sep 04 '22 18:09 wakey1991

I found the same issue. In some cases there is a parser that runs to reformat the data and if there is a trailing space it turns it into an extra 0x00. I will attempt to commit a fix and make a pull request....

AndyHuska avatar Sep 08 '22 20:09 AndyHuska

The issue is on line 901 of framesenderwindow.cpp, change it to ignore empty tokens in the string parsing and the trailing 0x00 will go away when editing data or loading saved messages: tokens = ui->tableSender->item(line, 6)->text().split(" ", QString::SkipEmptyParts);

Attempting to make a pull request now...

AndyHuska avatar Sep 17 '22 18:09 AndyHuska

PR submitted: https://github.com/collin80/SavvyCAN/pull/494

AndyHuska avatar Sep 17 '22 18:09 AndyHuska