Skip to content
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

Unify callbacks with block transfer and non-blocktransfer #537

Closed
mlasch opened this issue Feb 9, 2021 · 3 comments
Closed

Unify callbacks with block transfer and non-blocktransfer #537

mlasch opened this issue Feb 9, 2021 · 3 comments

Comments

@mlasch
Copy link
Contributor

mlasch commented Feb 9, 2021

Currently for each operation there are two possible callbacks, either with or without block transfer. However it is not always known a priori whether a block transfer callback is needed.
For example a "normal" read lwm2m_dm_read can induce a block response which triggers callbacks without block information.
I suggest having a block information structure in every callback which keeps track on the block transfer and is NULL if the callback results from a non-block transfer. Something like:

typedef struct _block_information_
{
  int block_num;
  int block_size;
  bool block_more;
} block_information_t;

However this would break the current API, any thoughts?

@sbernard31
Copy link
Contributor

About breaking the API, this discussion makes me feel that this is probably not a problem at least for master.

@tuve
Copy link
Contributor

tuve commented Feb 10, 2021

I think having a unifed api with an optional struct as described is much better than the current solution. The reason I didn't do something like that when I implemented block transfer was that I didn't wanted to break the current api, but moving forward I think this is the way to go.

@sbernard31
Copy link
Contributor

Fix by #540.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants