UART telemetry consumer service implementation. More...
Go to the source code of this file.
Functions | |
| static SPP_RetVal_t | SPP_SERVICES_UART_init (void) |
| Initialise the UART port and clear the packet mailbox. | |
| static SPP_RetVal_t | SPP_SERVICES_UART_deliverToMailbox (const SPP_Packet_t packet) |
| Store a packet delivered by the PUBSUB router. | |
| static SPP_RetVal_t | SPP_SERVICES_UART_consumeData (void *p_data) |
| Transmit the oldest pending SPP packet over UART. | |
| const SPP_SERVICE_ConsumerContract_t * | SPP_SERVICES_UART_getConsumerContract (void) |
| Get the UART consumer contract. | |
| SPP_RetVal_t | SPP_SERVICES_UART_getInitStatus (void) |
| Get the result of the last UART service init. | |
Variables | |
| static SPP_Packet_t | s_mailbox [K_UART_MAILBOX_SIZE] |
| static spp_uint8_t | s_mailboxHead = 0U |
| static spp_uint8_t | s_mailboxTail = 0U |
| static spp_uint8_t | s_mailboxCount = 0U |
| static SPP_RetVal_t | s_initStatus = K_SPP_ERROR_NOT_INITIALIZED |
| static const SPP_SERVICE_ConsumerContract_t | g_uartConsumerContract |
UART telemetry consumer service implementation.
The service keeps a small FIFO of SPP packets delivered by the PUBSUB router. Every superloop tick, SPP_SERVICES_UART_consumeData transmits the oldest pending packet over the UART HAL, byte-for-byte.
Definition in file uart.c.
|
static |
Initialise the UART port and clear the packet mailbox.
Definition at line 64 of file uart.c.
References s_initStatus, s_mailboxCount, s_mailboxHead, s_mailboxTail, SPP_HAL_UART_portInit(), and SPP_SERVICES_UART_init().
Referenced by SPP_SERVICES_UART_init().
|
static |
Store a packet delivered by the PUBSUB router.
| packet | Packet dispatched by the router. |
Definition at line 79 of file uart.c.
References K_SPP_OK, K_UART_MAILBOX_SIZE, s_mailbox, s_mailboxCount, s_mailboxHead, s_mailboxTail, SPP_Packet_t, and SPP_SERVICES_UART_deliverToMailbox().
Referenced by SPP_SERVICES_UART_deliverToMailbox().
|
static |
Transmit the oldest pending SPP packet over UART.
| p_data | Unused (context pointer reserved for future use). |
Definition at line 101 of file uart.c.
References K_SPP_OK, K_UART_MAILBOX_SIZE, s_mailbox, s_mailboxCount, s_mailboxHead, SPP_HAL_UART_transmit(), SPP_Packet_t, and SPP_SERVICES_UART_consumeData().
Referenced by SPP_SERVICES_UART_consumeData().
| const SPP_SERVICE_ConsumerContract_t * SPP_SERVICES_UART_getConsumerContract | ( | void | ) |
Get the UART consumer contract.
Definition at line 46 of file uart.c.
References g_uartConsumerContract, and SPP_SERVICES_UART_getConsumerContract().
Referenced by SPP_SERVICES_UART_getConsumerContract().
| SPP_RetVal_t SPP_SERVICES_UART_getInitStatus | ( | void | ) |
Get the result of the last UART service init.
Definition at line 51 of file uart.c.
References s_initStatus, and SPP_SERVICES_UART_getInitStatus().
Referenced by SPP_SERVICES_UART_getInitStatus().
|
static |
Definition at line 27 of file uart.c.
Referenced by SPP_SERVICES_UART_consumeData(), and SPP_SERVICES_UART_deliverToMailbox().
|
static |
Definition at line 28 of file uart.c.
Referenced by SPP_SERVICES_UART_consumeData(), SPP_SERVICES_UART_deliverToMailbox(), and SPP_SERVICES_UART_init().
|
static |
Definition at line 29 of file uart.c.
Referenced by SPP_SERVICES_UART_deliverToMailbox(), and SPP_SERVICES_UART_init().
|
static |
Definition at line 30 of file uart.c.
Referenced by SPP_SERVICES_UART_consumeData(), SPP_SERVICES_UART_deliverToMailbox(), and SPP_SERVICES_UART_init().
|
static |
Definition at line 32 of file uart.c.
Referenced by SPP_SERVICES_DATALOGGER_getInitStatus(), SPP_SERVICES_DATALOGGER_init(), SPP_SERVICES_UART_getInitStatus(), and SPP_SERVICES_UART_init().
|
static |
Definition at line 34 of file uart.c.
Referenced by SPP_SERVICES_UART_getConsumerContract().