doc: guides: device_mgmt: smp: fs: Add fs hook details

Adds details about the file read/write request hook that applications
can use to allow or decline requests to files.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
This commit is contained in:
Jamie McCrae 2022-03-22 12:22:08 +00:00 committed by Carles Cufí
commit 9314259312

View file

@ -37,6 +37,14 @@ belonging to specified download session. This means that the file is not
locked in any way or exclusively owned by mcumgr, for the time of download
session, and may change between requests or even be removed.
.. note::
By default, all file upload requests are unconditionally allowed. However,
if the Kconfig option :kconfig:option:`FS_MGMT_FILE_ACCESS_HOOK` is enabled,
then an application can register a callback handler for ``fs_mgmt_on_evt_cb``
by calling ``fs_mgmt_register_evt_cb()`` with the handler supplied. This can
be used to allow or decline access to reading from or writing to a
particular file, or for rewriting the path supplied by the client.
File download request
=====================
@ -144,6 +152,14 @@ session, and may change between requests or even be removed.
of bool flag indicating in-progress upload, last successfully uploaded offset
and total length only.
.. note::
By default, all file upload requests are unconditionally allowed. However,
if the Kconfig option :kconfig:option:`FS_MGMT_FILE_ACCESS_HOOK` is enabled,
then an application can register a callback handler for ``fs_mgmt_on_evt_cb``
by calling ``fs_mgmt_register_evt_cb()`` with the handler supplied. This can
be used to allow or decline access to reading from or writing to a
particular file, or for rewriting the path supplied by the client.
File upload request
===================