-
Notifications
You must be signed in to change notification settings - Fork 8.2k
net: lwm2m: get cache free slots #99010
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
base: main
Are you sure you want to change the base?
net: lwm2m: get cache free slots #99010
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc build issue seems to be inherited from main, the PR will need a rebase once fixed.
include/zephyr/net/lwm2m.h
Outdated
| * | ||
| * @return Number of free slots, or negative errno code in case of error. | ||
| */ | ||
| ssize_t lwm2m_cache_free_slots_get(const struct lwm2m_obj_path *path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theoretically ssize_t only guarantees to be capable of storing -1 as a negative value, so if the function is supposed to return negative error codes it should return regular int.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| bool lwm2m_cache_read(struct lwm2m_time_series_resource *cache_entry, | ||
| struct lwm2m_time_series_elem *buf); | ||
| size_t lwm2m_cache_size(const struct lwm2m_time_series_resource *cache_entry); | ||
| ssize_t lwm2m_cache_free_slots_get(const struct lwm2m_obj_path *path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is already declared in the public header, so I don't think there's a need to redeclare it in a private one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
c412976 to
7d8cae2
Compare
Add function to query LwM2M cache free slots on a given path. Signed-off-by: Julien Vermillard <julien@clunkymachines.com>
7d8cae2 to
02592dd
Compare
|



Add function to query LwM2M cache free slots on a given path.
This is usefull to detect if the buffer start to be full and flush the content using lwm2m_send