Revision 7d9678db inc/urt_service.h

View differences:

inc/urt_service.h
22 22
#ifndef URTWARE_SERVICE_H
23 23
#define URTWARE_SERVICE_H
24 24

  
25
#include <urt_types.h>
26
#include <urtware.h>
27

  
25 28
/******************************************************************************/
26 29
/* CONSTANTS                                                                  */
27 30
/******************************************************************************/
......
38 41
/* DATA STRUCTURES AND TYPES                                                  */
39 42
/******************************************************************************/
40 43

  
44
/**
45
 * @brief  service
46
 */
47
typedef struct urt_service
48
{
49
    urt_service_t* next;
50
    urt_serviceid_t id;
51
    urt_osMutex_t lock;
52
    urt_servicefunc_t* callback;
53
    #if (URT_CFG_RPC_PROFILING)
54
        uint64_t sumDurations;
55
        uint64_t numCalls;
56
        uint64_t numTimeouts;
57
        urt_delay_t minDuration;
58
        urt_delay_t maxDuration;
59
    #endif /* URT_CFG_RPC_PROFILING */
60
}urt_service_t;
61

  
41 62
/******************************************************************************/
42 63
/* MACROS                                                                     */
43 64
/******************************************************************************/
......
46 67
/* EXTERN DECLARATIONS                                                        */
47 68
/******************************************************************************/
48 69

  
70
#if defined(__cplusplus)
71
extern "C" {
72
#endif /* defined(__cplusplus) */
73

  
74
    urt_status_t urtServiceInit(urt_service_t* service, urt_serviceid_t id, urt_servicefunc_t* callback);
75
    urt_status_t urtServiceCall(urt_service_t* service, void* arg, void* ret, urt_delay_t timeout);
76
#if defined(__cplusplus)
77
}
78
#endif /* defined(__cplusplus) */
79

  
49 80
/******************************************************************************/
50 81
/* INLINE FUNCTIONS                                                           */
51 82
/******************************************************************************/

Also available in: Unified diff