1 /*
2  * Copyright 2017, NXP
3  * All rights reserved.
4  *
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #ifndef __SRTM_PEERCORE_STRUCT_H__
10 #define __SRTM_PEERCORE_STRUCT_H__
11 
12 #include "srtm_defs.h"
13 #include "srtm_list.h"
14 #include "srtm_mutex.h"
15 
16 /*******************************************************************************
17  * Definitions
18  ******************************************************************************/
19 /**
20  * @brief SRTM peer core struct
21  */
22 struct _srtm_peercore
23 {
24     uint32_t id;          /*!< SRTM peer core ID */
25     srtm_list_t node;     /*!< SRTM peer core list node to link to a list */
26     srtm_list_t channels; /*!< SRTM channel list to maintain channels added to the peer core */
27     srtm_list_t pendingQ; /*!< Pending messages queue */
28 
29     srtm_dispatcher_t dispatcher;
30     srtm_mutex_t mutex;
31 #if defined(SRTM_STATIC_API) && SRTM_STATIC_API
32     srtm_mutex_buf_t mutexStatic;
33 #endif
34 
35     bool started;
36     srtm_peercore_state_t state;
37     srtm_peercore_wakeup_cb_t wakeupFunc;
38     void *wakeupParam;
39 };
40 
41 /*******************************************************************************
42  * API
43  ******************************************************************************/
44 
45 /*! @} */
46 
47 #endif /* __SRTM_PEERCORE_STRUCT_H__ */
48