• 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> **NOTE**
6>
7> Before using this tool, you must obtain the [hdc tool](../../device-dev/subsystems/subsys-toolchain-hdc-guide.md) and run the hdc shell command.
8
9## Commands
10
11### help
12
13* Function
14
15  Prints help information.
16
17* Method
18
19  ```
20  cem help
21  ```
22
23### publish
24
25* Function
26
27  Publishes a common event.
28
29* Method
30
31  ```
32  cem publish [<options>]
33  ```
34
35  The table below describes the available options.
36
37  | Name        | Description                                  |
38  | ------------ | ------------------------------------------ |
39  | -e/--event   | Name of the common event to publish. Mandatory.                    |
40  | -s/--sticky  | Indicates that the common event to publish is sticky. Optional. By default, non-sticky events are published.|
41  | -o/--ordered | Indicates that the common event to publish is ordered. Optional. By default, non-ordered events are published.  |
42  | -c/--code    | Result code of the common event. Optional.                  |
43  | -d/--data    | Data carried in the common event. Optional.                |
44  | -h/--help    | Help information.                                  |
45
46* Example
47
48  ```bash
49  # Publish a common event named testevent.
50  cem publish --event "testevent"
51  ```
52
53  ![cem-publish-event](figures/cem-publish-event.png)
54
55  ```bash
56  # Publish a sticky, ordered common event named testevent. The result code of the event is 100 and the data carried is this is data.
57  cem publish -e "testevent" -s -o -c 100 -d "this is data"
58  ```
59
60  ![cem-publish-all](figures/cem-publish-all.png)
61
62### dump
63
64* Function
65
66  Displays information about common events.
67
68* Method
69
70  ```
71  cem dump [<options>]
72  ```
73
74  The table below describes the available options.
75
76  | Name      | Description                                    |
77  | ---------- | -------------------------------------------- |
78  | -a/--all   | Information about all common events that have been sent since system startup.|
79  | -e/--event | Information about a specific event.                  |
80  | -h/--help  | Help information.                                    |
81
82* Example
83
84  ```bash
85  # Display details of a common event named testevent.
86  cem dump -e "testevent"
87  ```
88
89  ![cem-dump-e](figures/cem-dump-e.png)
90