1e41f4b71Sopenharmony_ci# swtmr 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci## Command Function 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ciThis command is used to query information about system software timers. 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci## Syntax 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ciswtmr [_ID_] 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci## Parameters 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci**Table 1** Parameter description 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci| Parameter| Description| Value Range| 19e41f4b71Sopenharmony_ci| -------- | -------- | -------- | 20e41f4b71Sopenharmony_ci| ID | Specifies the ID of a software timer.| [0, 0xFFFFFFFF] | 21e41f4b71Sopenharmony_ci 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci## Usage Guidelines 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci- If no parameter is specified, information about all software timers is displayed. 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci- If the **ID** parameter is specified, information about the specified software timer is displayed. 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci## Example 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ciRun the following commands: 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci- swtmr 35e41f4b71Sopenharmony_ci 36e41f4b71Sopenharmony_ci- swtmr 1 37e41f4b71Sopenharmony_ci 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ci## Output 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ciExample 1: information about all software timers 42e41f4b71Sopenharmony_ci 43e41f4b71Sopenharmony_ci``` 44e41f4b71Sopenharmony_ciOHOS # swtmr 45e41f4b71Sopenharmony_ciSwTmrID State Mode Interval Count Arg handlerAddr 46e41f4b71Sopenharmony_ci---------- ------- ------- --------- ------- ---------- -------- 47e41f4b71Sopenharmony_ci0x00000000 Ticking Period 100 77 0x40802a50 0x4037b8a0 48e41f4b71Sopenharmony_ciSwTmrID State Mode Interval Count Arg handlerAddr 49e41f4b71Sopenharmony_ci---------- ------- ------- --------- ------- ---------- -------- 50e41f4b71Sopenharmony_ci0x00000001 Ticking Period 1000 876 0x00000000 0x4037fc04 51e41f4b71Sopenharmony_ciSwTmrID State Mode Interval Count Arg handlerAddr 52e41f4b71Sopenharmony_ci---------- ------- ------- --------- ------- ---------- -------- 53e41f4b71Sopenharmony_ci0x00000002 Ticking Period 100 76 0x00000000 0x403727f4 54e41f4b71Sopenharmony_ciSwTmrID State Mode Interval Count Arg handlerAddr 55e41f4b71Sopenharmony_ci---------- ------- ------- --------- ------- ---------- -------- 56e41f4b71Sopenharmony_ci0x00000016 Ticking NSD 10 6 0x8021e000 0x401fe7d8 57e41f4b71Sopenharmony_ciSwTmrID State Mode Interval Count Arg handlerAddr 58e41f4b71Sopenharmony_ci---------- ------- ------- --------- ------- ---------- -------- 59e41f4b71Sopenharmony_ci0x00000079 Ticking NSD 30000 1749 0x406189d8 0x40160e1c 60e41f4b71Sopenharmony_ci``` 61e41f4b71Sopenharmony_ci 62e41f4b71Sopenharmony_ciExample 2: information about software timer 1 63e41f4b71Sopenharmony_ci 64e41f4b71Sopenharmony_ci``` 65e41f4b71Sopenharmony_ciOHOS # swtmr 1 66e41f4b71Sopenharmony_ciSwTmrID State Mode Interval Count Arg handlerAddr 67e41f4b71Sopenharmony_ci---------- ------- ------- --------- ------- ---------- -------- 68e41f4b71Sopenharmony_ci0x00000001 Ticking Period 1000 841 0x00000000 0x4037fc04 69e41f4b71Sopenharmony_ci``` 70e41f4b71Sopenharmony_ci 71e41f4b71Sopenharmony_ci **Table 2** Output description 72e41f4b71Sopenharmony_ci 73e41f4b71Sopenharmony_ci| Parameter| Description| 74e41f4b71Sopenharmony_ci| -------- | -------- | 75e41f4b71Sopenharmony_ci| SwTmrID | ID of the software timer.| 76e41f4b71Sopenharmony_ci| State | Status of the software timer.<br>The status may be **UnUsed**, **Created**, or **Ticking**.| 77e41f4b71Sopenharmony_ci| Mode | Mode of the software timer.<br>The value can be **Once**, **Period**, or **NSD** (one-shot timer that will not be automatically deleted after the timer has expired).| 78e41f4b71Sopenharmony_ci| Interval | Number of ticks for the software timer.| 79e41f4b71Sopenharmony_ci| Count | Number of times that the software timer has been used.| 80e41f4b71Sopenharmony_ci| Arg | Input parameter.| 81e41f4b71Sopenharmony_ci| handlerAddr | Address of the callback.| 82e41f4b71Sopenharmony_ci 83e41f4b71Sopenharmony_ci> **NOTE**<br> 84e41f4b71Sopenharmony_ci> - The **ID** value can be in decimal or hexadecimal format. 85e41f4b71Sopenharmony_ci> 86e41f4b71Sopenharmony_ci> - If the **ID** value is within the range of [0, *Number of current software timers - 1*], the status of the specified software timer is returned. Otherwise, an error code is returned. 87