> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/libevt_8h_source.md).

# libevt.h

[Go to the documentation of this file.](/adk-5.0-programmers-guide/readme/files/dir_1e776ad494434554ed2e1a73460819d8/dir_dc5dfd6157a1d65d3f69cd65a617f88c/libevt_8h.md)

```cpp
 1 #ifndef _LIBEVT_H_
 2 #define _LIBEVT_H_
 3 
 4 // --------------------------------------------------------------------------------------------------------------------
 5 
 6 #include <stdint.h>
 7 
 8 #ifndef EVT_API
 9 #define EVT_API
 10 #endif
 11 
 12 // --------------------------------------------------------------------------------------------------------------------
 13 
 15 typedef unsigned long int WaiterHandle;
 16 
 18 const long EVT_ANY_HANDLE = -1;
 19 
 21 const WaiterHandle EVT_INVALID_HANDLE = 0;
 22 
 24 const int EVT_INFINITE_WAIT = -1;
 25 
 27 typedef uint64_t UID;
 28 
 30 const uint32_t EVT_DATA_SIZE = 64; // 64 bytes
 31 
 33 const uint32_t EVT_MAX_COUNT = 256;
 34 
 35 // --------------------------------------------------------------------------------------------------------------------
 36 
 40 #ifdef __cplusplus
 41 extern "C"
 42 {
 43 #endif
 44 
 45 struct Event
 46 {
 48  UID id;
 50  long handle;
 51  // 'raised_' attributes are set by raise side and read by wait side.
 53  uint64_t raised_timestamp;
 55  uint16_t raised_version;
 57  uint8_t raised_flag;
 59  long raised_handle;
 61  char raised_data[EVT_DATA_SIZE];
 62 };
 63 
 64 
 65 enum OSEvents
 66 {
 67  OS_NOP = 0, /* non OS event */
 68  OS_EVT_TIMER, /* user-defined timer */
 69  OS_EVT_DOCK, /* unsupported event */
 70  OS_EVT_UNDOCK, /* unsupported event */
 71  OS_EVT_SHUTDOWN, /* unsupported event */
 72 };
 73 
 77 enum WaitPolicy
 78 {
 79  WAIT_ANY,
 80  WAIT_ALL,
 81 };
 82 
 83 enum EvtSide
 84 {
 85  SIDE_RAISER = 0,
 86  SIDE_WAITER,
 87  SIDE_BOTH
 88 };
 89 
 93 enum EvtOptions
 94 {
 95  EVT_OPT_DEFAULT = 0,
 96  EVT_OPT_COPY_NEW_ONLY_EVENTS_IN_GET_BY_HANDLE_FUNC = 0x1 << 0, // ADKEVT-161
 97 };
 98 
 99 // --------------------------------------------------------------------------------------------------------------------
 100 
 107 EVT_API UID evt_make_uid(uint16_t componentID, uint16_t eventID);
 108 
 115 EVT_API UID evt_make_uid_os(uint16_t componentID, OSEvents osEvent);
 116 
 121 EVT_API uint16_t evt_get_component_id( UID );
 122 
 128 EVT_API long evt_start_timer(uint32_t timeout);
 129 
 134 EVT_API void evt_stop_timer(long handle);
 135 
 143 EVT_API int evt_init(EvtSide side, uint16_t componentID, uint8_t capacity);
 144 
 151 EVT_API int evt_destroy();
 152 
 159 EVT_API int evt_wait(Event *event, int timeout);
 160 
 169 EVT_API int evt_wait_group(Event *events, uint32_t count, int timeout, WaitPolicy policy);
 170 
 176 EVT_API int evt_raise(Event *event);
 177 
 183 EVT_API WaiterHandle evt_init_waiter(Event* events, uint32_t count);
 184 
 193 EVT_API int evt_get_by_handle(WaiterHandle waiter, Event* events, uint32_t count);
 194 
 203 EVT_API int evt_peek_by_handle(WaiterHandle waiter, Event* events, uint32_t count);
 204 
 213 EVT_API int evt_wait_by_handle(WaiterHandle handle, int timeout, WaitPolicy policy);
 214 
 223 EVT_API int evt_destroy_waiter(WaiterHandle waiter);
 224 
 228 EVT_API void evt_set_options(int options);
 229 
 233 EVT_API int evt_get_options();
 234 
 238 EVT_API const char *evt_getVersion();
 239 
 243 EVT_API int get_dock_sts();
 244 
 245 #ifdef __cplusplus
 246 } // extern C
 247 #endif
 248 
 249 #endif //_LIBEVT_H_
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/libevt_8h_source.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
