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> **NOTE** 26> 27> The Common Event Manager has two editions: **eng** and **user**. The **publish** command can be used only in the **eng** edition. If it is used in the **user** edition, the message **error: user version cannot publish common events** is reported. 28 29* Function 30 31 Publishes a common event. 32 33* Method 34 35 ``` 36 cem publish [<options>] 37 ``` 38 39 The table below describes the available options. 40 41 | Name | Description | 42 | ------------ | ------------------------------------------ | 43 | -e/--event | Name of the common event to publish. Mandatory. | 44 | -s/--sticky | Indicates that the common event to publish is sticky. Optional. By default, non-sticky events are published.| 45 | -o/--ordered | Indicates that the common event to publish is ordered. Optional. By default, non-ordered events are published. | 46 | -c/--code | Result code of the common event. Optional. | 47 | -d/--data | Data carried in the common event. Optional. | 48 | -h/--help | Help information. | 49 50* Example 51 52 ```bash 53 # Publish a common event named testevent. 54 cem publish --event "testevent" 55 ``` 56 57  58 59 ```bash 60 # Publish a sticky, ordered common event named testevent. The result code of the event is 100 and the data carried is this is data. 61 cem publish -e "testevent" -s -o -c 100 -d "this is data" 62 ``` 63 64  65 66### dump 67 68* Function 69 70 Displays information about common events. 71 72* Method 73 74 ``` 75 cem dump [<options>] 76 ``` 77 78 The table below describes the available options. 79 80 | Name | Description | 81 | ---------- | -------------------------------------------- | 82 | -a/--all | Information about all common events that have been sent since system startup.| 83 | -e/--event | Information about a specific event. | 84 | -h/--help | Help information. | 85 86* Example 87 88 ```bash 89 # Display details of a common event named testevent. 90 cem dump -e "testevent" 91 ``` 92 93  94