Solaris Software
Toggle main menu visibility
Loading...
Searching...
No Matches
service.h
Go to the documentation of this file.
1
/**
2
* @file service.h
3
* @brief SPP module descriptor and registry API.
4
*/
5
6
#ifndef SPP_SERVICE_H
7
#define SPP_SERVICE_H
8
9
#include "
spp/core/types.h
"
10
#include "
spp/core/returnTypes.h
"
11
#include "
spp/core/packet.h
"
12
#include "
spp/services/kpid.h
"
13
14
/* ----------------------------------------------------------------
15
* STRUCTS AND ENUMS
16
* ---------------------------------------------------------------- */
17
18
/**
19
* @brief Defines the callbacks and metadata of an SPP producer.
20
*
21
* The producer KPID is assigned during PUBSUB registration.
22
* The timeout field is currently not enforced.
23
*/
24
typedef
struct
25
{
26
const
char
*
p_nameProducer
;
/**< Human-readable module name (for logging). */
27
spp_uint16_t
tiemoutMs
;
/**< Timeout for the producer to send a packet (currently unused)*/
28
SPP_RetVal_t
(*
init
)();
/**< Initialise the module. */
29
SPP_RetVal_t
(*
acquireData
)();
/**< Acquire data from the module. */
30
}
SPP_SERVICE_ProducerContract_t
;
31
32
/**
33
* @brief Describes the contract of a consumer module. This module needs to have:
34
* - a consumer ID
35
* - a name
36
* - a timeout (optional)
37
* - a consumeData function
38
*/
39
typedef
struct
40
{
41
spp_int8_t
priority
;
/**< Priority of the consumer */
42
const
char
*
p_nameConsumer
;
/**< Human-readable module name (for logging). */
43
spp_uint16_t
tiemoutMs
;
/**< Timeout for the consumer to receive a packet */
44
SPP_RetVal_t
(*
init
)();
/**< Initialise the module. */
45
SPP_RetVal_t
(*
deliverToMailbox
)(
const
SPP_Packet_t
packet);
/**< Receives a packet dispatched by PUBSUB. */
46
SPP_RetVal_t
(*
consumeData
)(
void
*p_data);
/**< Consume data from the module. */
47
}
SPP_SERVICE_ConsumerContract_t
;
48
49
50
#endif
/* SPP_SERVICE_H */
kpid.h
APID bitmask assignments for every SPP producer.
packet.h
Solaris Packet Protocol (SPP) packet structure definitions.
SPP_Packet_t
SPP_Packet_t
Definition
packet.h:79
returnTypes.h
Standard return-value type used across all SPP modules.
SPP_RetVal_t
SPP_RetVal_t
Unified return type for all SPP API functions.
Definition
returnTypes.h:24
SPP_SERVICE_ConsumerContract_t
Describes the contract of a consumer module. This module needs to have:
Definition
service.h:40
SPP_SERVICE_ConsumerContract_t::consumeData
SPP_RetVal_t(*) consumeData(void *p_data)
Definition
service.h:46
SPP_SERVICE_ConsumerContract_t::p_nameConsumer
const char * p_nameConsumer
Definition
service.h:42
SPP_SERVICE_ConsumerContract_t::priority
spp_int8_t priority
Definition
service.h:41
SPP_SERVICE_ConsumerContract_t::deliverToMailbox
SPP_RetVal_t(*) deliverToMailbox(const SPP_Packet_t packet)
Definition
service.h:45
SPP_SERVICE_ConsumerContract_t::tiemoutMs
spp_uint16_t tiemoutMs
Definition
service.h:43
SPP_SERVICE_ConsumerContract_t::init
SPP_RetVal_t(*) init()
Definition
service.h:44
SPP_SERVICE_ProducerContract_t
Defines the callbacks and metadata of an SPP producer.
Definition
service.h:25
SPP_SERVICE_ProducerContract_t::tiemoutMs
spp_uint16_t tiemoutMs
Definition
service.h:27
SPP_SERVICE_ProducerContract_t::p_nameProducer
const char * p_nameProducer
Definition
service.h:26
SPP_SERVICE_ProducerContract_t::acquireData
SPP_RetVal_t(*) acquireData()
Definition
service.h:29
SPP_SERVICE_ProducerContract_t::init
SPP_RetVal_t(*) init()
Definition
service.h:28
types.h
Portable integer types and SPI/storage configuration types for SPP.
spp_uint16_t
uint16_t spp_uint16_t
Definition
types.h:29
spp_int8_t
int8_t spp_int8_t
Definition
types.h:28
solaris-v2
spp
services
service.h
Generated by
1.18.0