> 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/readme/files/dir_1e776ad494434554ed2e1a73460819d8/dir_dc5dfd6157a1d65d3f69cd65a617f88c/libevt_8h.md).

# libevt.h

[Data Structures](#nested-classes) | [Macros](#define-members) | [Typedefs](#typedef-members) | [Enumerations](#enum-members) | [Functions](#func-members) | [Variables](#var-members)

`#include <stdint.h>`

Include dependency graph for libevt.h:

![](/files/azzgzGu3VtSBW1gXTCCL)

[Go to the source code of this file.](/adk-5.0-programmers-guide/libevt_8h_source.md)

|                 |                        |
| --------------- | ---------------------- |
| Data Structures |                        |
| struct          | [Event](#struct_event) |

|         |                                                |
| ------- | ---------------------------------------------- |
| Macros  |                                                |
| #define | [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) |

|                           |                                                                                                                     |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Typedefs                  |                                                                                                                     |
| typedef unsigned long int | [WaiterHandle](#a7ba4b46d2481427f399dda29a67aaab6)                                                                  |
|                           | <p>Waiting handle type. <a href="#a7ba4b46d2481427f399dda29a67aaab6">More...</a><br></p>                            |
| typedef uint64\_t         | [UID](#a83aa1253e238763a389f784ff78d569e)                                                                           |
|                           | <p>Unique ID of <a href="#struct_event">Event</a>. <a href="#a83aa1253e238763a389f784ff78d569e">More...</a><br></p> |

|              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Enumerations |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| enum         | <p><a href="#a47782499daa82ca02ceec0dde367c162">OSEvents</a> {<br>  <a href="#a47782499daa82ca02ceec0dde367c162a46e70b83f1a2498c9325b00cb2cf4e3e">OS\_NOP</a> = 0, <a href="#a47782499daa82ca02ceec0dde367c162a55c5d33fac553b62a4a2988c2b53af96">OS\_EVT\_TIMER</a>, <a href="#a47782499daa82ca02ceec0dde367c162aec9658ee40107e166a1dac5d8efc29a1">OS\_EVT\_DOCK</a>, <a href="#a47782499daa82ca02ceec0dde367c162a37f3b245fe203131c78859388aa7d6ec">OS\_EVT\_UNDOCK</a>,<br>  <a href="#a47782499daa82ca02ceec0dde367c162ae25c516903050b08d5cd015e625bf3af">OS\_EVT\_SHUTDOWN</a><br>}</p> |
| enum         | [WaitPolicy](#a7d8e96aac2c9ffc0945f804832b93305) { [WAIT\_ANY](#a7d8e96aac2c9ffc0945f804832b93305a2a6b8a36eb30e1a3e433912876977446), [WAIT\_ALL](#a7d8e96aac2c9ffc0945f804832b93305a5ee1ddeefe68a1f2a66eb8fa6440f0ba) }                                                                                                                                                                                                                                                                                                                                                                    |
| enum         | [EvtSide](#a45a13daa32f946f8dd819ee734fbf236) { [SIDE\_RAISER](#a45a13daa32f946f8dd819ee734fbf236ad699859f8546fbfb9ca1eab82e1a3586) = 0, [SIDE\_WAITER](#a45a13daa32f946f8dd819ee734fbf236af860bd783aa79d81ad43ab8c164da7a8), [SIDE\_BOTH](#a45a13daa32f946f8dd819ee734fbf236a367c08987c7a0052de86e72ffc318d97) }                                                                                                                                                                                                                                                                          |
| enum         | [EvtOptions](#aaeb183a7a4790d18f96fa3755b1cbc42) { [EVT\_OPT\_DEFAULT](#aaeb183a7a4790d18f96fa3755b1cbc42aef88812f61bd57953fff8fa42b9a6fd0) = 0, [EVT\_OPT\_COPY\_NEW\_ONLY\_EVENTS\_IN\_GET\_BY\_HANDLE\_FUNC](#aaeb183a7a4790d18f96fa3755b1cbc42a3256b804f3c9350097da691390b88f76) = 0x1 << 0 }                                                                                                                                                                                                                                                                                          |

|                                                                                                   |                                                                                                                                                                                               |
| ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Functions                                                                                         |                                                                                                                                                                                               |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) [UID](#a83aa1253e238763a389f784ff78d569e)          | [evt\_make\_uid](#a886f0a69446395a4013dc45380f4128f) (uint16\_t componentID, uint16\_t eventID)                                                                                               |
|                                                                                                   | <p>Creates UID based on componentID and eventID. <a href="#a886f0a69446395a4013dc45380f4128f">More...</a><br></p>                                                                             |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) [UID](#a83aa1253e238763a389f784ff78d569e)          | [evt\_make\_uid\_os](#afb47263c3337482a275b6cecf497204b) (uint16\_t componentID, [OSEvents](#a47782499daa82ca02ceec0dde367c162) osEvent)                                                      |
|                                                                                                   | <p>Creates UID based on componentID and OS <a href="#struct_event">Event</a>. <a href="#afb47263c3337482a275b6cecf497204b">More...</a><br></p>                                                |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) uint16\_t                                          | [evt\_get\_component\_id](#a2063afa16979be3952b393dd81bfd5f8) ([UID](#a83aa1253e238763a389f784ff78d569e))                                                                                     |
|                                                                                                   | <p>Returns componentID part of UID. <a href="#a2063afa16979be3952b393dd81bfd5f8">More...</a><br></p>                                                                                          |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) long                                               | [evt\_start\_timer](#af7e23c1a0a2e9a3caa6faf55c3aae1d4) (uint32\_t timeout)                                                                                                                   |
|                                                                                                   | <p>Starts a new timer. <a href="#af7e23c1a0a2e9a3caa6faf55c3aae1d4">More...</a><br></p>                                                                                                       |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) void                                               | [evt\_stop\_timer](#a6f6a659420a37bb9e1d1b07edfe419a2) (long handle)                                                                                                                          |
|                                                                                                   | <p>Deletes a timer. <a href="#a6f6a659420a37bb9e1d1b07edfe419a2">More...</a><br></p>                                                                                                          |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) int                                                | [evt\_init](#a799ffc9044180e2968690455cfb5d8cf) ([EvtSide](#a45a13daa32f946f8dd819ee734fbf236) side, uint16\_t componentID, uint8\_t capacity)                                                |
|                                                                                                   | <p>Initialize EVT library. <a href="#a799ffc9044180e2968690455cfb5d8cf">More...</a><br></p>                                                                                                   |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) int                                                | [evt\_destroy](#af8fba20f70dc5d4274484f3d3eaf0fc2) ()                                                                                                                                         |
|                                                                                                   | <p>De-initialize EVT library. <a href="#af8fba20f70dc5d4274484f3d3eaf0fc2">More...</a><br></p>                                                                                                |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) int                                                | [evt\_wait](#adb08919483f2094f1927d67dad595278) ([Event](#struct_event) \*event, int timeout)                                                                                                 |
|                                                                                                   | <p>Wait for a single event. <a href="#adb08919483f2094f1927d67dad595278">More...</a><br></p>                                                                                                  |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) int                                                | [evt\_wait\_group](#ab26c08b8228d47a7b83144e5ec6d9c4e) ([Event](#struct_event) \*events, uint32\_t count, int timeout, [WaitPolicy](#a7d8e96aac2c9ffc0945f804832b93305) policy)               |
|                                                                                                   | <p>Wait for a group of events. <a href="#ab26c08b8228d47a7b83144e5ec6d9c4e">More...</a><br></p>                                                                                               |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) int                                                | [evt\_raise](#a2855073610dc2b9210a25468926cfecc) ([Event](#struct_event) \*event)                                                                                                             |
|                                                                                                   | <p>Raise an event. <a href="#a2855073610dc2b9210a25468926cfecc">More...</a><br></p>                                                                                                           |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) [WaiterHandle](#a7ba4b46d2481427f399dda29a67aaab6) | [evt\_init\_waiter](#a76bffba58228fdcd95671e17bf8ad041) ([Event](#struct_event) \*events, uint32\_t count)                                                                                    |
|                                                                                                   | <p>Initialize asynchronous waiter for a group of events. <a href="#a76bffba58228fdcd95671e17bf8ad041">More...</a><br></p>                                                                     |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) int                                                | [evt\_get\_by\_handle](#a9fbabdeb66cb9541e4a4c146b7e1658a) ([WaiterHandle](#a7ba4b46d2481427f399dda29a67aaab6) waiter, [Event](#struct_event) \*events, uint32\_t count)                      |
|                                                                                                   | <p>Get events so far collected by asynchronous waiter. <a href="#a9fbabdeb66cb9541e4a4c146b7e1658a">More...</a><br></p>                                                                       |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) int                                                | [evt\_peek\_by\_handle](#a793d32176ee75ec31b31f1fb1cd6abbc) ([WaiterHandle](#a7ba4b46d2481427f399dda29a67aaab6) waiter, [Event](#struct_event) \*events, uint32\_t count)                     |
|                                                                                                   | <p>Peek events so far collected by asynchronous waiter. <a href="#a793d32176ee75ec31b31f1fb1cd6abbc">More...</a><br></p>                                                                      |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) int                                                | [evt\_wait\_by\_handle](#a57f2c3182b0ea176490a1735324de25e) ([WaiterHandle](#a7ba4b46d2481427f399dda29a67aaab6) handle, int timeout, [WaitPolicy](#a7d8e96aac2c9ffc0945f804832b93305) policy) |
|                                                                                                   | <p>Blocks thread execution until waiter receive an event or timeout occurs. <a href="#a57f2c3182b0ea176490a1735324de25e">More...</a><br></p>                                                  |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) int                                                | [evt\_destroy\_waiter](#a09b61b8da3127a2c067df17d29be4f1f) ([WaiterHandle](#a7ba4b46d2481427f399dda29a67aaab6) waiter)                                                                        |
|                                                                                                   | <p>Stops and destroys the asynchronous waiter. <a href="#a09b61b8da3127a2c067df17d29be4f1f">More...</a><br></p>                                                                               |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) void                                               | [evt\_set\_options](#a5e8063c63d656262cf58b6336b270502) (int options)                                                                                                                         |
|                                                                                                   | <p>Set options changing behavior of ADK-EVT engine. <a href="#a5e8063c63d656262cf58b6336b270502">More...</a><br></p>                                                                          |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) int                                                | [evt\_get\_options](#aee16ce74c4a65f2ac2952bfd2f06dd27) ()                                                                                                                                    |
|                                                                                                   | <p>Get options. <a href="#aee16ce74c4a65f2ac2952bfd2f06dd27">More...</a><br></p>                                                                                                              |
| const [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) char \*                                      | [evt\_getVersion](#a1a7daf80470e0ad3b570ec8fc680821d) ()                                                                                                                                      |
|                                                                                                   | <p>get version of a library <a href="#a1a7daf80470e0ad3b570ec8fc680821d">More...</a><br></p>                                                                                                  |
| [EVT\_API](#a7e6311173510f4660ef3c2d2f234f429) int                                                | [get\_dock\_sts](#adc9d1c34c7762b01b3b9830f1f70c6ed) ()                                                                                                                                       |
|                                                                                                   | <p>Returns unit dock status. <a href="#adc9d1c34c7762b01b3b9830f1f70c6ed">More...</a><br></p>                                                                                                 |

|                                                          |                                                                                                                                                          |
| -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Variables                                                |                                                                                                                                                          |
| const long                                               | [EVT\_ANY\_HANDLE](#a63090fb17900201d2517be5e555b7d87) = -1                                                                                              |
|                                                          | <p>Timer <a href="#struct_event">Event</a> mask that allow to receive all timer events. <a href="#a63090fb17900201d2517be5e555b7d87">More...</a><br></p> |
| const [WaiterHandle](#a7ba4b46d2481427f399dda29a67aaab6) | [EVT\_INVALID\_HANDLE](#a468c3786a00e38b1d61d083fa0b4ce96) = 0                                                                                           |
|                                                          | <p>Invalid WaiterHandle value. <a href="#a468c3786a00e38b1d61d083fa0b4ce96">More...</a><br></p>                                                          |
| const int                                                | [EVT\_INFINITE\_WAIT](#a35fc755ca0569e2acb759e0d683a2fb5) = -1                                                                                           |
|                                                          | <p>Timeout value for infinite wait. <a href="#a35fc755ca0569e2acb759e0d683a2fb5">More...</a><br></p>                                                     |
| const uint32\_t                                          | [EVT\_DATA\_SIZE](#adb6493cdff512931871b2239b71215c2) = 64                                                                                               |
|                                                          | <p>Size of <a href="#struct_event">Event</a> additional data. <a href="#adb6493cdff512931871b2239b71215c2">More...</a><br></p>                           |
| const uint32\_t                                          | [EVT\_MAX\_COUNT](#ac34c5452c5be1c370c9c3bf70044d4e0) = 256                                                                                              |
|                                                          | <p>Maximal event count to wait for. <a href="#ac34c5452c5be1c370c9c3bf70044d4e0">More...</a><br></p>                                                     |

***

### DataStructure Documentation <a href="#data-structure-documentation" id="data-structure-documentation"></a>

### Event <a href="#struct_event" id="struct_event"></a>

struct Event

ADK [Event](#struct_event) structure.

|                                           |                                                                      |                                                                                |
| ----------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| Data Fields                               |                                                                      |                                                                                |
| long                                      | handle                                                               | OS [Event](#struct_event) handle or EVT\_ANY\_HANDLE.                          |
| [UID](#a83aa1253e238763a389f784ff78d569e) | id                                                                   | [Event](#struct_event) ID. Must be specified by both raise and wait sides.     |
| char                                      | raised\_data\[[EVT\_DATA\_SIZE](#adb6493cdff512931871b2239b71215c2)] | Additional data for received [Event](#struct_event).                           |
| uint8\_t                                  | raised\_flag                                                         | Raising flag. Indicates that [Event](#struct_event) was successfully received. |
| long                                      | raised\_handle                                                       | OS [Event](#struct_event) return Handle.                                       |
| uint64\_t                                 | raised\_timestamp                                                    | Timestamp of raised event. Unix time in seconds.                               |
| uint16\_t                                 | raised\_version                                                      | [Event](#struct_event) version. Data is componentID/eventID specific.          |

### MacroDefinition Documentation <a href="#macro-definition-documentation" id="macro-definition-documentation"></a>

### EVT\_API <a href="#a7e6311173510f4660ef3c2d2f234f429" id="a7e6311173510f4660ef3c2d2f234f429"></a>

\#define EVT\_API

### TypedefDocumentation <a href="#typedef-documentation" id="typedef-documentation"></a>

### UID <a href="#a83aa1253e238763a389f784ff78d569e" id="a83aa1253e238763a389f784ff78d569e"></a>

typedef uint64\_t \[UID]\(#a83aa1253e238763a389f784ff78d569e)

Unique ID of [Event](#struct_event).

### WaiterHandle <a href="#a7ba4b46d2481427f399dda29a67aaab6" id="a7ba4b46d2481427f399dda29a67aaab6"></a>

typedef unsigned long int \[WaiterHandle]\(#a7ba4b46d2481427f399dda29a67aaab6)

Waiting handle type.

### EnumerationType Documentation <a href="#enumeration-type-documentation" id="enumeration-type-documentation"></a>

### EvtOptions <a href="#aaeb183a7a4790d18f96fa3755b1cbc42" id="aaeb183a7a4790d18f96fa3755b1cbc42"></a>

enum \[EvtOptions]\(#aaeb183a7a4790d18f96fa3755b1cbc42)

EVT engine options

|                                                              |   |
| ------------------------------------------------------------ | - |
| Enumerator                                                   |   |
| EVT\_OPT\_DEFAULT                                            |   |
| EVT\_OPT\_COPY\_NEW\_ONLY\_EVENTS\_IN\_GET\_BY\_HANDLE\_FUNC |   |

### EvtSide <a href="#a45a13daa32f946f8dd819ee734fbf236" id="a45a13daa32f946f8dd819ee734fbf236"></a>

enum \[EvtSide]\(#a45a13daa32f946f8dd819ee734fbf236)

|              |   |
| ------------ | - |
| Enumerator   |   |
| SIDE\_RAISER |   |
| SIDE\_WAITER |   |
| SIDE\_BOTH   |   |

### OSEvents <a href="#a47782499daa82ca02ceec0dde367c162" id="a47782499daa82ca02ceec0dde367c162"></a>

enum \[OSEvents]\(#a47782499daa82ca02ceec0dde367c162)

|                   |   |
| ----------------- | - |
| Enumerator        |   |
| OS\_NOP           |   |
| OS\_EVT\_TIMER    |   |
| OS\_EVT\_DOCK     |   |
| OS\_EVT\_UNDOCK   |   |
| OS\_EVT\_SHUTDOWN |   |

### WaitPolicy <a href="#a7d8e96aac2c9ffc0945f804832b93305" id="a7d8e96aac2c9ffc0945f804832b93305"></a>

enum \[WaitPolicy]\(#a7d8e96aac2c9ffc0945f804832b93305)

Waiting policies for event groups.

|            |                                                        |
| ---------- | ------------------------------------------------------ |
| Enumerator |                                                        |
| WAIT\_ANY  |                                                        |
| WAIT\_ALL  | Stop waiting if at least 1 event from group is raised. |

### FunctionDocumentation <a href="#function-documentation" id="function-documentation"></a>

### evt\_destroy() <a href="#af8fba20f70dc5d4274484f3d3eaf0fc2" id="af8fba20f70dc5d4274484f3d3eaf0fc2"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) int evt\_destroy

De-initialize EVT library.

Destroys caching structures, do cleanup. Make sure all waiters are stopped before this call. Must be called from the same thread that called [evt\_init()](#a799ffc9044180e2968690455cfb5d8cf). [evt\_init()](#a799ffc9044180e2968690455cfb5d8cf)/evt\_destroy() lifecycle calls must be serialized by the caller; concurrent calls cause undefined behavior.

#### Returns

Negative: error with errno value. 0: Library successfully de-initialized.

### evt\_destroy\_waiter() <a href="#a09b61b8da3127a2c067df17d29be4f1f" id="a09b61b8da3127a2c067df17d29be4f1f"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) int evt\_destroy\_waiter

Stops and destroys the asynchronous waiter.

Send waiter thread an exit signal then join the thread. Must not be called while [evt\_wait\_by\_handle()](#a57f2c3182b0ea176490a1735324de25e), [evt\_get\_by\_handle()](#a9fbabdeb66cb9541e4a4c146b7e1658a) or [evt\_peek\_by\_handle()](#a793d32176ee75ec31b31f1fb1cd6abbc) runs concurrently on the same handle: the caller must make sure such calls have returned first, otherwise behavior is undefined.

**Parameters**

**waiter** A handle created by evt\_init\_waiter(). Passing here already destroyed handle cause an undefined behavior.

#### Returns

Negative: error with errno value. 0: on success.

### evt\_get\_by\_handle() <a href="#a9fbabdeb66cb9541e4a4c146b7e1658a" id="a9fbabdeb66cb9541e4a4c146b7e1658a"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) int evt\_get\_by\_handle

Get events so far collected by asynchronous waiter.

Function returns immediately. Returns either all or only 'new' events (collected from the last call), depends from EVT\_OPT\_COPY\_NEW\_ONLY\_EVENTS\_IN\_GET\_BY\_HANDLE\_FUNC compatibility option.

**Parameters**

**waiter** A handle created by evt\_init\_waiter(). Passing here a destroyed handle cause an undefined behavior. **events** Array of Events to fill. **count** Number of events represented in 'events' param. (Must be equal or more as passed to evt\_init\_waiter()).

#### Returns

Negative: error with errno value. 0: success but there is no raised event (since last call). Positive: returns number of raised events. Events are copied to 'events' member.

### evt\_get\_component\_id() <a href="#a2063afa16979be3952b393dd81bfd5f8" id="a2063afa16979be3952b393dd81bfd5f8"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) uint16\_t evt\_get\_component\_id

Returns componentID part of UID.

**Parameters**

**UID**

#### Returns

componentID

### evt\_get\_options() <a href="#aee16ce74c4a65f2ac2952bfd2f06dd27" id="aee16ce74c4a65f2ac2952bfd2f06dd27"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) int evt\_get\_options

Get options.

#### Returns

the options set

### evt\_getVersion() <a href="#a1a7daf80470e0ad3b570ec8fc680821d" id="a1a7daf80470e0ad3b570ec8fc680821d"></a>

const \[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) char\\\* evt\_getVersion

get version of a library

#### Returns

string with version

### evt\_init() <a href="#a799ffc9044180e2968690455cfb5d8cf" id="a799ffc9044180e2968690455cfb5d8cf"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) int evt\_init

Initialize EVT library.

Creates caching structures, sets ignore to SIGPIPE signal (V/OS - raiser side).

**Parameters**

**side** Side to be initialized. **componentID** System wide component ID. **capacity** Estimated number of unique events to be processed.

#### Returns

Negative: error with errno value. 0: Library successfully initialized.

### evt\_init\_waiter() <a href="#a76bffba58228fdcd95671e17bf8ad041" id="a76bffba58228fdcd95671e17bf8ad041"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) \[WaiterHandle]\(#a7ba4b46d2481427f399dda29a67aaab6) evt\_init\_waiter

Initialize asynchronous waiter for a group of events.

**Parameters**

**events** Array of Events to wait for. Caller is responsible to provide only unique ID. **count** Number of events represented in 'events' param.

#### Returns

EVT\_INVALID\_HANDLE on failure or valid WaiterHandle otherwise.

### evt\_make\_uid() <a href="#a886f0a69446395a4013dc45380f4128f" id="a886f0a69446395a4013dc45380f4128f"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) \[UID]\(#a83aa1253e238763a389f784ff78d569e) evt\_make\_uid

Creates UID based on componentID and eventID.

UID Creation helper function for user events.

**Parameters**

**componentID** System wide component ID. **eventID** Component wide event ID.

#### Returns

[Event](#struct_event) UID.

### evt\_make\_uid\_os() <a href="#afb47263c3337482a275b6cecf497204b" id="afb47263c3337482a275b6cecf497204b"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) \[UID]\(#a83aa1253e238763a389f784ff78d569e) evt\_make\_uid\_os

Creates UID based on componentID and OS [Event](#struct_event).

UID Creation helper function for OS events.

**Parameters**

**componentID** System wide component ID. **osEvent** OS Event.

#### Returns

[Event](#struct_event) UID.

### evt\_peek\_by\_handle() <a href="#a793d32176ee75ec31b31f1fb1cd6abbc" id="a793d32176ee75ec31b31f1fb1cd6abbc"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) int evt\_peek\_by\_handle

Peek events so far collected by asynchronous waiter.

Function returns immediately. Returns either all or only 'new' events, depends from EVT\_OPT\_COPY\_NEW\_ONLY\_EVENTS\_IN\_GET\_BY\_HANDLE\_FUNC compatibility option.

**Parameters**

**waiter** A handle created by evt\_init\_waiter(). Passing here a destroyed handle cause an undefined behavior. **events** Array of Events to fill. **count** Number of events represented in 'events' param. (Must be equal or more as passed to evt\_init\_waiter()).

#### Returns

Negative: error with errno value. 0: success but there is no raised event (since last call). Positive: returns number of raised events. Events are copied to 'events' member.

### evt\_raise() <a href="#a2855073610dc2b9210a25468926cfecc" id="a2855073610dc2b9210a25468926cfecc"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) int evt\_raise

Raise an event.

Raise an event specified by 'event'. Works synchronously and returns after event is sent.

**Parameters**

**event** An Event to raise.

#### Returns

Negative: error with errno value. 0: [Event](#struct_event) successfully raised.

### evt\_set\_options() <a href="#a5e8063c63d656262cf58b6336b270502" id="a5e8063c63d656262cf58b6336b270502"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) void evt\_set\_options

Set options changing behavior of ADK-EVT engine.

**Parameters**

**options** The options are coded as bitmasks and can be combined by a logical or operation. All available options are collected in EvtOptions enum.

### evt\_start\_timer() <a href="#af7e23c1a0a2e9a3caa6faf55c3aae1d4" id="af7e23c1a0a2e9a3caa6faf55c3aae1d4"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) long evt\_start\_timer

Starts a new timer.

Schedules an event after a timeout.

**Parameters**

**timeout** Timeout in ms. Max value is 24h (86,400,000 ms)

#### Returns

Negative: error with errno value. Non negative: timer handle.

### evt\_stop\_timer() <a href="#a6f6a659420a37bb9e1d1b07edfe419a2" id="a6f6a659420a37bb9e1d1b07edfe419a2"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) void evt\_stop\_timer

Deletes a timer.

Stops a timer and free associated resources.

**Parameters**

**handle** Timer handle acquired by evt\_start\_timer().

### evt\_wait() <a href="#adb08919483f2094f1927d67dad595278" id="adb08919483f2094f1927d67dad595278"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) int evt\_wait

Wait for a single event.

Stops thread execution till 'event' is received or time specified by 'timeout' is up.

**Parameters**

**event** An Event to wait for. **timeout** A valid wait timeout (timeout > 0) in ms. EVT\_INFINITE\_WAIT - for infinite wait.

#### Returns

Negative: error with errno value. 0: [Event](#struct_event) successfully received. Positive: ETIME - on timeout.

### evt\_wait\_by\_handle() <a href="#a57f2c3182b0ea176490a1735324de25e" id="a57f2c3182b0ea176490a1735324de25e"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) int evt\_wait\_by\_handle

Blocks thread execution until waiter receive an event or timeout occurs.

Function returns only if event is received or timeout occurred

**Parameters**

**waiter** A handle created by evt\_init\_waiter(). Passing here a destroyed handle cause an undefined behavior. **timeout** A valid wait timeout (timeout > 0) in ms. EVT\_INFINITE\_WAIT - for infinite wait. **policy** WaitPolicy for event group.

#### Returns

ETIME: timeout occurred 0: event received

### evt\_wait\_group() <a href="#ab26c08b8228d47a7b83144e5ec6d9c4e" id="ab26c08b8228d47a7b83144e5ec6d9c4e"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) int evt\_wait\_group

Wait for a group of events.

Stops thread execution till one or all (see 'policy') 'events' are received or time specified by 'timeout' is up.

**Parameters**

**events** Array of Events to wait for. Caller is responsible to provide only unique ID. **count** Number of events represented in 'events' param. **timeout** A valid wait timeout (timeout > 0) in ms. EVT\_INFINITE\_WAIT - for infinite wait. **policy** WaitPolicy for event group.

#### Returns

Negative: error with errno value. 0: [Event](#struct_event) successfully received. Positive: ETIME - on timeout.

### get\_dock\_sts() <a href="#adc9d1c34c7762b01b3b9830f1f70c6ed" id="adc9d1c34c7762b01b3b9830f1f70c6ed"></a>

\[EVT\_API]\(#a7e6311173510f4660ef3c2d2f234f429) int get\_dock\_sts

Returns unit dock status.

#### Returns

0: Unit is docked -1: Unit is undocked.

### VariableDocumentation <a href="#variable-documentation" id="variable-documentation"></a>

### EVT\_ANY\_HANDLE <a href="#a63090fb17900201d2517be5e555b7d87" id="a63090fb17900201d2517be5e555b7d87"></a>

const long EVT\_ANY\_HANDLE = -1

Timer [Event](#struct_event) mask that allow to receive all timer events.

### EVT\_DATA\_SIZE <a href="#adb6493cdff512931871b2239b71215c2" id="adb6493cdff512931871b2239b71215c2"></a>

const uint32\_t EVT\_DATA\_SIZE = 64

Size of [Event](#struct_event) additional data.

### EVT\_INFINITE\_WAIT <a href="#a35fc755ca0569e2acb759e0d683a2fb5" id="a35fc755ca0569e2acb759e0d683a2fb5"></a>

const int EVT\_INFINITE\_WAIT = -1

Timeout value for infinite wait.

### EVT\_INVALID\_HANDLE <a href="#a468c3786a00e38b1d61d083fa0b4ce96" id="a468c3786a00e38b1d61d083fa0b4ce96"></a>

const \[WaiterHandle]\(#a7ba4b46d2481427f399dda29a67aaab6) EVT\_INVALID\_HANDLE = 0

Invalid WaiterHandle value.

### EVT\_MAX\_COUNT <a href="#ac34c5452c5be1c370c9c3bf70044d4e0" id="ac34c5452c5be1c370c9c3bf70044d4e0"></a>

const uint32\_t EVT\_MAX\_COUNT = 256

Maximal event count to wait for.


---

# 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/readme/files/dir_1e776ad494434554ed2e1a73460819d8/dir_dc5dfd6157a1d65d3f69cd65a617f88c/libevt_8h.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.
