Skip to content

Decoupling lwpkt from lwrb for More Flexibility #11

@SONGMENGSEN

Description

@SONGMENGSEN

I believe lwrb is a great module, and I've been using it extensively. It works wonderfully! However, I think lwpkt should be an independent module, and its usage should not necessarily require lwrb.

Instead of relying on lwrb for the ring buffers, I suggest we could replace the following:

lwrb_t* tx_rb;  /*!< TX ringbuffer */
lwrb_t* rx_rb;  /*!< RX ringbuffer */

With something like:

size_t(*read)(char*, size_t);                
size_t(*write)(char*, size_t);

This would allow users to define their own read and write functions, making the module more independent. Users could still choose to use the lwrb module if they wish, but the lwpkt module would no longer be tightly coupled to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions