• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Common Event Manager
2
3The Common Event Manager enables you to print common event information and publish common events. It provides the common event debugging and testing capabilities, for example, printing all public event subscribers, sent public events, and recipients, and simulating public event release.
4
5## Environment Requirements
6
7Before using this tool, you must obtain the <!--Del-->[<!--DelEnd-->hdc tool<!--Del-->](../../device-dev/subsystems/subsys-toolchain-hdc-guide.md)<!--DelEnd--> and run the hdc shell command.
8
9## cem Commands
10
11| Command| Description|
12| ---- | --- |
13| help | Displays the cem help information.|
14| publish | Publishes a common event.|
15| dump | Dumps information about common events.|
16
17## help
18
19  ```bash
20  # Display the cem help information.
21  cem help
22  ```
23
24## publish
25
26  ```bash
27  # Publish a common event.
28  cem publish [<options>]
29  ```
30
31  **Parameters**
32
33  | Name        | Description                                   |
34  | ------------ | ------------------------------------------ |
35  | -e/--event   | Name of the common event to publish. This parameter is mandatory.                    |
36  | -o/--ordered | Indicates that the common event to publish is ordered. By default, non-ordered events are published. This parameter is optional.    |
37  | -c/--code    | Result code of the common event. This parameter is optional.                  |
38  | -d/--data    | Data carried in the common event. This parameter is optional.                |
39  | -h/--help    | Help information.                                |
40
41  **Example**
42
43  ```bash
44  # Publish a common event named testevent.
45  cem publish --event "testevent"
46  ```
47
48  ```bash
49  # Publish an ordered common event named testevent. The result code of the event is 100 and the data carried is "this is data".
50  cem publish -e "testevent" -o -c 100 -d "this is data"
51  ```
52
53## dump
54
55> **NOTE**
56>
57> The Common Event Manager has two editions: **eng** and **user**. The **dump** command can be used only in the **eng** edition. If it is used in the **user** edition, the message **error: user version cannot use dump** is reported.
58
59  ```bash
60  # Dumps information about common events.
61  cem dump [<options>]
62  ```
63
64  **Parameters**
65
66  | Name      | Description                                    |
67  | ---------- | -------------------------------------------- |
68  | -a/--all   | Information about all common events that have been sent since system startup.|
69  | -e/--event | Information about a specific event.                  |
70  | -h/--help  | Help information.                                    |
71
72  **Example**
73
74  ```bash
75  # Display details of a common event named testevent.
76  cem dump -e "testevent"
77  ```
78