Skip to content

Conversation

@jvermillard
Copy link
Contributor

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

@zephyrbot zephyrbot added area: Networking area: Tests Issues related to a particular existing or missing test area: LWM2M labels Nov 6, 2025
Copy link
Contributor

@rlubos rlubos left a 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.

*
* @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);
Copy link
Contributor

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.

Copy link
Contributor Author

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);
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@jvermillard jvermillard force-pushed the lwm2m-cache-inspect branch 2 times, most recently from c412976 to 7d8cae2 Compare November 6, 2025 16:59
Add function to query LwM2M cache free slots on a given path.

Signed-off-by: Julien Vermillard <julien@clunkymachines.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 7, 2025

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

Labels

area: LWM2M area: Networking area: Tests Issues related to a particular existing or missing test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants