quartiq / minimq

Minimal no_std MQTT v5.0 client implementation
MIT License
143 stars 16 forks source link

Updating will management #145

Closed ryan-summers closed 1 year ago

ryan-summers commented 1 year ago

This PR refactors the will temporary storage such that the will is serialized at configuration time into a user-provided buffer. This means that the Will message itself does not need to live very long.

Pros and Cons:

ryan-summers commented 1 year ago

Another idea that we could do is have the user provide a single buffer during the Config builder. Then, when we want to serialize the will, we split the buffer to take part of it for the will.

Then, when we go to make RX/TX buffers, we can split the remainder down the middle to create the RX/TX buffers. This way. the user just has to give us a single chunk of memory that we use for everything.

We could even expose configuration features in Config to let the user specify the min/max RX/TX buffer sizes if we wanted.

ryan-summers commented 1 year ago

I spawned #146 to refactor, seems a bit of a bigger change than this PR was intending.