Skip to content

Commit 9314259

Browse files
Jamie McCraecarlescufi
authored andcommitted
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 <[email protected]>
1 parent 6a85b1b commit 9314259

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/services/device_mgmt/smp_groups/smp_group_8.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ belonging to specified download session. This means that the file is not
3737
locked in any way or exclusively owned by mcumgr, for the time of download
3838
session, and may change between requests or even be removed.
3939

40+
.. note::
41+
By default, all file upload requests are unconditionally allowed. However,
42+
if the Kconfig option :kconfig:option:`FS_MGMT_FILE_ACCESS_HOOK` is enabled,
43+
then an application can register a callback handler for ``fs_mgmt_on_evt_cb``
44+
by calling ``fs_mgmt_register_evt_cb()`` with the handler supplied. This can
45+
be used to allow or decline access to reading from or writing to a
46+
particular file, or for rewriting the path supplied by the client.
47+
4048
File download request
4149
=====================
4250

@@ -144,6 +152,14 @@ session, and may change between requests or even be removed.
144152
of bool flag indicating in-progress upload, last successfully uploaded offset
145153
and total length only.
146154

155+
.. note::
156+
By default, all file upload requests are unconditionally allowed. However,
157+
if the Kconfig option :kconfig:option:`FS_MGMT_FILE_ACCESS_HOOK` is enabled,
158+
then an application can register a callback handler for ``fs_mgmt_on_evt_cb``
159+
by calling ``fs_mgmt_register_evt_cb()`` with the handler supplied. This can
160+
be used to allow or decline access to reading from or writing to a
161+
particular file, or for rewriting the path supplied by the client.
162+
147163
File upload request
148164
===================
149165

0 commit comments

Comments
 (0)