• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# swtmr
2
3
4## Command Function
5
6This command is used to query information about system software timers.
7
8
9## Syntax
10
11swtmr [_ID_]
12
13
14## Parameters
15
16**Table 1** Parameter description
17
18| Parameter| Description| Value Range|
19| -------- | -------- | -------- |
20| ID | Specifies the ID of a software timer.| [0, 0xFFFFFFFF] |
21
22
23## Usage Guidelines
24
25- If no parameter is specified, information about all software timers is displayed.
26
27- If the **ID** parameter is specified, information about the specified software timer is displayed.
28
29
30## Example
31
32Run the following commands:
33
34- swtmr
35
36- swtmr 1
37
38
39## Output
40
41Example 1: information about all software timers
42
43```
44OHOS # swtmr
45SwTmrID     State    Mode    Interval  Count   Arg         handlerAddr
46----------  -------  ------- --------- ------- ----------  --------
470x00000000  Ticking  Period   100      77      0x40802a50  0x4037b8a0
48SwTmrID     State    Mode    Interval  Count   Arg         handlerAddr
49----------  -------  ------- --------- ------- ----------  --------
500x00000001  Ticking  Period   1000     876     0x00000000  0x4037fc04
51SwTmrID     State    Mode    Interval  Count   Arg         handlerAddr
52----------  -------  ------- --------- ------- ----------  --------
530x00000002  Ticking  Period   100      76      0x00000000  0x403727f4
54SwTmrID     State    Mode    Interval  Count   Arg         handlerAddr
55----------  -------  ------- --------- ------- ----------  --------
560x00000016  Ticking  NSD      10       6       0x8021e000  0x401fe7d8
57SwTmrID     State    Mode    Interval  Count   Arg         handlerAddr
58----------  -------  ------- --------- ------- ----------  --------
590x00000079  Ticking  NSD      30000    1749    0x406189d8  0x40160e1c
60```
61
62Example 2: information about software timer 1
63
64```
65OHOS # swtmr 1
66SwTmrID     State    Mode    Interval  Count   Arg         handlerAddr
67----------  -------  ------- --------- ------- ----------  --------
680x00000001  Ticking  Period   1000     841     0x00000000  0x4037fc04
69```
70
71  **Table 2** Output description
72
73| Parameter| Description|
74| -------- | -------- |
75| SwTmrID | ID of the software timer.|
76| State | Status of the software timer.<br>The status may be **UnUsed**, **Created**, or **Ticking**.|
77| 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).|
78| Interval | Number of ticks for the software timer.|
79| Count | Number of times that the software timer has been used.|
80| Arg | Input parameter.|
81| handlerAddr | Address of the callback.|
82
83> **NOTE**<br>
84> - The **ID** value can be in decimal or hexadecimal format.
85>
86> - 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