df01d116064cc871f60b28ef89f6c0bd6708af51
[platform/upstream/dldt.git] / inference-engine / thirdparty / movidius / XLink / shared / XLinkDispatcher.h
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 ///
6 /// @file
7 ///
8 /// @brief     Application configuration Leon header
9 ///
10 #ifndef _XLINKDISPATCHER_H
11 #define _XLINKDISPATCHER_H
12 #define _XLINK_ENABLE_PRIVATE_INCLUDE_
13 #include "XLinkPrivateDefines.h"
14
15 #ifdef __cplusplus
16 extern "C"
17 {
18 #endif
19 typedef int (*getRespFunction) (xLinkEvent_t*,
20                 xLinkEvent_t*);
21 ///Adds a new event with parameters and returns event.header.id
22 xLinkEvent_t* dispatcherAddEvent(xLinkEventOrigin_t origin,
23                                     xLinkEvent_t *event);
24
25 int dispatcherWaitEventComplete(xLinkDeviceHandle_t* deviceHandle, unsigned int timeout);
26 int dispatcherUnblockEvent(eventId_t id,
27                             xLinkEventType_t type,
28                             streamId_t stream,
29                             void* xlinkFD);
30
31 struct dispatcherControlFunctions {
32                                 int (*eventSend) (xLinkEvent_t*);
33                                 int (*eventReceive) (xLinkEvent_t*);
34                                 getRespFunction localGetResponse;
35                                 getRespFunction remoteGetResponse;
36                                 void (*closeLink) (void* fd);
37                                 void (*closeDeviceFd) (xLinkDeviceHandle_t* deviceHandle);
38                                 };
39
40 int dispatcherInitialize(struct dispatcherControlFunctions* controlFunc);
41 int dispatcherStart(xLinkDeviceHandle_t* deviceHandle);
42 int dispatcherClean(void* xLinkFD);
43
44 #ifdef __cplusplus
45 }
46 #endif
47
48 #endif