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 <!--Del-->[<!--DelEnd-->hdc tool<!--Del-->](../../device-dev/subsystems/subsys-toolchain-hdc-guide.md)<!--DelEnd--> 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 | -o/--ordered | Indicates that the common event to publish is ordered. Optional. By default, non-ordered events are published. | 41 | -c/--code | Result code of the common event. Optional. | 42 | -d/--data | Data carried in the common event. Optional. | 43 | -h/--help | Help information. | 44 45* Example 46 47 ```bash 48 # Publish a common event named testevent. 49 cem publish --event "testevent" 50 ``` 51 52  53 54 ```bash 55 # Publish an ordered common event named testevent. The result code of the event is 100 and the data carried is "this is data". 56 cem publish -e "testevent" -o -c 100 -d "this is data" 57 ``` 58 59  60 61### dump 62 63> **NOTE** 64> 65> 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. 66 67* Function 68 69 Displays information about common events. 70 71* Method 72 73 ``` 74 cem dump [<options>] 75 ``` 76 77 The table below describes the available options. 78 79 | Name | Description | 80 | ---------- | -------------------------------------------- | 81 | -a/--all | Information about all common events that have been sent since system startup.| 82 | -e/--event | Information about a specific event. | 83 | -h/--help | Help information. | 84 85* Example 86 87 ```bash 88 # Display details of a common event named testevent. 89 cem dump -e "testevent" 90 ``` 91 92  93