The command service is probably one of the most critical components of our flight software architecture, as it determines the satellite’s mode of operation. It analyzes the current state of the spacecraft using the Parameter Table, and determines which operating mode the satellite should be in. The goal of this task is to create the command service thread with the capability of executing the modes of operation and executing commands received directly from ground station.
The role of the command service is better described using this zoomed-in version of our architecture diagram.
You can find the full diagram on the Firmware x CDH x Pay-Firm IDR slides
The command service is essentially a finite state machine (FSM) that would use the values read from the parameter table to determine when to change to a certain mode of operation. There is also a special connection from the RF transceiver to the Command Service, to forward commands from the ground station directly to the Command Service. These commands allow us on the ground to force the satellite into a certain mode of operation. The RF Handler will update a message queue with a command struct that details the command type, any arguments and the trigger type. The trigger type will indicate whether the command needs to be executed immediately or scheduled for a given time.
Once the command service knows which operating mode the satellite needs to enter, it will awaken the Command Handler thread, which will then be in charge of awakening the corresponding operating mode thread and ensuring that the thread runs successfully to completion.
Your main points of contacts are:
The command handler should be designed as a CSP thread, which has the capability send messages over a CSP connection or shared message queues