|
| | msg_arbiter (msg_arbiter const &)=delete |
| void | operator= (msg_arbiter const &)=delete |
| int | push (const msg_arbiter::msg &m, k_timeout_t wait=K_MSEC(CONFIG_MSG_ARBITER_TIMEOUT_MS)) |
| | Push a received message for processing.
|
| int | pull (msg_arbiter::msg &m, subsys s, k_timeout_t wait=K_MSEC(CONFIG_MSG_ARBITER_TIMEOUT_MS)) |
| | Pulls a message for a specific IO interface.
|
| int | fwd (const msg_arbiter::msg &m, subsys s, k_timeout_t wait=K_MSEC(CONFIG_MSG_ARBITER_TIMEOUT_MS)) |
| | Forward a received message for processing.
|
| int | fwd (uint8_t mapid, uint8_t vcid, const msg_arbiter::msg &m, subsys s, k_timeout_t wait=K_MSEC(CONFIG_MSG_ARBITER_TIMEOUT_MS)) |
| uint32_t | backpressure (subsys s) |
| | Returns the number of messages that are waiting in the message queue of a specific subsystem.
|
| void | start () |
| | Starts the processing task for incoming messages handling.
|
Incoming/Outgoing Message Arbiter.
The msg_arbiter class is responsible for:
- Receiving messages: It handles incoming messages from various configured input interfaces.
- Message queuing: It maintains a thread-safe message queue for received frames and individual queues for each output interface.
- Message processing: It processes valid telecommands:
- Local processing: Handles telecommands specific to the SatNOGS-COMMS subsystem.
- Forwarding: Forwards telecommands to the appropriate output interface for delivery to target subsystems within the satellite.
Usage:
To use the msg_arbiter class:
- Instantiate: Create an instance of the class. The class provides singleton access, via the get_instance() method.
- Start: Begin the message processing loop by calling the start() method.
- Push messages: Use the push() method to enqueue received messages from any of the available IO interfaces.
- Pull messages: Messages for specific interfaces can be pulled using the pull() method.
- Note
- Each output interface has a dedicated message queue. A pull() call that may block for a specific interface, does not block the other available.
- Warning
- The start() method should be called once as early as possible in the firmware. Multiple calls of start() may result to undefined behavior.
flowchart TD
subgraph arbiter["msg_arbiter Task"]
msgq["Read RX message queue"]
route["Perfrom routing"]
n1["Is for SatNOGS-COMMS?"]
parse["Parse telecommand"]
tc["Handle telecommand"]
tlm["Produce telemetry"]
radiomsgq["Radio TX mssq"]
uartAmsgq["UART A TX mssq"]
uartBmsgq["UART B TX mssq"]
canAmsgq["CAN A TX mssq"]
canBmsgq["CAN B TX mssq"]
end
msgq --> parse
parse --> n1
n1 -- No --> route
n1 -- Yes --> tc
tc --> tlm
tlm --> route
radio["Radio RX Task"] -- msg_arbiter::push() --> msgq
uartA["UART A RX Task"] -- msg_arbiter::push() --> msgq
uartB["UART B RX Task"] -- msg_arbiter::push() --> msgq
canA["CAN A RX Task"] -- msg_arbiter::push() --> msgq
canB["CAN B RX Task"] -- msg_arbiter::push() --> msgq
radiotx["Radio TX Task"]
uartAtx["UART A TX Task"]
uartBtx["UART B TX Task"]
canAtx["CAN A TX Task"]
canBtx["CAN B TX Task"]
route --> radiomsgq -- msg_arbiter::pull(radio) --> radiotx
route --> uartAmsgq -- msg_arbiter::pull(UART A) --> uartAtx
route --> uartBmsgq -- msg_arbiter::pull(UART B) --> uartBtx
route --> canAmsgq -- msg_arbiter::pull(CAN A) --> canAtx
route --> canBmsgq -- msg_arbiter::pull(CAN B) --> canBtx
n1@{ shape: diam}
Definition at line 71 of file msg_arbiter.hpp.