CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
agenda_from_file.c File Reference
Include dependency graph for agenda_from_file.c:

Functions

uint8_t TCMD_parse_tcmds_from_file_and_enqueue (const char *file_path, uint64_t min_tsexec_inclusive, uint64_t max_tsexec_exclusive, uint16_t max_enqueue_count)
 Parses a file of telecommands and enqueues them into the agenda.

Variables

char * TCMD_active_agenda_filename_disabled_sentinel = "DISABLED"
 When TCMD_active_agenda_filename is set to this value, agenda loading is disabled.
char * TCMD_active_agenda_filename_default_file = "default_tcmd_agenda.txt"
char TCMD_active_agenda_filename [LFS_MAX_PATH_LENGTH] = "default_tcmd_agenda.txt"
 The file path of the agenda file to load upcoming telecommands from.

Function Documentation

◆ TCMD_parse_tcmds_from_file_and_enqueue()

uint8_t TCMD_parse_tcmds_from_file_and_enqueue ( const char * file_path,
uint64_t min_tsexec_inclusive,
uint64_t max_tsexec_exclusive,
uint16_t max_enqueue_count )

Parses a file of telecommands and enqueues them into the agenda.

Parameters
file_pathPath to file with one telecommand per line.
min_tsexec_inclusiveFilter to only telecommands with tsexec greater than or equal to this value.
max_tsexec_exclusiveFilter to only telecommands with tsexec less than this value.
max_enqueue_countMaximum number of telecommands to enqueue. Stop after this many successes. Mostly for safety.
Returns
0 on success.

The file should have one telecommand per line, like so: CTS1+xxx(...)!\nCTS1+yyy(...)!\n

Note
Obeys all the rules about enqueuing duplicate tssent telecommands. Recommend having unique @tssent values for each telecommand, and enabling the TCMD_require_unique_tssent config option.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ TCMD_active_agenda_filename

char TCMD_active_agenda_filename[LFS_MAX_PATH_LENGTH] = "default_tcmd_agenda.txt"

The file path of the agenda file to load upcoming telecommands from.

Warning
While a default agenda is set, it is critical to understand that you SHOULD NOT fill this agenda file unless absolutely necessary. If you create and fill an agenda with this default name, it will run on every boot, thus defeating the purpose of reboots being a stable, fail-safe startup mode.
Note
If system stability ends up being super bad, you can put commands in the default to run at the earth poles on subsequent reboots. That's probably the only time you should ever create this file though!
Nominally, put the agenda in another random file, then update this config string to point to that other file. That way, on reboot, the agenda stops running (as a fail-safe)!
Set this to "DISABLED" (case-sensitive) to disable this feature entirely.

◆ TCMD_active_agenda_filename_default_file

char* TCMD_active_agenda_filename_default_file = "default_tcmd_agenda.txt"

◆ TCMD_active_agenda_filename_disabled_sentinel

char* TCMD_active_agenda_filename_disabled_sentinel = "DISABLED"

When TCMD_active_agenda_filename is set to this value, agenda loading is disabled.