Statistics
| Branch: | Revision:

urtware / inc / urt_core.h @ e566c39e

History | View | Annotate | Download (3.542 KB)

1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

    
22
#ifndef URTWARE_CORE_H
23
#define URTWARE_CORE_H
24

    
25
#include <urtware.h>
26

    
27
/******************************************************************************/
28
/* CONSTANTS                                                                  */
29
/******************************************************************************/
30

    
31
/******************************************************************************/
32
/* SETTINGS                                                                   */
33
/******************************************************************************/
34

    
35
/******************************************************************************/
36
/* CHECKS                                                                     */
37
/******************************************************************************/
38

    
39
/******************************************************************************/
40
/* DATA STRUCTURES AND TYPES                                                  */
41
/******************************************************************************/
42

    
43
/**
44
 * @brief  core
45
 */
46
typedef struct urt_core
47
{
48
  urt_node_t* _nodes;
49
  urt_osEventSource_t* _evtSource;
50
  urt_osMutex_t _lock;
51
  urt_status_t _status;
52
  #if (URT_CFG_PUBSUB_ENABLED)
53
    urt_topic_t* _topics;
54
  #endif /* URT_CFG_PUBSUB_ENABLED */
55
  #if (URT_CFG_RPC_ENABLED)
56
    urt_service_t* _services;
57
  #endif /* URT_CFG_RPC_ENABLED */
58
}urt_core_t;
59

    
60
/******************************************************************************/
61
/* MACROS                                                                     */
62
/******************************************************************************/
63

    
64
/******************************************************************************/
65
/* EXTERN DECLARATIONS                                                        */
66
/******************************************************************************/
67

    
68
#if defined(__cplusplus)
69
extern "C" {
70
#endif /* defined(__cplusplus) */
71

    
72
  void urtCoreInit(void);
73
  urt_status_t urtCoreGetStatus(void);
74
  void urtCoreStartNodes(void);
75
  urt_status_t urtCoreSynchronizeNodes(urt_node_t* node);
76
  urt_status_t urtCoreStopNodes(urt_status_t reason);
77

    
78
#if (URT_CFG_PUBSUB_ENABLED)
79
  urt_topic_t* urtCoreGetTopic(urt_topicid_t id);
80
#endif /* URT_CFG_PUBSUB_ENABLED */
81

    
82
#if (URT_CFG_RPC_ENABLED)
83
  urt_service_t urtCoreGetService(urt_serviceid_t id);
84
#endif /* URT_CFG_RPC_ENABLED */
85

    
86
#if defined(__cplusplus)
87
}
88
#endif /* defined(__cplusplus) */
89

    
90
/******************************************************************************/
91
/* INLINE FUNCTIONS                                                           */
92
/******************************************************************************/
93

    
94
#endif /* URTWARE_CORE_H */