doc: lwm2m: LwM2M Shell
Describes a possible scenario where to use the LwM2M shell and how to enable it. Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
This commit is contained in:
parent
0b2b221b36
commit
8c68e01e55
2 changed files with 54 additions and 3 deletions
|
@ -576,6 +576,57 @@ The events are prefixed with ``LWM2M_RD_CLIENT_EVENT_``.
|
||||||
If the retry counter reaches its limits, this event will be triggered.
|
If the retry counter reaches its limits, this event will be triggered.
|
||||||
- No actions needed, client will do a re-registrate automatically.
|
- No actions needed, client will do a re-registrate automatically.
|
||||||
|
|
||||||
|
.. _lwm2m_shell:
|
||||||
|
|
||||||
|
LwM2M shell
|
||||||
|
***********
|
||||||
|
For testing the client it is possible to enable Zephyr's shell and LwM2M specific commands which
|
||||||
|
support changing the state of the client. Operations supported are read, write and execute
|
||||||
|
resources. Client start, stop, pause and resume are also available. The feature is enabled by
|
||||||
|
selecting :kconfig:option:`CONFIG_LWM2M_SHELL`. The shell is meant for testing so productions
|
||||||
|
systems should not enable it.
|
||||||
|
|
||||||
|
One imaginable scenario, where to use the shell, would be executing client side actions over UART
|
||||||
|
when a server side tests would require those. It is assumed that not all tests are able to trigger
|
||||||
|
required actions from the server side.
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
uart:~$ lwm2m
|
||||||
|
lwm2m - LwM2M commands
|
||||||
|
Subcommands:
|
||||||
|
exec :Execute a resource
|
||||||
|
exec PATH
|
||||||
|
|
||||||
|
read :Read value from LwM2M resource
|
||||||
|
read PATH [OPTIONS]
|
||||||
|
-s Read value as string (default)
|
||||||
|
-b Read value as bool (1/0)
|
||||||
|
-uX Read value as uintX_t
|
||||||
|
-sX Read value as intX_t
|
||||||
|
-f Read value as float
|
||||||
|
|
||||||
|
write :Write into LwM2M resource
|
||||||
|
write PATH [OPTIONS] VALUE
|
||||||
|
-s Value as string (default)
|
||||||
|
-b Value as bool
|
||||||
|
-uX Value as uintX_t
|
||||||
|
-sX Value as intX_t
|
||||||
|
-f Value as float
|
||||||
|
|
||||||
|
start :Start the LwM2M RD (Registration / Discovery) Client
|
||||||
|
start EP_NAME [BOOTSTRAP FLAG]
|
||||||
|
-b Set the bootstrap flag (default 0)
|
||||||
|
|
||||||
|
stop :Stop the LwM2M RD (De-register) Client
|
||||||
|
stop [OPTIONS]
|
||||||
|
-f Force close the connection
|
||||||
|
|
||||||
|
update :Trigger Registration Update of the LwM2M RD Client
|
||||||
|
|
||||||
|
pause :LwM2M engine thread pause
|
||||||
|
resume :LwM2M engine thread resume
|
||||||
|
|
||||||
|
|
||||||
.. _lwm2m_api_reference:
|
.. _lwm2m_api_reference:
|
||||||
|
|
||||||
|
|
|
@ -28,19 +28,19 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
|
||||||
"Root-level operation is unsupported"
|
"Root-level operation is unsupported"
|
||||||
#define LWM2M_HELP_EXEC "Execute a resource\nexec PATH\n"
|
#define LWM2M_HELP_EXEC "Execute a resource\nexec PATH\n"
|
||||||
#define LWM2M_HELP_READ "Read value from LwM2M resource\nread PATH [OPTIONS]\n" \
|
#define LWM2M_HELP_READ "Read value from LwM2M resource\nread PATH [OPTIONS]\n" \
|
||||||
"-s \tRead value as string(default)\n" \
|
"-s \tRead value as string (default)\n" \
|
||||||
"-b \tRead value as bool (1/0)\n" \
|
"-b \tRead value as bool (1/0)\n" \
|
||||||
"-uX\tRead value as uintX_t\n" \
|
"-uX\tRead value as uintX_t\n" \
|
||||||
"-sX\tRead value as intX_t\n" \
|
"-sX\tRead value as intX_t\n" \
|
||||||
"-f \tRead value as float\n"
|
"-f \tRead value as float\n"
|
||||||
#define LWM2M_HELP_WRITE "Write into LwM2M resource\nwrite PATH [OPTIONS] VALUE\n" \
|
#define LWM2M_HELP_WRITE "Write into LwM2M resource\nwrite PATH [OPTIONS] VALUE\n" \
|
||||||
"-s \tValue as string(default)\n" \
|
"-s \tValue as string (default)\n" \
|
||||||
"-b \tValue as bool\n" \
|
"-b \tValue as bool\n" \
|
||||||
"-uX\tValue as uintX_t\n" \
|
"-uX\tValue as uintX_t\n" \
|
||||||
"-sX\tValue as intX_t\n" \
|
"-sX\tValue as intX_t\n" \
|
||||||
"-f \tValue as float\n"
|
"-f \tValue as float\n"
|
||||||
#define LWM2M_HELP_START "Start the LwM2M RD (Registration / Discovery) Client\n" \
|
#define LWM2M_HELP_START "Start the LwM2M RD (Registration / Discovery) Client\n" \
|
||||||
"start EP_NAME [OPTIONS] [BOOTSTRAP FLAG]\n" \
|
"start EP_NAME [BOOTSTRAP FLAG]\n" \
|
||||||
"-b \tSet the bootstrap flag (default 0)\n"
|
"-b \tSet the bootstrap flag (default 0)\n"
|
||||||
#define LWM2M_HELP_STOP "Stop the LwM2M RD (De-register) Client\nstop [OPTIONS]\n" \
|
#define LWM2M_HELP_STOP "Stop the LwM2M RD (De-register) Client\nstop [OPTIONS]\n" \
|
||||||
"-f \tForce close the connection\n"
|
"-f \tForce close the connection\n"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue