-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fiz Meat Pack with Multi Serial and NO_TIMEOUT #21301
Fiz Meat Pack with Multi Serial and NO_TIMEOUT #21301
Conversation
This fixes the multi serial issue for me with MeatPack, and i can re-enable my TFT serial port. |
But everything works? if not, can you share your configs? |
Everything is working as it was before, my TFT is still whining it has no printer connected but this has been for a while if i recall correctly. The second serial port is enabled though, which i could not achieve before with MeatPack |
Alright all is working with @rhapsodyv PR. My TFT serial issue was a wiring me and my Kitten need to discuss.... |
I'm not sure it's the right way to fix it. You've correctly handled the case with multiserial, but it still have the common "secret" sauce of I'd say that meatpack should be a per-serial layer so the right fix, IMHO, is to make a per-serial instance of meatpack instead of one per multi-serial and not to store a buffer of parsed status. |
I added a "Needs Discussion" label since there's now two solutions: #21306 |
Meatpack is only expected on a single serial port — namely, the one that will be permitted to connect to an external host. So I suggest that Meatpack remain limited to a single serial port — both for simplicity and to avoid any extra SRAM usage. If we still prefer to build it out as a single class, then I suggest crafting a template class that takes a "filter class" as one of the template arguments. Most serial ports would use a " … or something like that. Multi-serial adds no particular complexity re: Meatpack because only the output is "multi" — not the input AFAIK. |
Two things:
I will take a look in the second PR. First I did the And the reason is simple: we are build final code here, not a generic api that will be plugged elsewhere. Doesn’t make sense a “generic thing” just to be used “only once in life”... PS: just waking up now 😜 |
Just checking the MeatPack code over generally, at the moment the |
Well, in fact it will end up being simpler code if it follows a single pattern, taking a "null filter" by default, and a "meatpack filter" for MeatPack-capable ports, and it only happens as a lucky extra that it makes it easier to plug in similar kinds of serial filters in the future. |
I wonder if Meatpack is transparent by default or not ? I mean, in the protocol, does it require something to be enabled, or it's enabled by default ? |
I've just pushed a non static version of Meatpack in #21306 so it'll not mix things up between instances. |
We can close this and go for #21306 , as it allow the user choose what serial to enable multi pack. |
The protocol is fully described in the implementation. |
That's a poor choice. We can't change anything here anymore if the implementation is the protocol. |
To answer the remark above, the code does:
And If we chose to make a dynamic filter (with a pointer to a null filter and switched to Meatpack when enabled), then it means that'll pay the cost of dereferencing the pointer per serial char byte received and the binary space of Meatpack even if we never use it. |
Meat pack has an internal buffer to handle serial data... but it uses only one buffer for all serial. When using multi serial, it will mix data from all serials, mixing commands and responses. This PR makes it create a buffer for each serial.
NO_TIMEOUT is broken too, because of a missing
return false;
onany_serial_data_available
.This PR fix for me meat pack + multi serial + NO_TIMEOUT.
It fix a follow up for new serial_index_t with M28 (#21304)
Maybe @X-Ryl669 has another fix for this issue.
@Sebazzz is having one more issue with this combination of options plus Usb Serial on F1 board. I currently don't have a F1 board with UsbSerial, so I fixed the errors I could replicate using multi serial on my boards.
May fix #21010 and #21244
Fix #21304