1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
8 /// @brief Application configuration Leon header
10 #ifndef _XLINKDISPATCHER_H
11 #define _XLINKDISPATCHER_H
12 #define _XLINK_ENABLE_PRIVATE_INCLUDE_
13 #include "XLinkPrivateDefines.h"
19 typedef int (*getRespFunction) (xLinkEvent_t*,
21 ///Adds a new event with parameters and returns event.header.id
22 xLinkEvent_t* dispatcherAddEvent(xLinkEventOrigin_t origin,
25 int dispatcherWaitEventComplete(xLinkDeviceHandle_t* deviceHandle, unsigned int timeout);
26 int dispatcherUnblockEvent(eventId_t id,
27 xLinkEventType_t type,
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);
40 int dispatcherInitialize(struct dispatcherControlFunctions* controlFunc);
41 int dispatcherStart(xLinkDeviceHandle_t* deviceHandle);
42 int dispatcherClean(void* xLinkFD);