Publishing 2019 R1.1 content and Myriad plugin sources (#162)
[platform/upstream/dldt.git] / inference-engine / thirdparty / movidius / watchdog / watchdog.h
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #ifndef MVNC_WATCHDOG_H
6 #define MVNC_WATCHDOG_H
7
8 #include <mvnc.h>
9 #ifdef __cplusplus
10 # define WD_API  extern "C"
11 # else
12 # define WD_API
13 #endif
14
15 /**
16 * @brief default ping interval is 1 second
17 */
18 #define WATCHDOG_PING_INTERVAL_MS 1000
19
20 typedef struct wd_context_tag {
21     void * opaque;
22 } wd_context;
23
24 typedef enum {
25     WD_ERRNO = 0,
26     WD_NOTINITIALIZED,
27     WD_DUPLICATE,
28     WD_FAIL
29 } wd_error_t;
30
31 /**
32  * @brief initializes watchdog context, required to be called before any other WD API calls
33  * @return
34  */
35 WD_API wd_error_t watchdog_init_context(wd_context *ctx);
36
37 /**
38  * @brief creates watchdog thread, if not created, and registers new watchee device, and initialise opaque handle to it
39  * @param d - newly connected device descriptor
40  * @return
41  */
42 WD_API wd_error_t watchdog_register_device(wd_context *ctx, devicePrivate_t *d);
43
44 /**
45  * @brief remove watch_dog device from the list, and might stop watchdog worker thread
46  * @return result of operation
47  */
48 WD_API wd_error_t watchdog_unregister_device(wd_context *ctx);
49
50
51 #endif  // MVNC_WATCHDOG_H