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

net: lwm2m: Publicize firmware block context #16369

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions include/net/lwm2m.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,13 @@ void lwm2m_firmware_set_update_cb(lwm2m_engine_user_cb_t cb);
* @return A registered callback function to receive the execute event.
*/
lwm2m_engine_user_cb_t lwm2m_firmware_get_update_cb(void);

/**
* @brief Get the block context of the current firmware block.
*
* @param[out] ctx A buffer to store the block context.
*/
struct coap_block_context *lwm2m_firmware_get_block_context();
#endif
#endif

Expand Down
10 changes: 10 additions & 0 deletions subsys/net/lib/lwm2m/lwm2m_obj_firmware_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,3 +464,13 @@ int lwm2m_firmware_start_transfer(char *package_uri)

return 0;
}

/**
* @brief Get the block context of the current firmware block.
*
* @return A pointer to the firmware block context
*/
struct coap_block_context *lwm2m_firmware_get_block_context()
{
mike-scott marked this conversation as resolved.
Show resolved Hide resolved
return &firmware_block_ctx;
}