Solaris Software
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"
11#include "spp/core/packet.h"
12#include "spp/services/kpid.h"
13
14/* ----------------------------------------------------------------
15 * STRUCTS AND ENUMS
16 * ---------------------------------------------------------------- */
17
18/**
19
20* @brief Describes the contract of a producer module. This module needs to have:
21* - a producer ID
22* - a name
23* - a timeout
24* - an init function
25* - an acquireData function
26*/
27typedef struct
28{
29 const char *p_nameProducer; /**< Human-readable module name (for logging). */
30 spp_uint16_t tiemoutMs; /**< Timeout for the producer to send a packet */
31 SPP_RetVal_t (*init)(); /**< Initialise the module. */
32 SPP_RetVal_t (*acquireData)(); /**< Acquire data from the module. */
34
35/**
36* @brief Describes the contract of a consumer module. This module needs to have:
37* - a consumer ID
38* - a name
39* - a timeout (optional)
40* - a consumeData function
41*/
42typedef struct
43{
44 spp_int8_t priority; /**< Priority of the consumer */
45 const char *p_nameConsumer; /**< Human-readable module name (for logging). */
46 spp_uint16_t tiemoutMs; /**< Timeout for the consumer to receive a packet */
47 spp_uint16_t suscribeToApid; /**< APID subscription bitmask */
48 SPP_RetVal_t (*init)(); /**< Initialise the module. */
50 SPP_RetVal_t (*consumeData)(void *p_data); /**< Consume data from the module. */
52
53
54#endif /* SPP_SERVICE_H */
APID bitmask assignments for every SPP producer.
Solaris Packet Protocol (SPP) packet structure definitions.
SPP_Packet_t
Definition packet.h:79
Standard return-value type used across all SPP modules.
SPP_RetVal_t
Unified return type for all SPP API functions.
Definition returnTypes.h:24
Describes the contract of a consumer module. This module needs to have:
Definition service.h:43
SPP_RetVal_t(*) consumeData(void *p_data)
Definition service.h:50
SPP_RetVal_t(*) deliverToMailbox(const SPP_Packet_t packet)
Definition service.h:49
SPP_RetVal_t(*) init()
Definition service.h:48
Describes the contract of a producer module. This module needs to have:
Definition service.h:28
SPP_RetVal_t(*) acquireData()
Definition service.h:32
SPP_RetVal_t(*) init()
Definition service.h:31
Portable integer types and SPI/storage configuration types for SPP.
uint16_t spp_uint16_t
Definition types.h:29
int8_t spp_int8_t
Definition types.h:28