add examples for LwM2M execute with arguments#444
Conversation
There was a problem hiding this comment.
Pull request overview
Adds documentation examples for the ThingsBoard LwM2M Execute RPC that demonstrate how to pass OMA LwM2M execute argument lists (single/multiple args, values, and link values) to improve clarity for users integrating with execute-with-arguments support.
Changes:
- Added an “Execute with Arguments” subsection with multiple request/response examples.
- Included examples for single-argument, delayed/timer-like value, link value, and multi-argument-without-values formats.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ### Execute with Arguments | ||
|
|
||
| Execute a resource with parameters: execute Reboot on the device if the digit value is 5. |
| Execute a resource with parameters: execute Reboot on the device if the digit value is 5. | ||
|
|
||
| ```json | ||
| {"method": "Execute", "params": {"id":"3/0/4","value":5}} |
There was a problem hiding this comment.
updated the IDs to include the leading slash / and rephrased the descriptions to remove the conditional 'if' and strictly describe the arguments.
Regarding the value: 5 data type: according to the OMA LwM2M specification for Execute arguments, single digits (0-9) without values are valid as pure numbers. String format is required only for multi-digit arguments (10+), multiple arguments, or arguments with values (like 2='60'). So keeping 5 as a number here is completely correct and follows the spec.
| ``` | ||
|
|
||
| ``` | ||
| Execute {"id":"3/0/4","value":5} |
There was a problem hiding this comment.
updated the IDs to include the leading slash / and rephrased the descriptions to remove the conditional 'if' and strictly describe the arguments.
Regarding the value: 5 data type: according to the OMA LwM2M specification for Execute arguments, single digits (0-9) without values are valid as pure numbers. String format is required only for multi-digit arguments (10+), multiple arguments, or arguments with values (like 2='60'). So keeping 5 as a number here is completely correct and follows the spec.
| # Response: {"result":"CHANGED"} | ||
| ``` | ||
|
|
||
| Execute a resource with parameters: execute Factory Reset on the device if the digit value is 2 -> after 60 seconds. |
| Execute a resource with parameters: execute Factory Reset on the device if the digit value is 2 -> after 60 seconds. | ||
|
|
||
| ```json | ||
| {"method": "Execute", "params": {"id":"3/0/5","value":"2='60'"}} |
| ``` | ||
|
|
||
| ``` | ||
| Execute {"id":"3/0/5","value":"2='60'"} |
| - Digit 0 with a link value. | ||
|
|
||
| ```json | ||
| {"method": "Execute", "params": {"id":"3/0/5","value":"2,0='https://thingsboard.io/docs/reference/lwm2m-api/'"}} |
| ``` | ||
|
|
||
| ``` | ||
| Execute {"id":"3/0/5","value":"2,0='https://thingsboard.io/docs/reference/lwm2m-api/'"} |
| - According to the OMA LwM2M execute arguments format, this represents ten arguments from 0 to 9, none of which have values. | ||
|
|
||
| ```json | ||
| {"method": "Execute", "params": {"id":"3/0/5","value":"0,1,2,3,4,5,6,7,8,9"}} |
| ``` | ||
|
|
||
| ``` | ||
| Execute {"id":"3/0/5","value":"0,1,2,3,4,5,6,7,8,9"} |
| ``` | ||
|
|
||
| ``` | ||
| Execute {"id": "/3/0/4", "value": 5} |
| ``` | ||
|
|
||
| ``` | ||
| Execute {"id": "/3/0/5", "value": "2='60'"} |
| ``` | ||
|
|
||
| ``` | ||
| Execute {"id": "/3/0/5", "value": "2,0='https://thingsboard.io/docs/reference/lwm2m-api/'"} |
| ``` | ||
|
|
||
| ``` | ||
| Execute {"id": "/3/0/5", "value": "0,1,2,3,4,5,6,7,8,9"} |
Description
Added comprehensive and properly formatted examples for executing LwM2M resources with single and multiple arguments (including timers and link values). This improves readability and helps users better understand the OMA LwM2M execute arguments format.
thingsboard/thingsboard#14881
Type of change
src/content/docs/**)src/content/_includes/**)src/components/**,src/styles/**)src/pages/**,src/data/**)src/data/redirects.ts)releaseskill)Affected products
Related issues
Checklist
pnpm checkpasses (Astro / TypeScript)pnpm lint:eslintpassespnpm lint:slugcheckpasses (required if pages were added/renamed/moved across languages)pnpm lint:linkcheckpasses locally — required to merge; run it before requesting review (usepnpm lint:linkcheck:nobuildif you already ran a build)src/data/redirects.ts, andpnpm generate:redirectswas runsrc/data/versions.ts